summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2012-12-12 16:02:21 -0800
committerAdriaan Moors <adriaan.moors@typesafe.com>2012-12-12 16:02:21 -0800
commitdf78f76682145c805a487e2b939e0844a6623ece (patch)
treee8f78e1fb1509a1c4fd704f8b3a0ea64f8d00053 /test
parent7968f935d7af448e3dec23860b47394e7fd057bb (diff)
parent24455e22d56c8447fdf6089ad612f6ce75020f0b (diff)
downloadscala-df78f76682145c805a487e2b939e0844a6623ece.tar.gz
scala-df78f76682145c805a487e2b939e0844a6623ece.tar.bz2
scala-df78f76682145c805a487e2b939e0844a6623ece.zip
Merge pull request #1758 from hubertp/2.10.x-issue/strip-tvars
When we strip tvars we should also recursively strip their instantiation...
Diffstat (limited to 'test')
-rw-r--r--test/files/pos/strip-tvars-for-lubbasetypes.scala25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/files/pos/strip-tvars-for-lubbasetypes.scala b/test/files/pos/strip-tvars-for-lubbasetypes.scala
new file mode 100644
index 0000000000..2be8625bae
--- /dev/null
+++ b/test/files/pos/strip-tvars-for-lubbasetypes.scala
@@ -0,0 +1,25 @@
+object Test {
+
+ implicit final class EqualOps[T](val x: T) extends AnyVal {
+ def ===[T1, Ph >: T <: T1, Ph2 >: Ph <: T1](other: T1): Boolean = x == other
+ def !!![T1, 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
+
+
+
+}