aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/neg/abstract-override.scala4
-rw-r--r--tests/neg/amp.scala8
-rw-r--r--tests/neg/autoTuplingTest.scala6
-rw-r--r--tests/neg/bounds.scala4
-rw-r--r--tests/neg/final-sealed.scala4
-rw-r--r--tests/neg/firstError.scala4
-rw-r--r--tests/neg/i1050c.scala6
-rw-r--r--tests/neg/i324.scala4
-rw-r--r--tests/neg/i50-volatile.scala4
-rw-r--r--tests/neg/i705-inner-value-class.scala16
-rw-r--r--tests/neg/i871.scala4
-rw-r--r--tests/neg/partialApplications.scala6
-rw-r--r--tests/neg/selfInheritance.scala12
-rw-r--r--tests/neg/selfreq.scala2
-rw-r--r--tests/neg/singletons.scala6
-rw-r--r--tests/neg/subtyping.scala8
-rw-r--r--tests/neg/tailcall/t1672b.scala12
-rw-r--r--tests/pos/autoTuplingTest.scala2
18 files changed, 56 insertions, 56 deletions
diff --git a/tests/neg/abstract-override.scala b/tests/neg/abstract-override.scala
index c1ce83725..4b8c3ace1 100644
--- a/tests/neg/abstract-override.scala
+++ b/tests/neg/abstract-override.scala
@@ -1,6 +1,6 @@
trait T { def foo: Int }
-trait T1 extends T { override def foo = super.foo }
-trait T2 extends T { override def foo = super.foo }
+trait T1 extends T { override def foo = super.foo } // error: method foo in trait T is accessed from super.
+trait T2 extends T { override def foo = super.foo } // error: method foo in trait T is accessed from super.
object Test extends T2 with T1 {
def main(args: Array[String]) = {
assert(foo == 3)
diff --git a/tests/neg/amp.scala b/tests/neg/amp.scala
index da35242a9..92062eb0d 100644
--- a/tests/neg/amp.scala
+++ b/tests/neg/amp.scala
@@ -2,14 +2,14 @@ object Test extends dotty.runtime.LegacyApp {
def foo() = {
def f: Int = 1
- val x = f _
+ val x = f _ // error: not a function: => Int(f)
x
}
def bar(g: => Int) = {
- g _
+ g _ // error: not a function: => Int(g)
}
- Console.println((bar{ Console.println("g called"); 42 })())
- Console.println(foo()())
+ Console.println((bar{ Console.println("g called"); 42 })()) // error: method bar in object Test$ does not take more parameters
+ Console.println(foo()()) // error: method foo in object Test$ does not take more parameters
}
diff --git a/tests/neg/autoTuplingTest.scala b/tests/neg/autoTuplingTest.scala
index f72dfb635..37136b760 100644
--- a/tests/neg/autoTuplingTest.scala
+++ b/tests/neg/autoTuplingTest.scala
@@ -1,11 +1,11 @@
import dotty.language.noAutoTupling
-object autoTuplingNeg {
+object autoTuplingNeg2 {
- val x = Some(1, 2) // error
+ val x = Some(1, 2) // error: too many arguments for method apply: (x: A)Some[A]
x match {
- case Some(a, b) => a + b // error // error // error
+ case Some(a, b) => a + b // error: wrong number of argument patterns for Some // error: not found: b
case None =>
}
}
diff --git a/tests/neg/bounds.scala b/tests/neg/bounds.scala
index cd6b8d05c..556955877 100644
--- a/tests/neg/bounds.scala
+++ b/tests/neg/bounds.scala
@@ -1,10 +1,10 @@
object Test {
def g[B >: String <: Int](x: B): Int = x
def main(args: Array[String]): Unit = {
- g("foo")
+ g("foo") // error: Type argument String' does not conform to upper bound Int
}
def baz[X >: Y, Y <: String](x: X, y: Y) = (x, y)
- baz[Int, String](1, "abc")
+ baz[Int, String](1, "abc") // error: Type argument Int does not conform to lower bound Y
}
diff --git a/tests/neg/final-sealed.scala b/tests/neg/final-sealed.scala
index 017afd63b..79692a61c 100644
--- a/tests/neg/final-sealed.scala
+++ b/tests/neg/final-sealed.scala
@@ -1,4 +1,4 @@
final class A
-class B extends A
-class C extends Option[Int]
+class B extends A // error: cannot extend final class A
+class C extends Option[Int] // error: cannot extend sealed class Option in different compilation unit
diff --git a/tests/neg/firstError.scala b/tests/neg/firstError.scala
index 317adcced..5395aa00c 100644
--- a/tests/neg/firstError.scala
+++ b/tests/neg/firstError.scala
@@ -1,4 +1,4 @@
-.
+. // error: expected class or object definition
-\u890u3084eu
+\u890u3084eu // error: error in unicode escape // error: illegal character '\uffff'
diff --git a/tests/neg/i1050c.scala b/tests/neg/i1050c.scala
index 7998d864d..19570eb83 100644
--- a/tests/neg/i1050c.scala
+++ b/tests/neg/i1050c.scala
@@ -4,10 +4,10 @@ object Import {
trait B { type L >: Any}
trait U {
lazy val p: B
- locally { val x: p.L = ??? } // error: nonfinal lazy
+ locally { val x: p.L = ??? } // old-error: nonfinal lazy
locally {
- import p._
- val x: L = ??? // error: nonfinal lazy
+ import p._ // error: Import.B(U.this.p) is not a legal path
+ val x: L = ??? // old-error: nonfinal lazy
}
}
}
diff --git a/tests/neg/i324.scala b/tests/neg/i324.scala
index 1d03a4d02..e36718a55 100644
--- a/tests/neg/i324.scala
+++ b/tests/neg/i324.scala
@@ -1,5 +1,5 @@
class O
object O {
- val x: this.type = OO.this
- val y: O = OO.this
+ val x: this.type = OO.this // error: OO is not an enclosing class
+ val y: O = OO.this // error: OO is not an enclosing class
}
diff --git a/tests/neg/i50-volatile.scala b/tests/neg/i50-volatile.scala
index 434dbf48c..f6fa3466d 100644
--- a/tests/neg/i50-volatile.scala
+++ b/tests/neg/i50-volatile.scala
@@ -10,9 +10,9 @@ class Test {
}
lazy val o: A & B = ???
- class Client extends o.Inner // error // error
+ class Client extends o.Inner // old-error // old-error
- def xToString(x: o.X): String = x // error
+ def xToString(x: o.X): String = x // old-error
def intToString(i: Int): String = xToString(i)
}
diff --git a/tests/neg/i705-inner-value-class.scala b/tests/neg/i705-inner-value-class.scala
index f638b0670..82ac962b5 100644
--- a/tests/neg/i705-inner-value-class.scala
+++ b/tests/neg/i705-inner-value-class.scala
@@ -1,22 +1,22 @@
class Foo {
- class B(val a: Int) extends AnyVal // error
+ class B(val a: Int) extends AnyVal // error: value class may not be a member of another class
}
class VCwithBadMembers(val a: Int) extends AnyVal {
- def this() = this(1) // error
- var x = 0 // error
- val y = 2 // error
- println("hi") // error
+ def this() = this(1) // error: value class may not define secondary constructor
+ var x = 0 // error: value class may not define non-parameter field
+ val y = 2 // error: value class may not define non-parameter field
+ println("hi") // error: value class may not contain initialization statements
}
object Test {
class B(val a: Int) extends AnyVal // ok
def f = {
- class C(val a: Int) extends AnyVal // error
+ class C(val a: Int) extends AnyVal // error: value class may not be a local class
new C(1)
}
- class B1(val b: Int) extends B(b)
-// class D extends B( { class E(val a: Int) extends AnyVal; new E(1) } ) // error
+ class B1(val b: Int) extends B(b) // error: cannot extend final class B
+// class D extends B( { class E(val a: Int) extends AnyVal; new E(1) } )
}
diff --git a/tests/neg/i871.scala b/tests/neg/i871.scala
index d8e1111a0..c85995582 100644
--- a/tests/neg/i871.scala
+++ b/tests/neg/i871.scala
@@ -1,5 +1,5 @@
trait Message {
- def first(x: Int)
- def second
+ def first(x: Int) // error: missing return type
+ def second // error: missing return type
1
}
diff --git a/tests/neg/partialApplications.scala b/tests/neg/partialApplications.scala
index d186273aa..10cbc556e 100644
--- a/tests/neg/partialApplications.scala
+++ b/tests/neg/partialApplications.scala
@@ -1,11 +1,11 @@
object Test2 {
type Histogram = Map[_, Int] // this is now an existential type!
- type StringlyHistogram = Histogram[_ >: String] // Error: Test2.Histogram does not take type parameters
+ type StringlyHistogram = Histogram[_ >: String] // error: Test2.Histogram does not take type parameters
- val xs: Histogram[String] = Map[String, Int]() // Error: Test2.Histogram does not take type parameters
+ val xs: Histogram[String] = Map[String, Int]() // error: Test2.Histogram does not take type parameters
- val ys: StringlyHistogram[String] = xs // Error: Test2.StringlyHistogram does not take type parameters
+ val ys: StringlyHistogram[String] = xs // error: Test2.StringlyHistogram does not take type parameters
val zs: StringlyHistogram = xs
diff --git a/tests/neg/selfInheritance.scala b/tests/neg/selfInheritance.scala
index 993765817..073316de0 100644
--- a/tests/neg/selfInheritance.scala
+++ b/tests/neg/selfInheritance.scala
@@ -11,22 +11,22 @@ class C { self: B =>
}
-class D extends A // error
+class D extends A // error: illegal inheritance: self type D of class D does not conform to self type B of parent class A
-class E extends T // error
+class E extends T // error: illegal inheritance: self type E of class E does not conform to self type B of parent trait T
object Test {
new B() {}
- new A() {} // error
+ new A() {} // error: illegal inheritance: self type A{...} of anonymous class A{...} does not conform to self type B of parent class A
- object O extends A // error
+ object O extends A // error: illegal inheritance: self type Test.O.type of object O$ does not conform to self type B of parent class A
- object M extends C // error
+ object M extends C // error: illegal inheritance: self type Test.M.type of object M$ does not conform to self type B of parent class C
}
-trait X { self: Y => }
+trait X { self: Y => } // error: missing requirement: self type Y & X of trait X does not conform to self type Z of required trait Y
trait Y { self: Z => }
trait Z
diff --git a/tests/neg/selfreq.scala b/tests/neg/selfreq.scala
index ff5725bf2..1ca373b4b 100644
--- a/tests/neg/selfreq.scala
+++ b/tests/neg/selfreq.scala
@@ -2,7 +2,7 @@ trait X { self: Y => // error: cannot resolve reference to type (Y & X)(X.this)
type T <: self.U
- def foo(x: T): T // error: cannot resolve reference to type (Y & X)(X.this).V
+ def foo(x: T): T // old-error: cannot resolve reference to type (Y & X)(X.this).V
def foo(x: String): String
}
diff --git a/tests/neg/singletons.scala b/tests/neg/singletons.scala
index 2155bfe31..502933cc4 100644
--- a/tests/neg/singletons.scala
+++ b/tests/neg/singletons.scala
@@ -3,9 +3,9 @@ object Test {
val x = 42
val z: 42 = x // error: x is not final
- val n: null = null // error: Null is not a legal singleton type
+ val n: null = null // error: Null is not a legal singleton type // error: only classes can have declared but undefined members
- val sym: 'sym = 'sym // error: Symbol is not a legal singleton type
+ val sym: 'sym = 'sym // error: Symbol is not a legal singleton type // error: only classes can have declared but undefined members
- val foo: s"abc" = "abc" // error: not a legal singleton type
+ val foo: s"abc" = "abc" // error: not a legal singleton type // error: only classes can have declared but undefined members
}
diff --git a/tests/neg/subtyping.scala b/tests/neg/subtyping.scala
index 03ff39be4..ff3c7a519 100644
--- a/tests/neg/subtyping.scala
+++ b/tests/neg/subtyping.scala
@@ -5,10 +5,10 @@ class A extends B
object Test {
def test1(): Unit = {
- implicitly[B#X <:< A#X] // error
- }
+ implicitly[B#X <:< A#X] // error: no implicit argument
+ } // error: no implicit argument
def test2(): Unit = {
- val a : { type T; type U } = ??? // error // error
- implicitly[a.T <:< a.U] // error
+ val a : { type T; type U } = ??? // error // error
+ implicitly[a.T <:< a.U] // error: no implicit argument
}
}
diff --git a/tests/neg/tailcall/t1672b.scala b/tests/neg/tailcall/t1672b.scala
index 2c2ec9b41..1ae3d8af8 100644
--- a/tests/neg/tailcall/t1672b.scala
+++ b/tests/neg/tailcall/t1672b.scala
@@ -1,6 +1,6 @@
object Test1772B {
@annotation.tailrec
- def bar : Nothing = { // error
+ def bar : Nothing = { // error: TailRec optimisation not applicable
try {
throw new RuntimeException
} catch {
@@ -11,7 +11,7 @@ object Test1772B {
}
@annotation.tailrec
- def baz : Nothing = { // error
+ def baz : Nothing = { // error: TailRec optimisation not applicable
try {
throw new RuntimeException
} catch {
@@ -22,7 +22,7 @@ object Test1772B {
}
@annotation.tailrec
- def boz : Nothing = { // error
+ def boz : Nothing = { // error: TailRec optimisation not applicable
try {
throw new RuntimeException
} catch {
@@ -31,7 +31,7 @@ object Test1772B {
}
@annotation.tailrec
- def bez : Nothing = { // error
+ def bez : Nothing = { // error: TailRec optimisation not applicable
try {
bez
} finally {
@@ -41,12 +41,12 @@ object Test1772B {
// the `liftedTree` local method will prevent a tail call here.
@annotation.tailrec
- def bar(i : Int) : Int = { // error
+ def bar(i : Int) : Int = { // error: TailRec optimisation not applicable
if (i == 0) 0
else 1 + (try {
throw new RuntimeException
} catch {
- case _: Throwable => bar(i - 1) // error
+ case _: Throwable => bar(i - 1) // old-error
})
}
}
diff --git a/tests/pos/autoTuplingTest.scala b/tests/pos/autoTuplingTest.scala
index c5bb84e95..7321a8382 100644
--- a/tests/pos/autoTuplingTest.scala
+++ b/tests/pos/autoTuplingTest.scala
@@ -3,7 +3,7 @@ object autoTupling {
val x = Some(1, 2) // error when running with -language:noAutoTupling
x match {
- case Some(a, b) => a + b // error // error // error when running with -language:noAutoTupling
+ case Some(a, b) => a + b // error // error when running with -language:noAutoTupling
case None =>
}
}