From 99393624e3bf001a6c20c7615ac88ef4201a93f8 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sun, 15 Dec 2013 12:26:04 +0100 Subject: Fixes related to SAM types. 1. Changes to SAMType extractor 2. Self names are no longer members of enclosing class 3. SAM-Type closures now print with their result type. 4. refactoring newSkolemSingleon ==> narrow --- src/dotty/tools/dotc/typer/Namer.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/dotty/tools/dotc/typer/Namer.scala') diff --git a/src/dotty/tools/dotc/typer/Namer.scala b/src/dotty/tools/dotc/typer/Namer.scala index 3ddd3980b..9627065b2 100644 --- a/src/dotty/tools/dotc/typer/Namer.scala +++ b/src/dotty/tools/dotc/typer/Namer.scala @@ -229,7 +229,8 @@ class Namer { typer: Typer => def inClassContext(selfInfo: DotClass /* Should be Type | Symbol*/)(implicit ctx: Context): Context = { val localCtx: Context = ctx.fresh.withNewScope selfInfo match { - case sym: Symbol if sym.exists && sym.name != nme.WILDCARD => localCtx.enter(sym) + case sym: Symbol if sym.exists && sym.name != nme.WILDCARD => + localCtx.scope.asInstanceOf[MutableScope].enter(sym) case _ => } localCtx @@ -409,7 +410,7 @@ class Namer { typer: Typer => tp & itpe } } - // println(s"final inherited for $sym: ${inherited.toString}") !!! + // println(s"final inherited for $sym: ${inherited.toString}") !!! // println(s"owner = ${sym.owner}, decls = ${sym.owner.info.decls.show}") def rhsType = adapt(typedAheadExpr(mdef.rhs), WildcardType).tpe.widen def lhsType = fullyDefinedType(rhsType, "right-hand side", mdef.pos) -- cgit v1.2.3