From c76cffe04fd690378337971c78736f920b9a479d Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Fri, 7 Jun 2013 16:11:23 +0200 Subject: Added `pos` meethod to symbols. --- src/dotty/tools/dotc/core/Symbols.scala | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/dotty/tools/dotc') 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" -- cgit v1.2.3