summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Contexts.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Contexts.scala4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
index cc8b069607..2be187381f 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
@@ -46,7 +46,9 @@ trait Contexts { self: Analyzer =>
if (!unit.isJava) {
assert(ScalaPackage ne null, "Scala package is null")
imps += ScalaPackage
- if (!(treeInfo.isPredefUnit(unit.body) || treeInfo.containsLeadingPredefImport(List(unit.body))))
+ if (!(treeInfo.isUnitInScala(unit.body, nme.Predef) ||
+ treeInfo.isUnitInScala(unit.body, nme.ScalaObject) ||
+ treeInfo.containsLeadingPredefImport(List(unit.body))))
imps += PredefModule
}
}