diff options
Diffstat (limited to 'test/files/pos')
-rw-r--r-- | test/files/pos/Transactions.scala | 20 | ||||
-rw-r--r-- | test/files/pos/bug245.scala | 12 |
2 files changed, 16 insertions, 16 deletions
diff --git a/test/files/pos/Transactions.scala b/test/files/pos/Transactions.scala index 8fb23268dc..ed989e178e 100644 --- a/test/files/pos/Transactions.scala +++ b/test/files/pos/Transactions.scala @@ -1,11 +1,11 @@ -package scala.concurrent; +package scala.concurrent -class AbortException extends RuntimeException; +class AbortException extends RuntimeException object Transaction { private var cnt = 0L - def nextId: long = synchronized { - cnt = cnt + 1; cnt + def nextId: Long = synchronized { + cnt += 1; cnt } // Transaction status constants @@ -20,9 +20,9 @@ object Transaction { } class Transaction { - var status: int = _ + var status: Int = _ - var id: long = _ // only for real transactions + var id: Long = _ // only for real transactions var head: Transaction = this var next: Transaction = null @@ -54,10 +54,10 @@ class Transaction { trait Transactional { /** create a new snapshot */ - def checkPoint(): unit + def checkPoint(): Unit /** copy back snapshot */ - def rollBack(): unit + def rollBack(): Unit var readers: Transaction var writer: Transaction @@ -71,7 +71,7 @@ trait Transactional { null } - def getter(thisTrans: Transaction): unit = { + def getter(thisTrans: Transaction) { if (writer == thisTrans) return var r = readers while (r != null && r.head.status != Transaction.Running) { r = r.next; readers = r } @@ -91,7 +91,7 @@ trait Transactional { } } - def setter(thisTrans: Transaction): unit = { + def setter(thisTrans: Transaction) { if (writer == thisTrans) return synchronized { val w = currentWriter() diff --git a/test/files/pos/bug245.scala b/test/files/pos/bug245.scala index b33dd9914f..570ac4178d 100644 --- a/test/files/pos/bug245.scala +++ b/test/files/pos/bug245.scala @@ -2,15 +2,15 @@ class Value {} object Test { - implicit def view(v: Value): int = 0; + implicit def view(v: Value): Int = 0 - def foo(i: Int): Int = 0; + def foo(i: Int): Int = 0 - def fun0 : Value = null; - def fun0(i: Int ): Value = null; + def fun0 : Value = null + def fun0(i: Int ): Value = null - def fun1(i: Int ): Value = null; - def fun1(l: Long): Value = null; + def fun1(i: Int ): Value = null + def fun1(l: Long): Value = null foo(fun0 ); foo(fun1(new Value)); |