summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
Diffstat (limited to 'sources')
-rw-r--r--sources/scala/tools/nsc/ast/TreePrinters.scala2
-rwxr-xr-xsources/scala/tools/nsc/transform/Erasure.scala2
-rwxr-xr-xsources/scala/tools/nsc/typechecker/Typers.scala32
3 files changed, 17 insertions, 19 deletions
diff --git a/sources/scala/tools/nsc/ast/TreePrinters.scala b/sources/scala/tools/nsc/ast/TreePrinters.scala
index c7d02e447f..df5683618f 100644
--- a/sources/scala/tools/nsc/ast/TreePrinters.scala
+++ b/sources/scala/tools/nsc/ast/TreePrinters.scala
@@ -214,7 +214,7 @@ abstract class TreePrinters {
print(fun); printRow(vargs, "(", ", ", ")");
case Super(qual, mixin) =>
- if (qual != nme.EMPTY.toTypeName) print(symName(tree, qual) + ".");
+ if (qual != nme.EMPTY.toTypeName || tree.symbol != NoSymbol) print(symName(tree, qual) + ".");
print("super");
if (mixin != nme.EMPTY.toTypeName)
print("[" + mixin + "]")
diff --git a/sources/scala/tools/nsc/transform/Erasure.scala b/sources/scala/tools/nsc/transform/Erasure.scala
index cfc9cecb4e..b9042dcdf7 100755
--- a/sources/scala/tools/nsc/transform/Erasure.scala
+++ b/sources/scala/tools/nsc/transform/Erasure.scala
@@ -118,7 +118,7 @@ abstract class Erasure extends AddInterfaces with typechecker.Analyzer {
else if (sym.name == nme.update)
tp match {
case MethodType(List(index, tvar), restpe) =>
- MethodType(List(erasure(index), tvar), erasure(restpe))
+ MethodType(List(erasure(index), tvar), erasedTypeRef(UnitClass))
}
else erasure(tp)
} else
diff --git a/sources/scala/tools/nsc/typechecker/Typers.scala b/sources/scala/tools/nsc/typechecker/Typers.scala
index 0d0f5b0244..f946cca77e 100755
--- a/sources/scala/tools/nsc/typechecker/Typers.scala
+++ b/sources/scala/tools/nsc/typechecker/Typers.scala
@@ -674,25 +674,23 @@ import collection.mutable.HashMap;
var tpt1 =
checkNoEscaping.locals(context.scope, WildcardType,
checkNoEscaping.privates(meth,
- typedType(ddef.tpt)));
+ typedType(ddef.tpt)));
checkNonCyclic(ddef.pos, tpt1.tpe, meth);
val rhs1 =
- checkNoEscaping.locals(
- context.scope, tpt1.tpe,
- if (ddef.name == nme.CONSTRUCTOR) {
- if (!meth.hasFlag(SYNTHETIC) &&
- !(meth.owner.isClass ||
- meth.owner.isModuleClass ||
- meth.owner.isAnonymousClass ||
- meth.owner.isRefinementClass))
- error(ddef.pos, "constructor definition not allowed here " + meth.owner);//debug
- context.enclClass.owner.setFlag(INCONSTRUCTOR);
- val result = typed(ddef.rhs, EXPRmode | INCONSTRmode, UnitClass.tpe);
- context.enclClass.owner.resetFlag(INCONSTRUCTOR);
- if (meth.isPrimaryConstructor && !phase.erasedTypes && reporter.errors() == 0)
- computeParamAliases(meth.owner, vparamss1, result);
- result
- } else transformedOrTyped(ddef.rhs, tpt1.tpe));
+ if (ddef.name == nme.CONSTRUCTOR) {
+ if (!meth.hasFlag(SYNTHETIC) &&
+ !(meth.owner.isClass ||
+ meth.owner.isModuleClass ||
+ meth.owner.isAnonymousClass ||
+ meth.owner.isRefinementClass))
+ error(ddef.pos, "constructor definition not allowed here " + meth.owner);//debug
+ context.enclClass.owner.setFlag(INCONSTRUCTOR);
+ val result = typed(ddef.rhs, EXPRmode | INCONSTRmode, UnitClass.tpe);
+ context.enclClass.owner.resetFlag(INCONSTRUCTOR);
+ if (meth.isPrimaryConstructor && !phase.erasedTypes && reporter.errors() == 0)
+ computeParamAliases(meth.owner, vparamss1, result);
+ result
+ } else transformedOrTyped(ddef.rhs, tpt1.tpe);
copy.DefDef(ddef, ddef.mods, ddef.name, tparams1, vparamss1, tpt1, rhs1) setType NoType
}