diff options
author | Martin Odersky <odersky@gmail.com> | 2007-04-13 12:48:00 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2007-04-13 12:48:00 +0000 |
commit | d08a0445c11684b4d401c21355d5dad9e1b0768d (patch) | |
tree | d7adee6c5cac413141ee9435280fd6b22e64f483 /src/compiler/scala/tools/nsc/typechecker/Typers.scala | |
parent | 62cb8572fa5775def3cafee568cfe39b16fc4f94 (diff) | |
download | scala-d08a0445c11684b4d401c21355d5dad9e1b0768d.tar.gz scala-d08a0445c11684b4d401c21355d5dad9e1b0768d.tar.bz2 scala-d08a0445c11684b4d401c21355d5dad9e1b0768d.zip |
changes to parser for 409/877.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index cde3d11de2..c000f97967 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -1693,7 +1693,7 @@ trait Typers requires Analyzer { // of the type arguments as we don't know which alternative to choose... here we do val args1 = map2Conserve(args, tparams) { //@M! the polytype denotes the expected kind - (arg, tparam) => typedHigherKindedType(arg, makePolyType(tparam.typeParams, AnyClass.tpe)) + (arg, tparam) => typedHigherKindedType(arg, parameterizedType(tparam.typeParams, AnyClass.tpe)) } typedTypeApply(fun, args1) case PolyType(tparams, restpe) if (tparams.length != 0) => @@ -2029,9 +2029,6 @@ trait Typers requires Analyzer { } } - // @M: copied from Namers - def makePolyType(tparams: List[Symbol], tpe: Type) = if (tparams.isEmpty) tpe else PolyType(tparams, tpe) - // begin typed1 val sym: Symbol = tree.symbol if (sym ne null) sym.initialize @@ -2336,7 +2333,7 @@ trait Typers requires Analyzer { // @M maybe the well-kindedness check should be done when checking the type arguments conform to the type parameters' bounds? val args1 = if(args.length == tparams.length) map2Conserve(args, tparams) { //@M! the polytype denotes the expected kind - (arg, tparam) => typedHigherKindedType(arg, makePolyType(tparam.typeParams, AnyClass.tpe)) + (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. @@ -2496,7 +2493,7 @@ trait Typers requires Analyzer { } else if (tparams.length == args.length) { // @M: kind-arity checking is done here and in adapt, full kind-checking is in checkKindBounds (in Infer) val args1 = map2Conserve(args, tparams) { - (arg, tparam) => typedHigherKindedType(arg, makePolyType(tparam.typeParams, AnyClass.tpe)) //@M! the polytype denotes the expected kind + (arg, tparam) => typedHigherKindedType(arg, parameterizedType(tparam.typeParams, AnyClass.tpe)) //@M! the polytype denotes the expected kind } val argtypes = args1 map (.tpe) val owntype = if (tpt1.symbol.isClass || tpt1.symbol.isTypeMember) // @M! added the latter condition |