diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-02-04 22:29:52 -0800 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-02-05 12:47:30 -0800 |
commit | 4525e3392b42b47147479087d961d328c3b717bb (patch) | |
tree | 9c9f01862b43567936c0bd6a971aeecfb92a8cb2 /test/files/pos/t6169/Skin.java | |
parent | eba3cc6a9e4bb091db3cc7d68dc64abb803f52c7 (diff) | |
download | scala-4525e3392b42b47147479087d961d328c3b717bb.tar.gz scala-4525e3392b42b47147479087d961d328c3b717bb.tar.bz2 scala-4525e3392b42b47147479087d961d328c3b717bb.zip |
SI-6169 Refine java wildcard bounds using corresponding tparam
Also fixes part of SI-8197. Necessary complement to SI-1786 (#2518),
because we now infer tighter bounds for RHSs to conform to.
When opening an existential, Java puts constraints in the typing environment
that are derived from the bounds on the type parameters of the existentially
quantified type, so let's do the same for existentials over java-defined
classes in skolemizeExistential...
Example from test case:
```
public class Exist<T extends String> {
// java helpfully re-interprets Exist<?> as Exist<? extends String>
public Exist<?> foo() { throw new RuntimeException(); }
}
```
In Scala syntax, given a java-defined `class C[T <: String]`, the
existential type `C[_]` is improved to `C[_ <: String]` before skolemization,
which models what Java does (track the bounds as type constraints in the typing environment)
(Also tried doing this once during class file parsing or
when creating the existential type, but that causes cyclic errors
because it happens too early.)
Diffstat (limited to 'test/files/pos/t6169/Skin.java')
-rw-r--r-- | test/files/pos/t6169/Skin.java | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/test/files/pos/t6169/Skin.java b/test/files/pos/t6169/Skin.java new file mode 100644 index 0000000000..780de1ee09 --- /dev/null +++ b/test/files/pos/t6169/Skin.java @@ -0,0 +1 @@ +public interface Skin<C extends Skinnable> { } |