// Tests translated from scalac SI-6189 by @retronym /* public class Exist { // java helpfully re-interprets Exist as Exist public Exist foo() { throw new RuntimeException(); } } */ class Exist[T <: String] { def foo: Exist[_] = null } /* public class ExistF> { // java helpfully re-interprets ExistF as ExistF> public ExistF foo() { throw new RuntimeException(); } } */ class ExistF[T <: ExistF[T]] { def foo: ExistF[_] = null } /* public class ExistIndir { // java helpfully re-interprets ExistIndir as ExistIndir public ExistIndir foo() { throw new RuntimeException(); } } */ class ExistIndir[T <: String, U <: T] { def foo: ExistIndir[_, _] = null } class Test { class MyExist extends ExistF[MyExist] // SI-8197, SI-6169: java infers the bounds of existentials, so we have to as well now that SI-1786 is fixed... def stringy: Exist[_ <: String] = (new Exist[String]).foo // def fbounded: (ExistF[t] forSome {type t <: ExistF[t] }) = (new MyExist).foo def indir: ExistIndir[_ <: String, _ <: String] = (new ExistIndir[String, String]).foo } /* public abstract class OP { } public interface Skin { } public interface Skinnable { OP> skinProperty(); } */ class OP[T] trait Skin[C <: Skinnable] trait Skinnable { def skinProperty: OP[Skin[_]] } object ObjectProperty { implicit def jfxObjectProperty2sfx[T](p: OP[T]): ObjectProperty[T] = new ObjectProperty[T](p) } class ObjectProperty[T](val delegate: OP[T]) trait TestWildcardBoundInference { def delegate: Skinnable def skin: ObjectProperty[Skin[_ /* inferred: <: Skinnable */]] = ObjectProperty.jfxObjectProperty2sfx(delegate.skinProperty) skin: ObjectProperty[Skin[_ <: Skinnable]] def skinCheckInference = delegate.skinProperty skinCheckInference: ObjectProperty[Skin[_ <: Skinnable]] }