diff options
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/accesses.check | 16 | ||||
-rw-r--r-- | test/files/neg/accesses.scala | 32 | ||||
-rw-r--r-- | test/files/neg/bug1960.check | 2 | ||||
-rw-r--r-- | test/files/neg/bug1960.scala | 2 | ||||
-rw-r--r-- | test/files/neg/bug630.scala | 4 | ||||
-rw-r--r-- | test/files/neg/patmatexhaust.scala | 6 | ||||
-rw-r--r-- | test/files/neg/t2910.check | 2 | ||||
-rw-r--r-- | test/files/neg/t2910.scala | 4 | ||||
-rw-r--r-- | test/files/neg/tailrec.scala | 2 |
9 files changed, 35 insertions, 35 deletions
diff --git a/test/files/neg/accesses.check b/test/files/neg/accesses.check index 94fcd615bc..db58af12ce 100644 --- a/test/files/neg/accesses.check +++ b/test/files/neg/accesses.check @@ -1,17 +1,17 @@ -accesses.scala:23: error: overriding method f2 in class A of type => Unit; +accesses.scala:23: error: overriding method f2 in class A of type ()Unit; method f2 has weaker access privileges; it should not be private - private def f2: Unit = () + private def f2(): Unit = () ^ -accesses.scala:24: error: overriding method f3 in class A of type => Unit; +accesses.scala:24: error: overriding method f3 in class A of type ()Unit; method f3 has weaker access privileges; it should be at least protected - private[p2] def f3: Unit = () + private[p2] def f3(): Unit = () ^ -accesses.scala:25: error: overriding method f4 in class A of type => Unit; +accesses.scala:25: error: overriding method f4 in class A of type ()Unit; method f4 has weaker access privileges; it should be at least private[p1] - private[p2] def f4: Unit + private[p2] def f4(): Unit ^ -accesses.scala:26: error: overriding method f5 in class A of type => Unit; +accesses.scala:26: error: overriding method f5 in class A of type ()Unit; method f5 has weaker access privileges; it should be at least protected[p1] - protected[p2] def f5: Unit + protected[p2] def f5(): Unit ^ four errors found diff --git a/test/files/neg/accesses.scala b/test/files/neg/accesses.scala index 2a6b45c35b..b1df6c0e6c 100644 --- a/test/files/neg/accesses.scala +++ b/test/files/neg/accesses.scala @@ -1,27 +1,27 @@ package test.p1.p2 abstract class A { - private[p2] def f2: Unit - protected def f3: Unit - private[p1] def f4: Unit - protected[p1] def f5: Unit + private[p2] def f2(): Unit + protected def f3(): Unit + private[p1] def f4(): Unit + protected[p1] def f5(): Unit } abstract class OK1 extends A { - private[p1] def f2: Unit - protected[p2] def f3: Unit - private[test] def f4: Unit - protected[test] def f5: Unit + private[p1] def f2(): Unit + protected[p2] def f3(): Unit + private[test] def f4(): Unit + protected[test] def f5(): Unit } abstract class OK2 extends A { - protected[p1] def f2: Unit - def f3: Unit - protected[p1] def f4: Unit - def f5: Unit + protected[p1] def f2(): Unit + def f3(): Unit + protected[p1] def f4(): Unit + def f5(): Unit } abstract class Err1 extends A { - private def f2: Unit = () - private[p2] def f3: Unit = () - private[p2] def f4: Unit - protected[p2] def f5: Unit + private def f2(): Unit = () + private[p2] def f3(): Unit = () + private[p2] def f4(): Unit + protected[p2] def f5(): Unit } diff --git a/test/files/neg/bug1960.check b/test/files/neg/bug1960.check index 6615d90036..8e19f31ef5 100644 --- a/test/files/neg/bug1960.check +++ b/test/files/neg/bug1960.check @@ -1,4 +1,4 @@ bug1960.scala:5: error: parameter 'p' requires field but conflicts with p in 'TBase' -class Aclass (p: Int) extends TBase { def g{ f(p) } } +class Aclass (p: Int) extends TBase { def g() { f(p) } } ^ one error found diff --git a/test/files/neg/bug1960.scala b/test/files/neg/bug1960.scala index af7f270356..5311940b5a 100644 --- a/test/files/neg/bug1960.scala +++ b/test/files/neg/bug1960.scala @@ -2,4 +2,4 @@ object ClassFormatErrorExample extends App { new Aclass(1) } trait TBase { var p:Int = 0; def f(p1: Int) {} } -class Aclass (p: Int) extends TBase { def g{ f(p) } } +class Aclass (p: Int) extends TBase { def g() { f(p) } } diff --git a/test/files/neg/bug630.scala b/test/files/neg/bug630.scala index d236b51ffd..8a073963b0 100644 --- a/test/files/neg/bug630.scala +++ b/test/files/neg/bug630.scala @@ -1,7 +1,7 @@ trait Req1 trait Req2 { - def test = Console.println("Test") + def test() = Console.println("Test") } trait Foo { @@ -10,7 +10,7 @@ trait Foo { trait Bar { val foo : Req2 - def test = foo.test + def test() = foo.test } object Test diff --git a/test/files/neg/patmatexhaust.scala b/test/files/neg/patmatexhaust.scala index b172df8740..4a66649a18 100644 --- a/test/files/neg/patmatexhaust.scala +++ b/test/files/neg/patmatexhaust.scala @@ -56,12 +56,12 @@ class TestSealedExhaustive { // compile only case Ga => } - def ma6 = List(1,2) match { // give up + def ma6() = List(1,2) match { // give up case List(1,2) => case x :: xs => } - def ma7 = List(1,2) match { //exhaustive + def ma7() = List(1,2) match { //exhaustive case 1::2::Nil => case _ => } @@ -87,7 +87,7 @@ class TestSealedExhaustive { // compile only case C2 | C6 => true } - def redundant = 1 match { // include this otherwise script won't test this in files/neg + def redundant() = 1 match { // include this otherwise script won't test this in files/neg case 1 => case 1 => } diff --git a/test/files/neg/t2910.check b/test/files/neg/t2910.check index afff73ec08..ff190122d6 100644 --- a/test/files/neg/t2910.check +++ b/test/files/neg/t2910.check @@ -13,4 +13,4 @@ t2910.scala:30: error: forward reference extends over definition of value x t2910.scala:34: error: forward reference extends over definition of variable x lazy val f: Int = g ^ -5 errors found
\ No newline at end of file +5 errors found diff --git a/test/files/neg/t2910.scala b/test/files/neg/t2910.scala index 1c7ba54971..b772ee4d43 100644 --- a/test/files/neg/t2910.scala +++ b/test/files/neg/t2910.scala @@ -5,13 +5,13 @@ object Junk { ret } - def test2 { + def test2() { println(s.length) val z = 0 lazy val s = "abc" } - def test4 { + def test4() { lazy val x = { x val z = 0 diff --git a/test/files/neg/tailrec.scala b/test/files/neg/tailrec.scala index a77f439cfe..e0ebde9863 100644 --- a/test/files/neg/tailrec.scala +++ b/test/files/neg/tailrec.scala @@ -10,7 +10,7 @@ object Winners { @tailrec def loopsucc1(x: Int): Int = loopsucc1(x - 1) @tailrec def loopsucc2[T](x: Int): Int = loopsucc2[T](x - 1) - def ding { + def ding() { object dong { @tailrec def loopsucc3(x: Int): Int = loopsucc3(x) } |