diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2014-02-18 13:19:22 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2014-02-18 13:19:22 +0100 |
commit | 4f4ee871c9f57d94bc954a5d372736849edb7901 (patch) | |
tree | 127e3ddbb17970f62ffa1e7f838e3287e7ba44ad /src/compiler | |
parent | 8536c3148d5a6283b580a905ca4231e852525d59 (diff) | |
download | scala-4f4ee871c9f57d94bc954a5d372736849edb7901.tar.gz scala-4f4ee871c9f57d94bc954a5d372736849edb7901.tar.bz2 scala-4f4ee871c9f57d94bc954a5d372736849edb7901.zip |
SI-7932 Exclude PolyTypes from Java generic signatures
In the enclosed test case, we were emitting just the result type of
`[a, b]Float` in the Java generic signature.
This resulted in a `GenericSignatureFormatError`.
This commit changes `argSig` to project such type functions to `*`
instead.
The test case shows that we still emit the class when we use
its type constructor directly as the type argument.
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/Erasure.scala | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/Erasure.scala b/src/compiler/scala/tools/nsc/transform/Erasure.scala index 60c1553ef3..4db74e70f2 100644 --- a/src/compiler/scala/tools/nsc/transform/Erasure.scala +++ b/src/compiler/scala/tools/nsc/transform/Erasure.scala @@ -238,8 +238,11 @@ abstract class Erasure extends AddInterfaces if (!(AnyRefTpe <:< bounds.hi)) "+" + boxedSig(bounds.hi) else if (!(bounds.lo <:< NullTpe)) "-" + boxedSig(bounds.lo) else "*" - } else { - boxedSig(tp) + } else tp match { + case PolyType(_, res) => + "*" // SI-7932 + case _ => + boxedSig(tp) } def classSig = { val preRebound = pre.baseType(sym.owner) // #2585 |