summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
diff options
context:
space:
mode:
authorSean McDirmid <sean.mcdirmid@gmail.com>2006-02-09 15:03:35 +0000
committerSean McDirmid <sean.mcdirmid@gmail.com>2006-02-09 15:03:35 +0000
commit25eb10e214a35aa9f8c5a811a668e1fcfeed842c (patch)
tree3857ce17f503f6d4bf79c32437d50e94c7d7e324 /src/compiler/scala/tools/nsc/typechecker/Contexts.scala
parent1d7dd9a70a0d47268e784a78460fe224c741426e (diff)
downloadscala-25eb10e214a35aa9f8c5a811a668e1fcfeed842c.tar.gz
scala-25eb10e214a35aa9f8c5a811a668e1fcfeed842c.tar.bz2
scala-25eb10e214a35aa9f8c5a811a668e1fcfeed842c.zip
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Contexts.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Contexts.scala17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
index c6aa1d8c8e..f2513bd789 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
@@ -19,22 +19,25 @@ mixin class Contexts requires Analyzer {
val startContext = {
import definitions._;
var sc = NoContext.make(
- Template(List(), List()) setSymbol NoSymbol setType NoType,
- definitions.RootClass,
- definitions.RootClass.info.decls);
+ Template(List(), List()) setSymbol NoSymbol setType NoType,
+ definitions.RootClass,
+ definitions.RootClass.info.decls);
def addImport(pkg: Symbol): unit = {
+ assert(pkg != null, "package is null");
val qual = gen.mkStableRef(pkg);
sc = sc.makeNewImport(
- Import(qual, List(Pair(nme.WILDCARD, null)))
- setSymbol NoSymbol.newImport(Position.NOPOS).setInfo(ImportType(qual))
- setType NoType);
+ Import(qual, List(Pair(nme.WILDCARD, null)))
+ setSymbol NoSymbol.newImport(Position.NOPOS).setInfo(ImportType(qual))
+ setType NoType);
sc.depth = sc.depth + 1
}
if (!settings.noimports.value) {
+ assert(isDefinitionsInitialized);
addImport(JavaLangPackage);
+ assert(ScalaPackage != null, "Scala package is null");
addImport(ScalaPackage);
if (!settings.nopredefs.value)
- addImport(PredefModule);
+ addImport(PredefModule);
}
sc
}