summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Infer.scala2
-rw-r--r--test/files/pos/hk-match/a.scala5
-rw-r--r--test/files/pos/hk-match/b.scala1
3 files changed, 7 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Infer.scala b/src/compiler/scala/tools/nsc/typechecker/Infer.scala
index 7016474a90..b502af4a7f 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Infer.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Infer.scala
@@ -1372,7 +1372,7 @@ trait Infer {
( isLocalBinding(sym)
|| arg.typeSymbol.isTypeParameterOrSkolem
|| (sym.name == tpnme.WILDCARD) // avoid spurious warnings on HK types
- || check(arg, param.tpe, conforms)
+ || check(arg, param.tpeHK, conforms)
|| warn("non-variable type argument " + arg)
)
}
diff --git a/test/files/pos/hk-match/a.scala b/test/files/pos/hk-match/a.scala
new file mode 100644
index 0000000000..7144068f3c
--- /dev/null
+++ b/test/files/pos/hk-match/a.scala
@@ -0,0 +1,5 @@
+trait A {
+ type HKAlias[X] = List[X]
+
+ (null: Any) match { case f: Bippy[HKAlias] => f }
+}
diff --git a/test/files/pos/hk-match/b.scala b/test/files/pos/hk-match/b.scala
new file mode 100644
index 0000000000..f7d21f6383
--- /dev/null
+++ b/test/files/pos/hk-match/b.scala
@@ -0,0 +1 @@
+trait Bippy[E[X]]