3
class AsVariantAsIWantToBe { def contains(x: T) = () }
4
new AsVariantAsIWantToBe
7
class VarianceIsTheSpiceOfTypes { def contains(x: T) = () }
8
new VarianceIsTheSpiceOfTypes
13
def main(args: Array[String]): Unit = {
14
val xs: A[String] = new A[String]
15
println(xs.foo0 contains "abc")
16
println((xs: A[Any]).foo0 contains 5)
17
// java.lang.NoSuchMethodException: A$AsVariantAsIWantToBe$1.contains(java.lang.String)