summaryrefslogtreecommitdiff
path: root/test/files/neg/bug1275.scala
diff options
context:
space:
mode:
authorAntonio Cunei <antonio.cunei@epfl.ch>2010-09-01 09:43:36 +0000
committerAntonio Cunei <antonio.cunei@epfl.ch>2010-09-01 09:43:36 +0000
commit58882f89e76fd1cf824dfd9c537cadf153064860 (patch)
treef61511b071df41d79413a7d2d468ccf945a35524 /test/files/neg/bug1275.scala
parentcc57d03af8a97c4b9a6162acbc3a727384bb8a86 (diff)
downloadscala-58882f89e76fd1cf824dfd9c537cadf153064860.tar.gz
scala-58882f89e76fd1cf824dfd9c537cadf153064860.tar.bz2
scala-58882f89e76fd1cf824dfd9c537cadf153064860.zip
Undid all commits between 22566 and 22597 included
in the 2.8.x branch, restoring the status to 2.8.0 final release, in preparation for 2.8.1.
Diffstat (limited to 'test/files/neg/bug1275.scala')
-rw-r--r--test/files/neg/bug1275.scala26
1 files changed, 14 insertions, 12 deletions
diff --git a/test/files/neg/bug1275.scala b/test/files/neg/bug1275.scala
index 769156fff2..e9be13c763 100644
--- a/test/files/neg/bug1275.scala
+++ b/test/files/neg/bug1275.scala
@@ -1,12 +1,14 @@
-object Test {
- trait Seq[+t] {
- type MyType[+t] <: Seq[t]
- def f: MyType[t]
- }
-
- def span[a, s <: Seq[a] { type MyType <: s } ](xs: s): s
- = xs f // xs: s <: Seq[a]{type MyType <: s }
- // xs.f : xs.MyType[a] <: Seq[a]
- // ill-formed type in bound for s: Seq[a] { type MyType <: s }
- // refinements aren't checked -- should they?
-} \ No newline at end of file
+// tested using Scala compiler version 2.6.0-RC1 -- (c) 2002-2010 LAMP/EPFL
+
+// prompted by "Covariant return types" mailing list question
+object TestCovariance {
+
+ // see Type constructor polymorphism in http://www.scala-lang.org/docu/changelog.html
+ trait Seq[+t] {
+ type MyType[+t] <: Seq[t]
+
+ def f: MyType[t]
+ }
+
+ def span[a, s <: Seq[a] { type MyType <: s } ](xs: s): s = xs f
+}