diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2015-03-05 13:59:07 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2015-03-05 17:11:37 +1000 |
commit | 5471f011f85fef82cbe8bebb0c5f91b980031c5f (patch) | |
tree | a7b0cc30870eeb3ef2ecf8086f87a4a63fd8f39a /test/files/run/t9200/test.scala | |
parent | d30098c30de94e6ec07b5c8b6782357183e24179 (diff) | |
download | scala-5471f011f85fef82cbe8bebb0c5f91b980031c5f.tar.gz scala-5471f011f85fef82cbe8bebb0c5f91b980031c5f.tar.bz2 scala-5471f011f85fef82cbe8bebb0c5f91b980031c5f.zip |
SI-9200 Fix Java generic signatures for refined types
The erasure of a refined type `T1 with T2 ... Tn` is the
erasure of the intersection dominator of the elements.
In addition to erased method signatures, the compiler also emits
Java generic signatures, included information about generic types,
up to the point that it is possible to express in the language of
Java 5 generics.
Java generic signatures must be consistent with erasued signatures,
that is, the Java compiler must erase that generic signature to the
same erased signature. If this does not hold, linkage errors will
occur.
The compiler implements erasure in `ErasureMap` and java generic
signatures in `Erasure#javaSig`. Regrettably, these don't share
any implementation; e.g `javaSig` only takes the first parent of
a refinement type, rather than using `intersectionDominator`.
This commit fixes that discrepency.
Diffstat (limited to 'test/files/run/t9200/test.scala')
-rw-r--r-- | test/files/run/t9200/test.scala | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/files/run/t9200/test.scala b/test/files/run/t9200/test.scala new file mode 100644 index 0000000000..6fa7e91571 --- /dev/null +++ b/test/files/run/t9200/test.scala @@ -0,0 +1,12 @@ +trait W + +trait T1 +trait T2 extends T1 + +object O1 { + type t = T1 with T2 +} + +class C1[w<:W](o: O1.t) + +class C2 extends T1 with T2 |