From 20fc7a364a8f9d5de129ede531e6e1ab89f8fb1d Mon Sep 17 00:00:00 2001 From: Iulian Dragos Date: Sat, 5 Feb 2011 12:18:47 +0000 Subject: Re-enabled test spec-traits (removed the swing ... Re-enabled test spec-traits (removed the swing dependent part, since all it tested was call-by-name parameters). no review. --- test/files/pos/spec-traits.scala | 64 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 test/files/pos/spec-traits.scala (limited to 'test/files/pos') diff --git a/test/files/pos/spec-traits.scala b/test/files/pos/spec-traits.scala new file mode 100644 index 0000000000..8b1fefe80f --- /dev/null +++ b/test/files/pos/spec-traits.scala @@ -0,0 +1,64 @@ +trait A[@specialized(Int) T] { def foo: T } +class B extends A[Int] { val foo = 10 } +class C extends B + +// issue 3309 +class Lazy { + def test[U](block: => U): Unit = { block } + + test { lazy val x = 1 } +} + +// issue 3307 +class Bug3307 { + def f[Z](block: String => Z) { + block("abc") + } + + ({ () => + f { implicit x => println(x) } })() +} + +// issue 3301 + trait T[X] + +class Bug3301 { + def t[A]: T[A] = error("stub") + + () => { + type X = Int + + def foo[X] = t[X] + () + } +} +// issue 3299 +object Failure { + def thunk() { + for (i <- 1 to 2) { + val Array(a, b) = Array(1,2) + () + } + } +} + +// issue 3296 + +object AA +{ + def f(block: => Unit) {} + + object BB + { + f { + object CC + + () + } + } + + def foo[T](x: T) = { object A; false } +} + +// issue 3325 +object O { def f[@specialized T] { for(k <- Nil: List[T]) { } } } -- cgit v1.2.3