summaryrefslogtreecommitdiff
path: root/test/files/pos
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-09-28 00:51:25 +0000
committerPaul Phillips <paulp@improving.org>2010-09-28 00:51:25 +0000
commit9c0e58c48da4cdbae7c96ef45fc15cd7aff4301f (patch)
tree857d48a844aa0479863f79c2a991984ac6a0104f /test/files/pos
parenta56c33b6a470939a1396015972f09e19dc493245 (diff)
downloadscala-9c0e58c48da4cdbae7c96ef45fc15cd7aff4301f.tar.gz
scala-9c0e58c48da4cdbae7c96ef45fc15cd7aff4301f.tar.bz2
scala-9c0e58c48da4cdbae7c96ef45fc15cd7aff4301f.zip
Cleaning up the contents of test.
including "CheckEither", written against scalacheck 1.2 in the year 471 AD. Removed all the duplicates I could find, mostly between pending and files. Renamed a bunch of tests so they wouldn't look like likely duplicates next time around. Nominated somebody else to do this once in a while. No review.
Diffstat (limited to 'test/files/pos')
-rw-r--r--test/files/pos/bug0325.scala4
-rw-r--r--test/files/pos/bug1909b-pos.scala (renamed from test/files/pos/bug1909b.scala)0
-rw-r--r--test/files/pos/bug284-pos.scala (renamed from test/files/pos/bug284.scala)0
-rw-r--r--test/files/pos/bug3175-pos.scala (renamed from test/files/pos/bug3175.scala)0
-rw-r--r--test/files/pos/bug3636.scala49
-rw-r--r--test/files/pos/cyclics-pos.scala (renamed from test/files/pos/cyclics.scala)0
-rw-r--r--test/files/pos/depmet_1_pos.flags (renamed from test/files/pos/depmet_1.flags)0
-rw-r--r--test/files/pos/depmet_1_pos.scala (renamed from test/files/pos/depmet_1.scala)0
-rw-r--r--test/files/pos/imp2-pos.scala (renamed from test/files/pos/imp2.scala)0
-rw-r--r--test/files/pos/imports-pos.scala (renamed from test/files/pos/imports.scala)0
-rw-r--r--test/files/pos/infer2-pos.scala (renamed from test/files/pos/infer2.scala)0
-rw-r--r--test/files/pos/misc-unapply_pos.scala (renamed from test/files/pos/unapply.scala)0
-rw-r--r--test/files/pos/pos-bug1210.scala (renamed from test/files/pos/bug1210.scala)0
-rw-r--r--test/files/pos/pos-bug1241.scala (renamed from test/files/pos/bug1241.scala)0
-rw-r--r--test/files/pos/simple-exceptions.scala (renamed from test/files/pos/exceptions.scala)0
-rw-r--r--test/files/pos/t1422_pos.scala (renamed from test/files/pos/t1422.scala)0
-rw-r--r--test/files/pos/t1591_pos.scala (renamed from test/files/pos/t1591.scala)0
-rw-r--r--test/files/pos/t2208_pos.scala (renamed from test/files/pos/t2208.scala)0
-rw-r--r--test/files/pos/t2421b_pos.scala (renamed from test/files/pos/t2421b.scala)0
-rw-r--r--test/files/pos/t2726/bug2726_2.scala (renamed from test/files/pos/t2726/test_2.scala)0
-rw-r--r--test/files/pos/t2868/t2868_src_2.scala (renamed from test/files/pos/t2868/test_2.scala)0
-rw-r--r--test/files/pos/tcpoly_variance_pos.scala (renamed from test/files/pos/tcpoly_variance.scala)0
-rw-r--r--test/files/pos/test2.scala5
-rw-r--r--test/files/pos/typerep_pos.scala (renamed from test/files/pos/typerep.scala)0
-rw-r--r--test/files/pos/variances_pos.scala (renamed from test/files/pos/variances.scala)0
25 files changed, 49 insertions, 9 deletions
diff --git a/test/files/pos/bug0325.scala b/test/files/pos/bug0325.scala
deleted file mode 100644
index 4b13c431b7..0000000000
--- a/test/files/pos/bug0325.scala
+++ /dev/null
@@ -1,4 +0,0 @@
-class Foobar {
- val foo = "foo";
- def foo(bar: String): String = foo + bar; // crashes the compiler
-}
diff --git a/test/files/pos/bug1909b.scala b/test/files/pos/bug1909b-pos.scala
index b914bee366..b914bee366 100644
--- a/test/files/pos/bug1909b.scala
+++ b/test/files/pos/bug1909b-pos.scala
diff --git a/test/files/pos/bug284.scala b/test/files/pos/bug284-pos.scala
index 19673b7e4c..19673b7e4c 100644
--- a/test/files/pos/bug284.scala
+++ b/test/files/pos/bug284-pos.scala
diff --git a/test/files/pos/bug3175.scala b/test/files/pos/bug3175-pos.scala
index 89bbf8b5fc..89bbf8b5fc 100644
--- a/test/files/pos/bug3175.scala
+++ b/test/files/pos/bug3175-pos.scala
diff --git a/test/files/pos/bug3636.scala b/test/files/pos/bug3636.scala
new file mode 100644
index 0000000000..24d18c653d
--- /dev/null
+++ b/test/files/pos/bug3636.scala
@@ -0,0 +1,49 @@
+class CTxnLocal[ T ] {
+ def set( x: T )( implicit t: Txn ) {}
+ def get( implicit t: Txn ) : T = null.asInstanceOf[ T ]
+ def initialValue( t: Txn ) : T = null.asInstanceOf[ T ]
+}
+
+trait Txn
+
+trait ProcTxn {
+ def ccstm: Txn
+}
+
+trait TxnLocal[ @specialized T ] {
+ def apply()( implicit tx: ProcTxn ) : T
+ def set( v: T )( implicit tx: ProcTxn ) : Unit
+ def swap( v: T )( implicit tx: ProcTxn ) : T
+ def transform( f: T => T )( implicit tx: ProcTxn ) : Unit
+}
+
+object TxnLocal {
+ def apply[ @specialized T ] : TxnLocal[ T ] = new Impl( new CTxnLocal[ T ])
+ def apply[ @specialized T ]( initValue: => T ) : TxnLocal[ T ] = new Impl( new CTxnLocal[ T ] {
+ override def initialValue( tx: Txn ): T = initValue
+ })
+
+ private class Impl[ T ]( c: CTxnLocal[ T ]) extends TxnLocal[ T ] {
+ def apply()( implicit tx: ProcTxn ) : T = c.get( tx.ccstm )
+ def set( v: T )( implicit tx: ProcTxn ) : Unit = c.set( v )( tx.ccstm )
+ def swap( v: T )( implicit tx: ProcTxn ) : T = {
+ // currently not implemented in CTxnLocal
+ val oldV = apply
+ set( v )
+ oldV
+ }
+ def transform( f: T => T )( implicit tx: ProcTxn ) {
+ set( f( apply ))
+ }
+ }
+}
+
+
+object Transition {
+ private val currentRef = TxnLocal[ Transition ]( Instant )
+ def current( implicit tx: ProcTxn ) : Transition = currentRef()
+}
+
+sealed abstract class Transition
+case object Instant extends Transition
+
diff --git a/test/files/pos/cyclics.scala b/test/files/pos/cyclics-pos.scala
index 395e88815a..395e88815a 100644
--- a/test/files/pos/cyclics.scala
+++ b/test/files/pos/cyclics-pos.scala
diff --git a/test/files/pos/depmet_1.flags b/test/files/pos/depmet_1_pos.flags
index 1c26b24745..1c26b24745 100644
--- a/test/files/pos/depmet_1.flags
+++ b/test/files/pos/depmet_1_pos.flags
diff --git a/test/files/pos/depmet_1.scala b/test/files/pos/depmet_1_pos.scala
index 166e991817..166e991817 100644
--- a/test/files/pos/depmet_1.scala
+++ b/test/files/pos/depmet_1_pos.scala
diff --git a/test/files/pos/imp2.scala b/test/files/pos/imp2-pos.scala
index 5460c60015..5460c60015 100644
--- a/test/files/pos/imp2.scala
+++ b/test/files/pos/imp2-pos.scala
diff --git a/test/files/pos/imports.scala b/test/files/pos/imports-pos.scala
index f6a55e5e07..f6a55e5e07 100644
--- a/test/files/pos/imports.scala
+++ b/test/files/pos/imports-pos.scala
diff --git a/test/files/pos/infer2.scala b/test/files/pos/infer2-pos.scala
index e065219a80..e065219a80 100644
--- a/test/files/pos/infer2.scala
+++ b/test/files/pos/infer2-pos.scala
diff --git a/test/files/pos/unapply.scala b/test/files/pos/misc-unapply_pos.scala
index 6651e64362..6651e64362 100644
--- a/test/files/pos/unapply.scala
+++ b/test/files/pos/misc-unapply_pos.scala
diff --git a/test/files/pos/bug1210.scala b/test/files/pos/pos-bug1210.scala
index eb163a956e..eb163a956e 100644
--- a/test/files/pos/bug1210.scala
+++ b/test/files/pos/pos-bug1210.scala
diff --git a/test/files/pos/bug1241.scala b/test/files/pos/pos-bug1241.scala
index 333e6c5490..333e6c5490 100644
--- a/test/files/pos/bug1241.scala
+++ b/test/files/pos/pos-bug1241.scala
diff --git a/test/files/pos/exceptions.scala b/test/files/pos/simple-exceptions.scala
index 52c33fb43a..52c33fb43a 100644
--- a/test/files/pos/exceptions.scala
+++ b/test/files/pos/simple-exceptions.scala
diff --git a/test/files/pos/t1422.scala b/test/files/pos/t1422_pos.scala
index 658f5c730d..658f5c730d 100644
--- a/test/files/pos/t1422.scala
+++ b/test/files/pos/t1422_pos.scala
diff --git a/test/files/pos/t1591.scala b/test/files/pos/t1591_pos.scala
index 4f55d7ce19..4f55d7ce19 100644
--- a/test/files/pos/t1591.scala
+++ b/test/files/pos/t1591_pos.scala
diff --git a/test/files/pos/t2208.scala b/test/files/pos/t2208_pos.scala
index f1a521b14c..f1a521b14c 100644
--- a/test/files/pos/t2208.scala
+++ b/test/files/pos/t2208_pos.scala
diff --git a/test/files/pos/t2421b.scala b/test/files/pos/t2421b_pos.scala
index 0df3461662..0df3461662 100644
--- a/test/files/pos/t2421b.scala
+++ b/test/files/pos/t2421b_pos.scala
diff --git a/test/files/pos/t2726/test_2.scala b/test/files/pos/t2726/bug2726_2.scala
index e738143aeb..e738143aeb 100644
--- a/test/files/pos/t2726/test_2.scala
+++ b/test/files/pos/t2726/bug2726_2.scala
diff --git a/test/files/pos/t2868/test_2.scala b/test/files/pos/t2868/t2868_src_2.scala
index f11ef0fae2..f11ef0fae2 100644
--- a/test/files/pos/t2868/test_2.scala
+++ b/test/files/pos/t2868/t2868_src_2.scala
diff --git a/test/files/pos/tcpoly_variance.scala b/test/files/pos/tcpoly_variance_pos.scala
index b641716d50..b641716d50 100644
--- a/test/files/pos/tcpoly_variance.scala
+++ b/test/files/pos/tcpoly_variance_pos.scala
diff --git a/test/files/pos/test2.scala b/test/files/pos/test2.scala
deleted file mode 100644
index 0dcc16ffab..0000000000
--- a/test/files/pos/test2.scala
+++ /dev/null
@@ -1,5 +0,0 @@
-import scala._;
-object test2 {
- def f(x: Int): Int = 'a';
- def g(x: Int) = f(f(x));
-}
diff --git a/test/files/pos/typerep.scala b/test/files/pos/typerep_pos.scala
index 7faa8a1928..7faa8a1928 100644
--- a/test/files/pos/typerep.scala
+++ b/test/files/pos/typerep_pos.scala
diff --git a/test/files/pos/variances.scala b/test/files/pos/variances_pos.scala
index 7dc56b0225..7dc56b0225 100644
--- a/test/files/pos/variances.scala
+++ b/test/files/pos/variances_pos.scala