aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-06-07 16:11:23 +0200
committerMartin Odersky <odersky@gmail.com>2013-06-07 16:11:23 +0200
commitc76cffe04fd690378337971c78736f920b9a479d (patch)
treef9c390b37bcdc8fcd0b4de470112c41410df74b4 /src/dotty/tools/dotc
parent1571ec5f39cacac6433cce0a140ebfb18e2ac314 (diff)
downloaddotty-c76cffe04fd690378337971c78736f920b9a479d.tar.gz
dotty-c76cffe04fd690378337971c78736f920b9a479d.tar.bz2
dotty-c76cffe04fd690378337971c78736f920b9a479d.zip
Added `pos` meethod to symbols.
Diffstat (limited to 'src/dotty/tools/dotc')
-rw-r--r--src/dotty/tools/dotc/core/Symbols.scala5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/Symbols.scala b/src/dotty/tools/dotc/core/Symbols.scala
index 34b3eae73..881e86880 100644
--- a/src/dotty/tools/dotc/core/Symbols.scala
+++ b/src/dotty/tools/dotc/core/Symbols.scala
@@ -377,6 +377,11 @@ object Symbols {
private def pickFile(file: AbstractFile, classFile: Boolean): AbstractFile =
if ((file eq null) || classFile != (file.path endsWith ".class")) null else file
+ /** The position of this symbol.
+ * @pre Symbol was loaded from source
+ */
+ def pos: Position = coord.toPosition
+
/** The prefix string to be used when displaying this symbol without denotation */
protected def prefixString = "Symbol"