summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/scala/tools')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Namers.scala3
-rw-r--r--src/compiler/scala/tools/nsc/util/SourceFile.scala2
2 files changed, 5 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
index c0160d5d34..1ea41ff928 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
@@ -1278,6 +1278,9 @@ trait Namers { self: Analyzer =>
}
checkSelectors(selectors)
transformed(tree) = treeCopy.Import(tree, expr1, selectors)
+ expr.symbol = expr1.symbol // copy symbol and type attributes back into old expression
+ // so that the structure builder will find it.
+ expr.tpe = expr1.tpe
ImportType(expr1)
}
} catch {
diff --git a/src/compiler/scala/tools/nsc/util/SourceFile.scala b/src/compiler/scala/tools/nsc/util/SourceFile.scala
index 97aa08b183..44e06441ce 100644
--- a/src/compiler/scala/tools/nsc/util/SourceFile.scala
+++ b/src/compiler/scala/tools/nsc/util/SourceFile.scala
@@ -26,8 +26,10 @@ abstract class SourceFile {
new OffsetPosition(this, offset)
}
def position(line: Int, column: Int) : Position = new OffsetPosition(this, lineToOffset(line) + column)
+
def offsetToLine(offset: Int): Int
def lineToOffset(index : Int): Int
+
/** Map a position to a position in the underlying source file.
* For regular source files, simply return the argument.
*/