summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/transform/Erasure.scala4
-rw-r--r--test/files/pos/hkarray.flags1
-rw-r--r--test/files/pos/hkarray.scala5
3 files changed, 9 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/Erasure.scala b/src/compiler/scala/tools/nsc/transform/Erasure.scala
index cef22dbbfd..ca39ec4a4d 100644
--- a/src/compiler/scala/tools/nsc/transform/Erasure.scala
+++ b/src/compiler/scala/tools/nsc/transform/Erasure.scala
@@ -331,7 +331,9 @@ abstract class Erasure extends AddInterfaces
"L"+atPhase(currentRun.icodePhase)(sym.fullName + global.genJVM.moduleSuffix(sym)).replace('.', '/')
def classSigSuffix: String =
"."+sym.name
- if (sym == ArrayClass) {
+
+ // If args isEmpty, Array is being used as a higher-kinded type
+ if (sym == ArrayClass && args.nonEmpty) {
if (unboundedGenericArrayLevel(tp) == 1) jsig(ObjectClass.tpe)
else ARRAY_TAG.toString+(args map (jsig(_))).mkString
}
diff --git a/test/files/pos/hkarray.flags b/test/files/pos/hkarray.flags
new file mode 100644
index 0000000000..e8fb65d50c
--- /dev/null
+++ b/test/files/pos/hkarray.flags
@@ -0,0 +1 @@
+-Xfatal-warnings \ No newline at end of file
diff --git a/test/files/pos/hkarray.scala b/test/files/pos/hkarray.scala
new file mode 100644
index 0000000000..af1160300a
--- /dev/null
+++ b/test/files/pos/hkarray.scala
@@ -0,0 +1,5 @@
+trait Foo[CC[_]] { }
+
+class Bip {
+ val x = new Foo[Array] { }
+} \ No newline at end of file