summaryrefslogtreecommitdiff
path: root/test/files/neg
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-10-12 10:51:06 -0700
committerPaul Phillips <paulp@improving.org>2013-10-12 10:51:06 -0700
commit72736f7238616f4e56a0ee28e9d204d95e81107f (patch)
tree43e1bb16ed50dd42df67ee1300883a3f65959e5d /test/files/neg
parentede4a958aa79aa07ed62283fc74314f2611d3dc4 (diff)
parent83feb8609161bf19247a8a310f8c5a9e3d8469f5 (diff)
downloadscala-72736f7238616f4e56a0ee28e9d204d95e81107f.tar.gz
scala-72736f7238616f4e56a0ee28e9d204d95e81107f.tar.bz2
scala-72736f7238616f4e56a0ee28e9d204d95e81107f.zip
Merge pull request #3024 from retronym/ticket/7895
SI-7895 Error reporting: avoid cascading, truncation
Diffstat (limited to 'test/files/neg')
-rw-r--r--test/files/neg/any-vs-anyref.check18
-rw-r--r--test/files/neg/applydynamic_sip.check17
-rw-r--r--test/files/neg/macro-basic-mamdmi.check4
-rw-r--r--test/files/neg/names-defaults-neg.check16
-rw-r--r--test/files/neg/reflection-names-neg.check5
-rw-r--r--test/files/neg/t0418.check5
-rw-r--r--test/files/neg/t418.check5
-rw-r--r--test/files/neg/t4515.check12
-rw-r--r--test/files/neg/t512.check5
-rw-r--r--test/files/neg/t545.check5
-rw-r--r--test/files/neg/t556.check5
-rw-r--r--test/files/neg/t5572.check7
-rw-r--r--test/files/neg/t5761.check5
-rw-r--r--test/files/neg/t5903a.check5
-rw-r--r--test/files/neg/t5903b.check5
-rw-r--r--test/files/neg/t5903c.check5
-rw-r--r--test/files/neg/t5903d.check5
-rw-r--r--test/files/neg/t6829.check22
-rw-r--r--test/files/neg/t7895.check4
-rw-r--r--test/files/neg/t7895.scala6
-rw-r--r--test/files/neg/t7895b.check7
-rw-r--r--test/files/neg/t7895b.scala5
-rw-r--r--test/files/neg/t7895c.check13
-rw-r--r--test/files/neg/t7895c.scala3
-rw-r--r--test/files/neg/t997.check5
-rw-r--r--test/files/neg/typeerror.check7
26 files changed, 156 insertions, 45 deletions
diff --git a/test/files/neg/any-vs-anyref.check b/test/files/neg/any-vs-anyref.check
index 63c4853130..7378f0495f 100644
--- a/test/files/neg/any-vs-anyref.check
+++ b/test/files/neg/any-vs-anyref.check
@@ -36,12 +36,28 @@ Such types can participate in value classes, but instances
cannot appear in singleton types or in reference comparisons.
def foo5(x: Quux with Product) = (x eq "abc") && ("abc" eq x)
^
+any-vs-anyref.scala:10: error: type mismatch;
+ found : Quux with Product
+ required: AnyRef
+Note that the parents of this type (Quux, Product) extend Any, not AnyRef.
+Such types can participate in value classes, but instances
+cannot appear in singleton types or in reference comparisons.
+ def foo5(x: Quux with Product) = (x eq "abc") && ("abc" eq x)
+ ^
any-vs-anyref.scala:11: error: value eq is not a member of Quux with Product{def f: Int}
Note that the parents of this type (Quux, Product) extend Any, not AnyRef.
Such types can participate in value classes, but instances
cannot appear in singleton types or in reference comparisons.
def foo6(x: Quux with Product { def f: Int }) = (x eq "abc") && ("abc" eq x)
^
+any-vs-anyref.scala:11: error: type mismatch;
+ found : Quux with Product{def f: Int}
+ required: AnyRef
+Note that the parents of this type (Quux, Product) extend Any, not AnyRef.
+Such types can participate in value classes, but instances
+cannot appear in singleton types or in reference comparisons.
+ def foo6(x: Quux with Product { def f: Int }) = (x eq "abc") && ("abc" eq x)
+ ^
any-vs-anyref.scala:12: error: type mismatch;
found : Quux with Product{def eq(other: String): Boolean}
required: AnyRef
@@ -61,4 +77,4 @@ any-vs-anyref.scala:27: error: type mismatch;
required: Quux{def g(x: Int): Int}
f(new Quux { def g(x: String) = x })
^
-9 errors found
+11 errors found
diff --git a/test/files/neg/applydynamic_sip.check b/test/files/neg/applydynamic_sip.check
index dcf97b29fc..f28f26c147 100644
--- a/test/files/neg/applydynamic_sip.check
+++ b/test/files/neg/applydynamic_sip.check
@@ -4,9 +4,18 @@ applydynamic_sip.scala:7: error: applyDynamic does not support passing a vararg
applydynamic_sip.scala:8: error: applyDynamicNamed does not support passing a vararg parameter
qual.sel(arg = a, a2: _*)
^
+applydynamic_sip.scala:8: error: not found: value arg
+ qual.sel(arg = a, a2: _*)
+ ^
applydynamic_sip.scala:9: error: applyDynamicNamed does not support passing a vararg parameter
qual.sel(arg, arg2 = "a2", a2: _*)
^
+applydynamic_sip.scala:9: error: not found: value arg
+ qual.sel(arg, arg2 = "a2", a2: _*)
+ ^
+applydynamic_sip.scala:9: error: not found: value arg2
+ qual.sel(arg, arg2 = "a2", a2: _*)
+ ^
applydynamic_sip.scala:18: error: type mismatch;
found : String("sel")
required: Int
@@ -28,6 +37,9 @@ error after rewriting to Test.this.bad1.applyDynamicNamed("sel")
possible cause: maybe a wrong Dynamic method signature?
bad1.sel(a = 1)
^
+applydynamic_sip.scala:20: error: reassignment to val
+ bad1.sel(a = 1)
+ ^
applydynamic_sip.scala:21: error: type mismatch;
found : String("sel")
required: Int
@@ -50,9 +62,12 @@ error after rewriting to Test.this.bad2.applyDynamicNamed("sel")
possible cause: maybe a wrong Dynamic method signature?
bad2.sel(a = 1)
^
+applydynamic_sip.scala:31: error: reassignment to val
+ bad2.sel(a = 1)
+ ^
applydynamic_sip.scala:32: error: Int does not take parameters
error after rewriting to Test.this.bad2.updateDynamic("sel")
possible cause: maybe a wrong Dynamic method signature?
bad2.sel = 1
^
-11 errors found
+16 errors found
diff --git a/test/files/neg/macro-basic-mamdmi.check b/test/files/neg/macro-basic-mamdmi.check
index 621d318ceb..9328fbd51c 100644
--- a/test/files/neg/macro-basic-mamdmi.check
+++ b/test/files/neg/macro-basic-mamdmi.check
@@ -1,5 +1,5 @@
-Impls_Macros_Test_1.scala:36: error: macro implementation not found: foo
+Impls_Macros_Test_1.scala:36: error: macro implementation not found: quux
(the most common reason for that is that you cannot use macro implementations in the same compilation run that defines them)
println(foo(2) + Macros.bar(2) * new Macros().quux(4))
- ^
+ ^
one error found
diff --git a/test/files/neg/names-defaults-neg.check b/test/files/neg/names-defaults-neg.check
index cdc12c2490..880ddc4327 100644
--- a/test/files/neg/names-defaults-neg.check
+++ b/test/files/neg/names-defaults-neg.check
@@ -7,6 +7,11 @@ names-defaults-neg.scala:5: error: type mismatch;
required: Int
test1(b = 2, a = "#")
^
+names-defaults-neg.scala:5: error: type mismatch;
+ found : Int(2)
+ required: String
+ test1(b = 2, a = "#")
+ ^
names-defaults-neg.scala:8: error: positional after named argument.
test1(b = "(*", 23)
^
@@ -122,6 +127,12 @@ names-defaults-neg.scala:131: error: reference to var2 is ambiguous; it is both
names-defaults-neg.scala:134: error: missing parameter type for expanded function ((x$1) => a = x$1)
val taf2: Int => Unit = testAnnFun(a = _, b = get("+"))
^
+names-defaults-neg.scala:134: error: not found: value a
+ val taf2: Int => Unit = testAnnFun(a = _, b = get("+"))
+ ^
+names-defaults-neg.scala:134: error: not found: value get
+ val taf2: Int => Unit = testAnnFun(a = _, b = get("+"))
+ ^
names-defaults-neg.scala:135: error: parameter 'a' is already specified at parameter position 1
val taf3 = testAnnFun(b = _: String, a = get(8))
^
@@ -131,6 +142,9 @@ names-defaults-neg.scala:136: error: missing parameter type for expanded functio
names-defaults-neg.scala:136: error: missing parameter type for expanded function ((x$4) => b = x$4)
val taf4: (Int, String) => Unit = testAnnFun(_, b = _)
^
+names-defaults-neg.scala:136: error: not found: value b
+ val taf4: (Int, String) => Unit = testAnnFun(_, b = _)
+ ^
names-defaults-neg.scala:144: error: variable definition needs type because 'x' is used as a named argument in its body.
def t3 { var x = t.f(x = 1) }
^
@@ -168,4 +182,4 @@ names-defaults-neg.scala:180: error: reference to x is ambiguous; it is both a m
class u18 { var x: Int = u.f(x = 1) }
^
four warnings found
-42 errors found
+46 errors found
diff --git a/test/files/neg/reflection-names-neg.check b/test/files/neg/reflection-names-neg.check
index a56a19e7fd..f941ec8dc1 100644
--- a/test/files/neg/reflection-names-neg.check
+++ b/test/files/neg/reflection-names-neg.check
@@ -7,4 +7,7 @@ Note that implicit conversions are not applicable because they are ambiguous:
are possible conversion functions from String("abc") to reflect.runtime.universe.Name
val x2 = ("abc": Name) drop 1 // error
^
-one error found
+reflection-names-neg.scala:5: error: value drop is not a member of reflect.runtime.universe.Name
+ val x2 = ("abc": Name) drop 1 // error
+ ^
+two errors found
diff --git a/test/files/neg/t0418.check b/test/files/neg/t0418.check
index 4e9ad2f9ae..b95f8e4e1b 100644
--- a/test/files/neg/t0418.check
+++ b/test/files/neg/t0418.check
@@ -1,7 +1,4 @@
t0418.scala:2: error: not found: value Foo12340771
null match { case Foo12340771.Bar(x) => x }
^
-t0418.scala:2: error: not found: value x
- null match { case Foo12340771.Bar(x) => x }
- ^
-two errors found
+one error found
diff --git a/test/files/neg/t418.check b/test/files/neg/t418.check
index 1489547823..1b99717b82 100644
--- a/test/files/neg/t418.check
+++ b/test/files/neg/t418.check
@@ -1,7 +1,4 @@
t418.scala:2: error: not found: value Foo12340771
null match { case Foo12340771.Bar(x) => x }
^
-t418.scala:2: error: not found: value x
- null match { case Foo12340771.Bar(x) => x }
- ^
-two errors found
+one error found
diff --git a/test/files/neg/t4515.check b/test/files/neg/t4515.check
index 64e7cc1ca7..708fcfbd29 100644
--- a/test/files/neg/t4515.check
+++ b/test/files/neg/t4515.check
@@ -3,4 +3,14 @@ t4515.scala:37: error: type mismatch;
required: _$2
handler.onEvent(target, ctx.getEvent, node, ctx)
^
-one error found
+t4515.scala:37: error: type mismatch;
+ found : Main.DerivedPushNode[_$1] where type _$1
+ required: Main.PushNode[_$2]
+ handler.onEvent(target, ctx.getEvent, node, ctx)
+ ^
+t4515.scala:37: error: type mismatch;
+ found : Main.PushEventContext[_$1] where type _$1
+ required: Main.PushEventContext[_$2]
+ handler.onEvent(target, ctx.getEvent, node, ctx)
+ ^
+three errors found
diff --git a/test/files/neg/t512.check b/test/files/neg/t512.check
index 814e65e405..051e5ee19f 100644
--- a/test/files/neg/t512.check
+++ b/test/files/neg/t512.check
@@ -1,4 +1,7 @@
t512.scala:3: error: not found: value something
val xxx = something ||
^
-one error found
+t512.scala:4: error: not found: value something_else
+ something_else;
+ ^
+two errors found
diff --git a/test/files/neg/t545.check b/test/files/neg/t545.check
index 8ebbf9bdf6..aae575fa96 100644
--- a/test/files/neg/t545.check
+++ b/test/files/neg/t545.check
@@ -1,7 +1,4 @@
t545.scala:4: error: value blah is not a member of Test.Foo
val x = foo.blah match {
^
-t545.scala:5: error: recursive value x needs type
- case List(x) => x
- ^
-two errors found
+one error found
diff --git a/test/files/neg/t556.check b/test/files/neg/t556.check
index 5135dc92ef..30cc296b35 100644
--- a/test/files/neg/t556.check
+++ b/test/files/neg/t556.check
@@ -1,4 +1,7 @@
t556.scala:3: error: missing parameter type
def g:Int = f((x,y)=>x)
^
-one error found
+t556.scala:3: error: missing parameter type
+ def g:Int = f((x,y)=>x)
+ ^
+two errors found
diff --git a/test/files/neg/t5572.check b/test/files/neg/t5572.check
index 7b1e290861..3c9adf41cd 100644
--- a/test/files/neg/t5572.check
+++ b/test/files/neg/t5572.check
@@ -3,9 +3,14 @@ t5572.scala:16: error: type mismatch;
required: A
Z.transf(a, b) match {
^
+t5572.scala:16: error: type mismatch;
+ found : A
+ required: B
+ Z.transf(a, b) match {
+ ^
t5572.scala:18: error: type mismatch;
found : A
required: B
run(sth, b)
^
-two errors found
+three errors found
diff --git a/test/files/neg/t5761.check b/test/files/neg/t5761.check
index 89d766fe34..2d66af26f6 100644
--- a/test/files/neg/t5761.check
+++ b/test/files/neg/t5761.check
@@ -13,4 +13,7 @@ Unspecified value parameter x.
t5761.scala:13: error: not found: type Tread
new Tread("sth") { }.run()
^
-four errors found
+t5761.scala:13: error: value run is not a member of AnyRef
+ new Tread("sth") { }.run()
+ ^
+5 errors found
diff --git a/test/files/neg/t5903a.check b/test/files/neg/t5903a.check
index cbdcfd1bdd..2e5cc87167 100644
--- a/test/files/neg/t5903a.check
+++ b/test/files/neg/t5903a.check
@@ -1,7 +1,4 @@
Test_2.scala:4: error: wrong number of patterns for <$anon: AnyRef> offering (SomeTree.type, SomeTree.type): expected 2, found 3
case nq"$x + $y + $z" => println((x, y))
^
-Test_2.scala:4: error: not found: value x
- case nq"$x + $y + $z" => println((x, y))
- ^
-two errors found
+one error found
diff --git a/test/files/neg/t5903b.check b/test/files/neg/t5903b.check
index faeb73ad03..e7637d3edb 100644
--- a/test/files/neg/t5903b.check
+++ b/test/files/neg/t5903b.check
@@ -3,7 +3,4 @@ Test_2.scala:4: error: type mismatch;
required: String
case t"$x" => println(x)
^
-Test_2.scala:4: error: not found: value x
- case t"$x" => println(x)
- ^
-two errors found
+one error found
diff --git a/test/files/neg/t5903c.check b/test/files/neg/t5903c.check
index c9476edd11..05bd775d30 100644
--- a/test/files/neg/t5903c.check
+++ b/test/files/neg/t5903c.check
@@ -1,7 +1,4 @@
Test_2.scala:4: error: String is not supported
case t"$x" => println(x)
^
-Test_2.scala:4: error: not found: value x
- case t"$x" => println(x)
- ^
-two errors found
+one error found
diff --git a/test/files/neg/t5903d.check b/test/files/neg/t5903d.check
index d5d3fdcc28..9b8526b7f5 100644
--- a/test/files/neg/t5903d.check
+++ b/test/files/neg/t5903d.check
@@ -1,7 +1,4 @@
Test_2.scala:4: error: extractor macros can only expand into extractor calls
case t"$x" => println(x)
^
-Test_2.scala:4: error: not found: value x
- case t"$x" => println(x)
- ^
-two errors found
+one error found
diff --git a/test/files/neg/t6829.check b/test/files/neg/t6829.check
index c7c641844e..a0b43e3b52 100644
--- a/test/files/neg/t6829.check
+++ b/test/files/neg/t6829.check
@@ -20,11 +20,31 @@ t6829.scala:50: error: type mismatch;
required: _53.State where val _53: G
val r = rewards(agent).r(s,a,s2)
^
+t6829.scala:50: error: type mismatch;
+ found : a.type (with underlying type T2)
+ required: _53.Action where val _53: G
+ val r = rewards(agent).r(s,a,s2)
+ ^
+t6829.scala:50: error: type mismatch;
+ found : s2.type (with underlying type T3)
+ required: _53.State where val _53: G
+ val r = rewards(agent).r(s,a,s2)
+ ^
t6829.scala:51: error: type mismatch;
found : s.type (with underlying type T1)
required: _50.State
agent.learn(s,a,s2,r): G#Agent
^
+t6829.scala:51: error: type mismatch;
+ found : a.type (with underlying type T2)
+ required: _50.Action
+ agent.learn(s,a,s2,r): G#Agent
+ ^
+t6829.scala:51: error: type mismatch;
+ found : s2.type (with underlying type T3)
+ required: _50.State
+ agent.learn(s,a,s2,r): G#Agent
+ ^
t6829.scala:53: error: not found: value nextState
Error occurred in an application involving default arguments.
copy(agents = updatedAgents, state = nextState, pastHistory = currentHistory)
@@ -33,4 +53,4 @@ t6829.scala:53: error: not found: value currentHistory
Error occurred in an application involving default arguments.
copy(agents = updatedAgents, state = nextState, pastHistory = currentHistory)
^
-9 errors found
+13 errors found
diff --git a/test/files/neg/t7895.check b/test/files/neg/t7895.check
new file mode 100644
index 0000000000..1a58e24b77
--- /dev/null
+++ b/test/files/neg/t7895.check
@@ -0,0 +1,4 @@
+t7895.scala:4: error: not found: value Goop
+ case Goop(a, b, c) => Tuple2(a, b)
+ ^
+one error found
diff --git a/test/files/neg/t7895.scala b/test/files/neg/t7895.scala
new file mode 100644
index 0000000000..87a586a82d
--- /dev/null
+++ b/test/files/neg/t7895.scala
@@ -0,0 +1,6 @@
+class A {
+ (null: Any) match {
+ // We don't want "symbol not found errors" for `a` and `b` in the case body.
+ case Goop(a, b, c) => Tuple2(a, b)
+ }
+}
diff --git a/test/files/neg/t7895b.check b/test/files/neg/t7895b.check
new file mode 100644
index 0000000000..87ea72704e
--- /dev/null
+++ b/test/files/neg/t7895b.check
@@ -0,0 +1,7 @@
+t7895b.scala:4: error: not found: value a
+ foo(a, b)
+ ^
+t7895b.scala:4: error: not found: value b
+ foo(a, b)
+ ^
+two errors found
diff --git a/test/files/neg/t7895b.scala b/test/files/neg/t7895b.scala
new file mode 100644
index 0000000000..1603027446
--- /dev/null
+++ b/test/files/neg/t7895b.scala
@@ -0,0 +1,5 @@
+object Test {
+ def foo(a: Any*) = ()
+
+ foo(a, b)
+}
diff --git a/test/files/neg/t7895c.check b/test/files/neg/t7895c.check
new file mode 100644
index 0000000000..d4745b1f4b
--- /dev/null
+++ b/test/files/neg/t7895c.check
@@ -0,0 +1,13 @@
+t7895c.scala:2: error: not found: value bong
+ def booboo = bong + booble + bippity - bazingo
+ ^
+t7895c.scala:2: error: not found: value booble
+ def booboo = bong + booble + bippity - bazingo
+ ^
+t7895c.scala:2: error: not found: value bippity
+ def booboo = bong + booble + bippity - bazingo
+ ^
+t7895c.scala:2: error: not found: value bazingo
+ def booboo = bong + booble + bippity - bazingo
+ ^
+four errors found
diff --git a/test/files/neg/t7895c.scala b/test/files/neg/t7895c.scala
new file mode 100644
index 0000000000..53d2a8672e
--- /dev/null
+++ b/test/files/neg/t7895c.scala
@@ -0,0 +1,3 @@
+class A {
+ def booboo = bong + booble + bippity - bazingo
+}
diff --git a/test/files/neg/t997.check b/test/files/neg/t997.check
index be1e92c369..8c41060ba2 100644
--- a/test/files/neg/t997.check
+++ b/test/files/neg/t997.check
@@ -4,7 +4,4 @@ t997.scala:13: error: wrong number of patterns for object Foo offering (String,
t997.scala:13: error: wrong number of patterns for object Foo offering (String, String): expected 2, found 3
"x" match { case Foo(a, b, c) => Console.println((a,b,c)) }
^
-t997.scala:13: error: not found: value a
-"x" match { case Foo(a, b, c) => Console.println((a,b,c)) }
- ^
-three errors found
+two errors found
diff --git a/test/files/neg/typeerror.check b/test/files/neg/typeerror.check
index 3ce11dad8a..f117e702f0 100644
--- a/test/files/neg/typeerror.check
+++ b/test/files/neg/typeerror.check
@@ -3,4 +3,9 @@ typeerror.scala:6: error: type mismatch;
required: scala.Long
else add2(x.head, y.head) :: add(x.tail, y.tail)
^
-one error found
+typeerror.scala:6: error: type mismatch;
+ found : Long(in method add)
+ required: scala.Long
+ else add2(x.head, y.head) :: add(x.tail, y.tail)
+ ^
+two errors found