diff options
author | Martin Odersky <odersky@gmail.com> | 2014-11-16 12:52:29 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-11-16 12:54:46 +0100 |
commit | 3c43871ed5acec9315f84e3a481adbaf5fb24897 (patch) | |
tree | 783d734b3b6f40e4aa177c47166d5c11c91c71c5 /tests | |
parent | 4cb35ef98fef6a1c2826568c95117fd7ce84bdad (diff) | |
download | dotty-3c43871ed5acec9315f84e3a481adbaf5fb24897.tar.gz dotty-3c43871ed5acec9315f84e3a481adbaf5fb24897.tar.bz2 dotty-3c43871ed5acec9315f84e3a481adbaf5fb24897.zip |
Try to avoid overconstraining when comparing and/or types
See comments in eitherIsSubType for an explanation what the
problem is. Some test cases are in subtyping.scala
Diffstat (limited to 'tests')
-rw-r--r-- | tests/pending/pos/subtyping.scala | 12 | ||||
-rw-r--r-- | tests/pos/subtyping.scala | 20 |
2 files changed, 15 insertions, 17 deletions
diff --git a/tests/pending/pos/subtyping.scala b/tests/pending/pos/subtyping.scala deleted file mode 100644 index 8a3c2eb03..000000000 --- a/tests/pending/pos/subtyping.scala +++ /dev/null @@ -1,12 +0,0 @@ -object test { - - class B - class C - - def tag[T](x: T): String & T = ??? - - val x: Int & String = tag(0) - -} - - 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) + } + + |