summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala4
-rw-r--r--test/files/pos/tcpoly_typeapp.scala4
2 files changed, 6 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index ae53628530..4fbaac7e22 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -1902,7 +1902,7 @@ trait Typers requires Analyzer {
def typedTypeApply(fun: Tree, args: List[Tree]): Tree = fun.tpe match {
case OverloadedType(pre, alts) =>
inferPolyAlternatives(fun, args map (.tpe))
- val tparams = fun.symbol.typeParams
+ val tparams = fun.symbol.typeParams //@M TODO: fun.symbol.info.typeParams ? (as in typedAppliedTypeTree)
assert(args.length == tparams.length) //@M: in case TypeApply we can't check the kind-arities
// of the type arguments as we don't know which alternative to choose... here we do
val args1 = map2Conserve(args, tparams) {
@@ -2344,7 +2344,7 @@ trait Typers requires Analyzer {
def typedAppliedTypeTree(tpt: Tree, args: List[Tree]) = {
val tpt1 = typed1(tpt, mode | FUNmode | TAPPmode, WildcardType)
- val tparams = tpt1.symbol.typeParams
+ val tparams = tpt1.symbol.info.typeParams // must be .info.typeParams (see pos/tcpoly_typeapp.scala)
if (tpt1.tpe.isError) {
setError(tree)
diff --git a/test/files/pos/tcpoly_typeapp.scala b/test/files/pos/tcpoly_typeapp.scala
new file mode 100644
index 0000000000..7fb4dca72e
--- /dev/null
+++ b/test/files/pos/tcpoly_typeapp.scala
@@ -0,0 +1,4 @@
+abstract class x {
+ type t[m[x] <: Bound[x], Bound[x]]
+ val x: t[scala.collection.mutable.MutableList, Iterable]
+} \ No newline at end of file