diff options
author | Paul Phillips <paulp@improving.org> | 2011-03-24 01:10:26 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-03-24 01:10:26 +0000 |
commit | a5a18e80ec60d9bd7388d96e41be9c8b52d5bc0a (patch) | |
tree | 95b890a4f065c4d76a27bea39af37e2a921a216b | |
parent | a45be8b2851b8bc76ffa40deb9810568ed5b69f1 (diff) | |
download | scala-a5a18e80ec60d9bd7388d96e41be9c8b52d5bc0a.tar.gz scala-a5a18e80ec60d9bd7388d96e41be9c8b52d5bc0a.tar.bz2 scala-a5a18e80ec60d9bd7388d96e41be9c8b52d5bc0a.zip |
Restoring my higher-kinded-Array signature chec...
Restoring my higher-kinded-Array signature check which martin callously
blew away while fixing all our other problems. Review by odersky.
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/Erasure.scala | 4 | ||||
-rw-r--r-- | test/files/pos/hkarray.flags | 1 | ||||
-rw-r--r-- | test/files/pos/hkarray.scala | 5 |
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 |