diff options
Diffstat (limited to 'test/files/neg/bug1275.scala')
-rw-r--r-- | test/files/neg/bug1275.scala | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/test/files/neg/bug1275.scala b/test/files/neg/bug1275.scala index e9be13c763..1175b30763 100644 --- a/test/files/neg/bug1275.scala +++ b/test/files/neg/bug1275.scala @@ -1,14 +1,15 @@ -// 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] + } + + // illegal abstract type member refinement: changes the arity of MyType + // the error is pretty strange, since the compiler forms the illegal type xs.MyType[a] anyway + def span[a, s <: Seq[a] { type MyType/*look ma, no type parameters!*/ <: s } ](xs: s): s + = xs f +// ^ +// found : xs.MyType[a] +// required: s +}
\ No newline at end of file |