aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/subtyping.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pos/subtyping.scala')
-rw-r--r--tests/pos/subtyping.scala13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/pos/subtyping.scala b/tests/pos/subtyping.scala
index a5e156780..95e813bdd 100644
--- a/tests/pos/subtyping.scala
+++ b/tests/pos/subtyping.scala
@@ -4,3 +4,16 @@ class A {
implicitly[this.type <:< A]
}
}
+object test {
+
+ 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)
+
+}
+
+