diff options
author | Paul Phillips <paulp@improving.org> | 2012-09-29 13:34:25 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-09-29 13:37:24 -0700 |
commit | 18fd93b5ec7e439b59b75f96e976aad6025a76f4 (patch) | |
tree | 504d50f1c157923fb529e6fb4d792a9381b8b8f0 /test/files | |
parent | be49f36154efa78c3dcbeba394aa6ec2b5e764ec (diff) | |
download | scala-18fd93b5ec7e439b59b75f96e976aad6025a76f4.tar.gz scala-18fd93b5ec7e439b59b75f96e976aad6025a76f4.tar.bz2 scala-18fd93b5ec7e439b59b75f96e976aad6025a76f4.zip |
Revert "SI-4881 infer variance from formals, then result"
This reverts commit 5c5e8d4dcd151a6e2bf9e7c259c618b9b4eff00f.
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/neg/t5845.check | 5 | ||||
-rw-r--r-- | test/files/pos/t4881.scala | 31 |
2 files changed, 4 insertions, 32 deletions
diff --git a/test/files/neg/t5845.check b/test/files/neg/t5845.check index c0b402fccb..8c6100d6de 100644 --- a/test/files/neg/t5845.check +++ b/test/files/neg/t5845.check @@ -1,4 +1,7 @@ +t5845.scala:9: error: value +++ is not a member of Int + println(5 +++ 5) + ^ t5845.scala:15: error: value +++ is not a member of Int println(5 +++ 5) ^ -one error found +two errors found diff --git a/test/files/pos/t4881.scala b/test/files/pos/t4881.scala deleted file mode 100644 index 46cfad9793..0000000000 --- a/test/files/pos/t4881.scala +++ /dev/null @@ -1,31 +0,0 @@ -class Contra[-T] -trait A -trait B extends A -trait C extends B - -// test improved variance inference: first try formals to see in which variance positions the type param appears; -// only when that fails to determine variance, look at result type -object Test { - def contraLBUB[a >: C <: A](): Contra[a] = null - def contraLB[a >: C](): Contra[a] = null - -{ - val x = contraLBUB() //inferred Contra[C] instead of Contra[A] - val x1: Contra[A] = x -} - -{ - val x = contraLB() //inferred Contra[C] instead of Contra[Any] - val x1: Contra[Any] = x -} - -{ - val x = contraLBUB // make sure it does the same thing as its ()-less counterpart - val x1: Contra[A] = x -} - -{ - val x = contraLB - val x1: Contra[Any] = x -} -} |