diff options
author | odersky <odersky@gmail.com> | 2014-11-18 15:46:57 +0100 |
---|---|---|
committer | odersky <odersky@gmail.com> | 2014-11-18 15:46:57 +0100 |
commit | 7a1f63013197212c91ce4d5830c1f4ce751d712c (patch) | |
tree | 68bbb3b1cab0bfe92d49dafe585bc3914bdd476e /tests | |
parent | 0635caeb9bcb17d41dcfe0fbcf2f61c296f49b7b (diff) | |
parent | f2743f7e62b1322dc6cbbc0b4602e92fee14162b (diff) | |
download | dotty-7a1f63013197212c91ce4d5830c1f4ce751d712c.tar.gz dotty-7a1f63013197212c91ce4d5830c1f4ce751d712c.tar.bz2 dotty-7a1f63013197212c91ce4d5830c1f4ce751d712c.zip |
Merge pull request #230 from dotty-staging/fix/and-or-subtyping
Try to avoid overconstraining when comparing and/or types
Diffstat (limited to 'tests')
-rw-r--r-- | tests/pos/subtyping.scala | 13 |
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) + +} + + |