From 9550c2077cc69434a460171ddd021a1de7ca1da4 Mon Sep 17 00:00:00 2001 From: Adriaan Moors Date: Fri, 13 Aug 2010 16:21:40 +0000 Subject: closes #3419: test files omit check that wouldn't work with separate compilation, not needed anymore because compiler has become more robust the actual fix was committed as part of r22512, see #3374 also see #3512 no review --- test/files/neg/bug1275.check | 6 +++--- test/files/neg/bug1275.scala | 13 ++++++++----- test/files/pos/t3419/B_1.scala | 3 +++ test/files/pos/t3419/C_2.scala | 3 +++ 4 files changed, 17 insertions(+), 8 deletions(-) create mode 100644 test/files/pos/t3419/B_1.scala create mode 100644 test/files/pos/t3419/C_2.scala (limited to 'test') diff --git a/test/files/neg/bug1275.check b/test/files/neg/bug1275.check index 40c5d79d27..6ee8365796 100644 --- a/test/files/neg/bug1275.check +++ b/test/files/neg/bug1275.check @@ -1,6 +1,6 @@ -bug1275.scala:8: error: type mismatch; +bug1275.scala:11: error: type mismatch; found : xs.MyType[a] required: s - = xs f // xs: s <: Seq[a]{type MyType <: s } - ^ + = xs f + ^ one error found diff --git a/test/files/neg/bug1275.scala b/test/files/neg/bug1275.scala index 769156fff2..1175b30763 100644 --- a/test/files/neg/bug1275.scala +++ b/test/files/neg/bug1275.scala @@ -1,12 +1,15 @@ 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? + // 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 diff --git a/test/files/pos/t3419/B_1.scala b/test/files/pos/t3419/B_1.scala new file mode 100644 index 0000000000..a8ec7edba4 --- /dev/null +++ b/test/files/pos/t3419/B_1.scala @@ -0,0 +1,3 @@ +trait T[A,B] { + type X[a <: A, b <: B] <: B +} \ No newline at end of file diff --git a/test/files/pos/t3419/C_2.scala b/test/files/pos/t3419/C_2.scala new file mode 100644 index 0000000000..da721d2c31 --- /dev/null +++ b/test/files/pos/t3419/C_2.scala @@ -0,0 +1,3 @@ +object F { + type S = T[Any,Int] {type X[N <: Int, Acc <: Int] = Acc} +} \ No newline at end of file -- cgit v1.2.3