summaryrefslogtreecommitdiff
path: root/test/files/neg/bug1275.scala
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2010-07-08 15:59:00 +0000
committerAdriaan Moors <adriaan.moors@epfl.ch>2010-07-08 15:59:00 +0000
commitbc5ac3dc9a03553072f69d1117ea2389473acd4a (patch)
tree8861152bae068e9630c176c331763fbbd76cbe0e /test/files/neg/bug1275.scala
parent0cbeaf17d85d4925939d51938826c318db667c50 (diff)
downloadscala-bc5ac3dc9a03553072f69d1117ea2389473acd4a.tar.gz
scala-bc5ac3dc9a03553072f69d1117ea2389473acd4a.tar.bz2
scala-bc5ac3dc9a03553072f69d1117ea2389473acd4a.zip
closes #3374.
review by odersky
Diffstat (limited to 'test/files/neg/bug1275.scala')
-rw-r--r--test/files/neg/bug1275.scala26
1 files changed, 12 insertions, 14 deletions
diff --git a/test/files/neg/bug1275.scala b/test/files/neg/bug1275.scala
index e9be13c763..769156fff2 100644
--- a/test/files/neg/bug1275.scala
+++ b/test/files/neg/bug1275.scala
@@ -1,14 +1,12 @@
-// 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
-}
+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