diff options
Diffstat (limited to 'tests/pos/subtyping.scala')
-rw-r--r-- | tests/pos/subtyping.scala | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/tests/pos/subtyping.scala b/tests/pos/subtyping.scala index a5e156780..c8d7a82a9 100644 --- a/tests/pos/subtyping.scala +++ b/tests/pos/subtyping.scala @@ -1,6 +1,16 @@ -class A { - def test1(): Unit = { - implicitly[this.type <:< this.type] - implicitly[this.type <:< A] - } +object test { + + class B + class C + + def tag1[T](x: T): String & T = ??? + def tag2[T](x: T): T & String = ??? + + val x1: Int & String = tag1(0) + val x2: Int & String = tag2(0) + val x3: String & Int = tag1(0) + val x4: String & Int = tag2(0) + } + + |