summaryrefslogtreecommitdiff
path: root/test/files/pos/spec-traits.scala
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2010-04-27 15:09:04 +0000
committerIulian Dragos <jaguarul@gmail.com>2010-04-27 15:09:04 +0000
commit0675d244e45ea0f71a64568c832c846b19beea56 (patch)
treeecda0b372fdaac123c4e04080155ef326349438d /test/files/pos/spec-traits.scala
parent622c15815f8cfa93ab6c3b0e3ab49095988dd51f (diff)
downloadscala-0675d244e45ea0f71a64568c832c846b19beea56.tar.gz
scala-0675d244e45ea0f71a64568c832c846b19beea56.tar.bz2
scala-0675d244e45ea0f71a64568c832c846b19beea56.zip
Added test for several tickets that were fixed ...
Added test for several tickets that were fixed earlier this week. no review.
Diffstat (limited to 'test/files/pos/spec-traits.scala')
-rw-r--r--test/files/pos/spec-traits.scala83
1 files changed, 83 insertions, 0 deletions
diff --git a/test/files/pos/spec-traits.scala b/test/files/pos/spec-traits.scala
new file mode 100644
index 0000000000..9e339a14ad
--- /dev/null
+++ b/test/files/pos/spec-traits.scala
@@ -0,0 +1,83 @@
+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 3292
+import scala.swing._
+import scala.swing.GridBagPanel._
+
+object Grid {
+
+ def later(code : => Unit) =
+ javax.swing.SwingUtilities.invokeLater(new Runnable { def run { code }})
+
+ def test = later {
+ val frame = new Dialog {
+ contents = new GridBagPanel {
+ val c = new Constraints
+ }
+ }
+ }
+
+}
+
+// issue 3325
+object O { def f[@specialized T] { for(k <- Nil: List[T]) { } } }