summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/backend/icode/GenICode.scala2
-rw-r--r--src/compiler/scala/tools/nsc/transform/UnCurry.scala2
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala9
-rw-r--r--src/library/scala/Array.scala2
4 files changed, 8 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala
index 2325d27060..e223ab112a 100644
--- a/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala
+++ b/src/compiler/scala/tools/nsc/backend/icode/GenICode.scala
@@ -624,7 +624,7 @@ abstract class GenICode extends SubComponent {
assert(ctor.isClassConstructor,
"'new' call to non-constructor: " + tree)
- generatedType = toTypeKind(tpt.tpe.normalize) // @M: because typedTypeConstructor doesn't normalize anymore
+ generatedType = toTypeKind(tpt.tpe)
assert(generatedType.isReferenceType || generatedType.isArrayType,
"Non reference type cannot be instantiated: " + generatedType)
diff --git a/src/compiler/scala/tools/nsc/transform/UnCurry.scala b/src/compiler/scala/tools/nsc/transform/UnCurry.scala
index a9617225a6..2cfd6886f8 100644
--- a/src/compiler/scala/tools/nsc/transform/UnCurry.scala
+++ b/src/compiler/scala/tools/nsc/transform/UnCurry.scala
@@ -82,7 +82,7 @@ abstract class UnCurry extends InfoTransform with TypingTransformers {
* - if symbol is a def parameter with transformed type T, return () => T
*/
def transformInfo(sym: Symbol, tp: Type): Type =
- if (sym.isType) uncurryType(tp.normalize) else uncurry(tp.normalize)
+ if (sym.isType) uncurryType(tp.normalize) else uncurry(tp.normalize) // @MAT
class UnCurryTransformer(unit: CompilationUnit) extends TypingTransformer(unit) {
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index c56e873525..8a03ae3a44 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -2513,11 +2513,12 @@ trait Typers requires Analyzer {
//@M! the polytype denotes the expected kind
(arg, tparam) => typedHigherKindedType(arg, parameterizedType(tparam.typeParams, AnyClass.tpe))
} else {
- assert(fun1.symbol.info.isInstanceOf[OverloadedType] || fun1.symbol.isError)
- // @M this branch is hit for an overloaded polymorphic type.
- // Until the right alternative is known, be very liberal,
+ //@M this branch is correctly hit for an overloaded polymorphic type. It also has to handle erroneous cases.
+ // Until the right alternative for an overloaded method is known, be very liberal,
// typedTypeApply will find the right alternative and then do the same check as
// in the then-branch above. (see pos/tcpoly_overloaded.scala)
+ // this assert is too strict: be tolerant for errors like trait A { def foo[m[x], g]=error(""); def x[g] = foo[g/*ERR: missing argument type*/] }
+ //assert(fun1.symbol.info.isInstanceOf[OverloadedType] || fun1.symbol.isError) //, (fun1.symbol,fun1.symbol.info,fun1.symbol.info.getClass,args,tparams))
List.mapConserve(args)(typedHigherKindedType)
}
@@ -2691,7 +2692,7 @@ trait Typers requires Analyzer {
val result = withNoGlobalVariance{ typed(tree, TYPEmode | FUNmode, WildcardType) }
if (!phase.erasedTypes && result.tpe.isInstanceOf[TypeRef] && !result.tpe.prefix.isStable)
error(tree.pos, result.tpe.prefix+" is not a legal prefix for a constructor")
- result setType(result.tpe) // @M: no need to normalize here, see GenICode line 627: generatedType = toTypeKind(tpt.tpe.normalize)
+ result setType(result.tpe) // @M: normalization is done during erasure
}
def computeType(tree: Tree, pt: Type): Type = {
diff --git a/src/library/scala/Array.scala b/src/library/scala/Array.scala
index aed67110ea..5de6796040 100644
--- a/src/library/scala/Array.scala
+++ b/src/library/scala/Array.scala
@@ -188,7 +188,7 @@ object Array {
* @version 1.0
*/
final class Array[A](_length: Int) extends Seq[A] {
- import Predef.Error
+ import java.lang.Error
/** The length of the array */
def length: Int = throw new Error()