summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Namers.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2009-01-13 18:50:50 +0000
committerMartin Odersky <odersky@gmail.com>2009-01-13 18:50:50 +0000
commit323e895672ba0f9426be33de485bb7a6190af74c (patch)
tree97da75af4762b055dcd095ce84d2232af119ff12 /src/compiler/scala/tools/nsc/typechecker/Namers.scala
parent55795630fd0b7a4dd3e25dff1b9618e6f73adf23 (diff)
downloadscala-323e895672ba0f9426be33de485bb7a6190af74c.tar.gz
scala-323e895672ba0f9426be33de485bb7a6190af74c.tar.bz2
scala-323e895672ba0f9426be33de485bb7a6190af74c.zip
renamed util.control.Break to Breaks and added ...
renamed util.control.Break to Breaks and added support for continue. Fully implemented package objects.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Namers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Namers.scala13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
index adab0faebf..f3fe615e80 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
@@ -181,13 +181,13 @@ trait Namers { self: Analyzer =>
}
def enterPackageSymbol(pos: Position, name: Name): Symbol = {
- val cscope = if (context.owner == EmptyPackageClass) RootClass.info.decls
- else context.scope
+ val (cscope, cowner) =
+ if (context.owner == EmptyPackageClass) (RootClass.info.decls, RootClass)
+ else (context.scope, context.owner)
val p: Symbol = cscope.lookupWithContext(name)(context.owner)
if (p.isPackage && cscope == p.owner.info.decls) {
p
} else {
- val cowner = if (context.owner == EmptyPackageClass) RootClass else context.owner
val pkg = cowner.newPackage(pos, name)
// IDE: newScope should be ok because packages are never destroyed.
if (inIDE) assert(!pkg.moduleClass.hasRawInfo || !pkg.moduleClass.rawInfo.isComplete)
@@ -286,7 +286,7 @@ trait Namers { self: Analyzer =>
def deSkolemize: TypeMap = new DeSkolemizeMap(applicableTypeParams(context.owner))
// should be special path for IDE but maybe not....
- def enterSym(tree: Tree): Context = {
+ def enterSym(tree: Tree): Context = try {
def finishWith(tparams: List[TypeDef]) {
val sym = tree.symbol
@@ -399,6 +399,11 @@ trait Namers { self: Analyzer =>
}
}
this.context
+ } catch {
+ case ex: TypeError =>
+ //Console.println("caught " + ex + " in enterSym")//DEBUG
+ typer.reportTypeError(tree.pos, ex)
+ this.context
}
def enterSyntheticSym(tree: Tree): Symbol = {