aboutsummaryrefslogtreecommitdiff
path: root/tests/pos
diff options
context:
space:
mode:
authorGuillaume Martres <smarter@ubuntu.com>2015-05-03 18:19:46 +0200
committerGuillaume Martres <smarter@ubuntu.com>2015-05-03 18:19:51 +0200
commitf162eb2d9e7effbad2676e92139fe5676a92d6ad (patch)
tree78644f03252f7a3c873b2b9076aa30bad228138f /tests/pos
parentbb6582bd265d22186570bef81d2a2f9ab3e23f9d (diff)
downloaddotty-f162eb2d9e7effbad2676e92139fe5676a92d6ad.tar.gz
dotty-f162eb2d9e7effbad2676e92139fe5676a92d6ad.tar.bz2
dotty-f162eb2d9e7effbad2676e92139fe5676a92d6ad.zip
Enable test strip-tvars-for-lubbasetypes.scala
The test had to be slightly modified because of dotty's stricter checking of type bounds validity, see #525 where this was discussed.
Diffstat (limited to 'tests/pos')
-rw-r--r--tests/pos/strip-tvars-for-lubbasetypes.scala25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/pos/strip-tvars-for-lubbasetypes.scala b/tests/pos/strip-tvars-for-lubbasetypes.scala
new file mode 100644
index 000000000..128ca767c
--- /dev/null
+++ b/tests/pos/strip-tvars-for-lubbasetypes.scala
@@ -0,0 +1,25 @@
+object Test {
+
+ implicit final class EqualOps[T](val x: T) extends AnyVal {
+ def ===[T1 >: T, Ph >: T <: T1, Ph2 >: Ph <: T1](other: T1): Boolean = x == other
+ def !!![T1 >: T, Ph2 >: Ph <: T1, Ph >: T <: T1](other: T1): Boolean = x == other
+ }
+
+ class A
+ class B extends A
+ class C extends A
+
+ val a = new A
+ val b = new B
+ val c = new C
+
+ val x1 = a === b
+ val x2 = b === a
+ val x3 = b === c // error, infers Object{} for T1
+ val x4 = b.===[A, B, B](c)
+
+ val x5 = b !!! c // always compiled due to the order of Ph2 and Ph
+
+
+
+}