summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/files/continuations-run/t5472.check2
-rw-r--r--test/files/neg/classmanifests_new_deprecations.check4
-rw-r--r--test/files/neg/divergent-implicit.check4
-rw-r--r--test/files/neg/for-comprehension-old.check8
-rw-r--r--test/files/neg/forgot-interpolator.check21
-rw-r--r--test/files/neg/forgot-interpolator.scala32
-rw-r--r--test/files/neg/found-req-variance.check20
-rw-r--r--test/files/neg/lazyvals.check4
-rw-r--r--test/files/neg/macro-quasiquotes.check2
-rw-r--r--test/files/neg/multi-array.check2
-rw-r--r--test/files/neg/names-defaults-neg.check2
-rw-r--r--test/files/neg/nested-annotation.check2
-rw-r--r--test/files/neg/no-implicit-to-anyref.check2
-rw-r--r--test/files/neg/no-predef.check2
-rw-r--r--test/files/neg/parser-errors.check16
-rw-r--r--test/files/neg/parser-errors.scala5
-rw-r--r--test/files/neg/parser-import-errors.check28
-rw-r--r--test/files/neg/parser-import-errors.scala49
-rw-r--r--test/files/neg/primitive-sigs-1.check2
-rw-r--r--test/files/neg/protected-constructors.check4
-rw-r--r--test/files/neg/saito.check2
-rw-r--r--test/files/neg/sensitive.check2
-rw-r--r--test/files/neg/stringinterpolation_macro-neg.check2
-rw-r--r--test/files/neg/t0209.check2
-rw-r--r--test/files/neg/t1038.check2
-rw-r--r--test/files/neg/t1623.check2
-rw-r--r--test/files/neg/t1705.check2
-rw-r--r--test/files/neg/t2775.check2
-rw-r--r--test/files/neg/t3453.check8
-rw-r--r--test/files/neg/t3692-new.check2
-rw-r--r--test/files/neg/t3977.check2
-rw-r--r--test/files/neg/t4163.check7
-rw-r--r--test/files/neg/t4417.check2
-rw-r--r--test/files/neg/t4727.check2
-rw-r--r--test/files/neg/t4851.check12
-rw-r--r--test/files/neg/t4987.check2
-rw-r--r--test/files/neg/t5120.check4
-rw-r--r--test/files/neg/t5666.check24
-rw-r--r--test/files/neg/t5761.check2
-rw-r--r--test/files/neg/t5803.check2
-rw-r--r--test/files/neg/t6074.check2
-rw-r--r--test/files/neg/t6601.check2
-rw-r--r--test/files/neg/t6667b.check4
-rw-r--r--test/files/neg/t7385.check9
-rw-r--r--test/files/neg/t7473.check8
-rw-r--r--test/files/neg/t7473.scala4
-rw-r--r--test/files/neg/t771.check2
-rw-r--r--test/files/neg/t7848-interp-warn.check9
-rw-r--r--test/files/neg/t7848-interp-warn.flags1
-rw-r--r--test/files/neg/t7848-interp-warn.scala13
-rw-r--r--test/files/pos/t7854.scala5
-rw-r--r--test/files/pos/t7864.flags1
-rw-r--r--test/files/pos/t7864.scala5
-rw-r--r--test/files/run/existential-rangepos.check6
-rw-r--r--test/files/run/position-val-def.check30
-rw-r--r--test/files/run/position-val-def.scala26
-rw-r--r--test/files/run/t4742.flags1
-rw-r--r--test/files/run/t4742.scala7
-rw-r--r--test/files/run/t5064.check8
-rw-r--r--test/files/run/t5385.check16
-rw-r--r--test/files/run/t5603.check26
-rw-r--r--test/files/run/t6288.check6
-rw-r--r--test/files/run/t6768.check12
-rw-r--r--test/files/run/t6768.scala12
-rw-r--r--test/files/run/t7271.check2
-rw-r--r--test/files/run/t7852.check0
-rw-r--r--test/files/run/t7852.flags1
-rw-r--r--test/files/run/t7852.scala39
-rw-r--r--test/files/run/t7868.scala13
-rw-r--r--test/files/run/t7868b.check6
-rw-r--r--test/files/run/t7868b.scala11
-rw-r--r--test/files/run/t7876.scala26
-rw-r--r--test/files/scalacheck/quasiquotes/TermConstructionProps.scala24
-rw-r--r--test/files/scalacheck/quasiquotes/TermDeconstructionProps.scala20
-rw-r--r--test/scaladoc/run/SI-4676.scala3
-rw-r--r--test/scaladoc/run/t7876.check1
-rw-r--r--test/scaladoc/run/t7876.scala19
-rw-r--r--test/scaladoc/run/t7876b.check3
-rw-r--r--test/scaladoc/run/t7876b.scala24
79 files changed, 454 insertions, 249 deletions
diff --git a/test/files/continuations-run/t5472.check b/test/files/continuations-run/t5472.check
index 1af7767f6d..3192c746eb 100644
--- a/test/files/continuations-run/t5472.check
+++ b/test/files/continuations-run/t5472.check
@@ -5,7 +5,7 @@ t5472.scala:12: warning: expression case4(){
case5()
} is cps-transformed unexpectedly
(location, accessors) <- new ContinuationizedParallelIterable(map)
- ^
+ ^
t5472.scala:12: warning: expression matchEnd3(x: Int){
x
} is cps-transformed unexpectedly
diff --git a/test/files/neg/classmanifests_new_deprecations.check b/test/files/neg/classmanifests_new_deprecations.check
index 39b6bf216c..fd1e2728c3 100644
--- a/test/files/neg/classmanifests_new_deprecations.check
+++ b/test/files/neg/classmanifests_new_deprecations.check
@@ -1,6 +1,6 @@
classmanifests_new_deprecations.scala:2: warning: type ClassManifest in object Predef is deprecated: Use `scala.reflect.ClassTag` instead
def cm1[T: ClassManifest] = ???
- ^
+ ^
classmanifests_new_deprecations.scala:3: warning: type ClassManifest in object Predef is deprecated: Use `scala.reflect.ClassTag` instead
def cm2[T](implicit evidence$1: ClassManifest[T]) = ???
^
@@ -9,7 +9,7 @@ classmanifests_new_deprecations.scala:4: warning: type ClassManifest in object P
^
classmanifests_new_deprecations.scala:6: warning: type ClassManifest in package reflect is deprecated: Use scala.reflect.ClassTag instead
def rcm1[T: scala.reflect.ClassManifest] = ???
- ^
+ ^
classmanifests_new_deprecations.scala:7: warning: type ClassManifest in package reflect is deprecated: Use scala.reflect.ClassTag instead
def rcm2[T](implicit evidence$1: scala.reflect.ClassManifest[T]) = ???
^
diff --git a/test/files/neg/divergent-implicit.check b/test/files/neg/divergent-implicit.check
index b5c607cf59..5f20df1b91 100644
--- a/test/files/neg/divergent-implicit.check
+++ b/test/files/neg/divergent-implicit.check
@@ -10,9 +10,9 @@ starting with method cast in object Test1
divergent-implicit.scala:14: error: diverging implicit expansion for type Test2.Baz => Test2.Bar
starting with method baz2bar in object Test2
val x: Bar = new Foo
- ^
+ ^
divergent-implicit.scala:15: error: diverging implicit expansion for type Test2.Foo => Test2.Bar
starting with method foo2bar in object Test2
val y: Bar = new Baz
- ^
+ ^
four errors found
diff --git a/test/files/neg/for-comprehension-old.check b/test/files/neg/for-comprehension-old.check
index fc04beca53..1ecaf12af4 100644
--- a/test/files/neg/for-comprehension-old.check
+++ b/test/files/neg/for-comprehension-old.check
@@ -1,15 +1,15 @@
for-comprehension-old.scala:3: warning: val keyword in for comprehension is deprecated
for (x <- 1 to 5 ; val y = x) yield x+y // fail
- ^
+ ^
for-comprehension-old.scala:5: warning: val keyword in for comprehension is deprecated
for (val x <- 1 to 5 ; val y = x) yield x+y // fail
- ^
+ ^
for-comprehension-old.scala:8: warning: val keyword in for comprehension is deprecated
for (z <- 1 to 2 ; x <- 1 to 5 ; val y = x) yield x+y // fail
- ^
+ ^
for-comprehension-old.scala:10: warning: val keyword in for comprehension is deprecated
for (z <- 1 to 2 ; val x <- 1 to 5 ; val y = x) yield x+y // fail
- ^
+ ^
for-comprehension-old.scala:4: error: val in for comprehension must be followed by assignment
for (val x <- 1 to 5 ; y = x) yield x+y // fail
^
diff --git a/test/files/neg/forgot-interpolator.check b/test/files/neg/forgot-interpolator.check
index f6de4d7b3a..a96431841f 100644
--- a/test/files/neg/forgot-interpolator.check
+++ b/test/files/neg/forgot-interpolator.check
@@ -1,9 +1,24 @@
-forgot-interpolator.scala:4: warning: looks like an interpolated String; did you forget the interpolator?
+forgot-interpolator.scala:4: warning: `$bippy` looks like an interpolated identifier! Did you forget the interpolator?
def f = "Put the $bippy in the $bippy!" // warn
^
-forgot-interpolator.scala:14: warning: looks like an interpolated String; did you forget the interpolator?
+forgot-interpolator.scala:14: warning: That looks like an interpolated expression! Did you forget the interpolator?
def f = """Put the ${println("bippy")} in the bippy!""" // warn
^
+forgot-interpolator.scala:30: warning: `$beppo` looks like an interpolated identifier! Did you forget the interpolator?
+ def f = "$beppo was a marx bros who saw dollars." // warn
+ ^
+forgot-interpolator.scala:34: warning: `$aleppo` looks like an interpolated identifier! Did you forget the interpolator?
+ def f = "$aleppo is a pepper and a city." // warn
+ ^
+forgot-interpolator.scala:40: warning: `$bar` looks like an interpolated identifier! Did you forget the interpolator?
+ def f = "$bar is private, shall we warn just in case?" // warn
+ ^
+forgot-interpolator.scala:45: warning: `$hippo` looks like an interpolated identifier! Did you forget the interpolator?
+ def h = "$hippo takes an implicit" // warn
+ ^
+forgot-interpolator.scala:37: warning: private method in class Bar is never used
+ private def bar = 8
+ ^
error: No warnings can be incurred under -Xfatal-warnings.
-two warnings found
+7 warnings found
one error found
diff --git a/test/files/neg/forgot-interpolator.scala b/test/files/neg/forgot-interpolator.scala
index d67db82643..5067f1dce9 100644
--- a/test/files/neg/forgot-interpolator.scala
+++ b/test/files/neg/forgot-interpolator.scala
@@ -13,3 +13,35 @@ class B {
class C {
def f = """Put the ${println("bippy")} in the bippy!""" // warn
}
+
+package object test {
+ def aleppo = 9
+ def greppo(n: Int) = ???
+ def zappos(n: Int)(implicit ord: math.Ordering[Int]) = ???
+ def hippo(implicit n: Int) = ???
+}
+
+package test {
+ // not sure if overloading is kosher in pkg obj yet
+ class Doo {
+ def beppo(i: Int) = 8 * i
+ def beppo = 8
+ class Dah extends Doo {
+ def f = "$beppo was a marx bros who saw dollars." // warn
+ }
+ }
+ class E {
+ def f = "$aleppo is a pepper and a city." // warn
+ }
+ class Bar {
+ private def bar = 8
+ }
+ class Baz extends Bar {
+ def f = "$bar is private, shall we warn just in case?" // warn
+ }
+ class G {
+ def g = "$greppo takes an arg" // no warn
+ def z = "$zappos takes an arg too" // no warn
+ def h = "$hippo takes an implicit" // warn
+ }
+}
diff --git a/test/files/neg/found-req-variance.check b/test/files/neg/found-req-variance.check
index 55a01012a9..cc26458ac5 100644
--- a/test/files/neg/found-req-variance.check
+++ b/test/files/neg/found-req-variance.check
@@ -4,56 +4,56 @@ found-req-variance.scala:22: error: type mismatch;
Note: B <: A, but class Inv is invariant in type T.
You may wish to define T as +T instead. (SLS 4.5)
def f2 = Set[Inv[A]]() + new Inv[B]
- ^
+ ^
found-req-variance.scala:23: error: type mismatch;
found : Inv[C]
required: Inv[A]
Note: C <: A, but class Inv is invariant in type T.
You may wish to define T as +T instead. (SLS 4.5)
def f3 = Set[Inv[A]]() + new Inv[C]
- ^
+ ^
found-req-variance.scala:24: error: type mismatch;
found : Inv[A]
required: Inv[B]
Note: A >: B, but class Inv is invariant in type T.
You may wish to define T as -T instead. (SLS 4.5)
def f4 = Set[Inv[B]]() + new Inv[A]
- ^
+ ^
found-req-variance.scala:26: error: type mismatch;
found : Inv[C]
required: Inv[B]
Note: C <: B, but class Inv is invariant in type T.
You may wish to define T as +T instead. (SLS 4.5)
def f6 = Set[Inv[B]]() + new Inv[C]
- ^
+ ^
found-req-variance.scala:27: error: type mismatch;
found : Inv[A]
required: Inv[C]
Note: A >: C, but class Inv is invariant in type T.
You may wish to define T as -T instead. (SLS 4.5)
def f7 = Set[Inv[C]]() + new Inv[A]
- ^
+ ^
found-req-variance.scala:28: error: type mismatch;
found : Inv[B]
required: Inv[C]
Note: B >: C, but class Inv is invariant in type T.
You may wish to define T as -T instead. (SLS 4.5)
def f8 = Set[Inv[C]]() + new Inv[B]
- ^
+ ^
found-req-variance.scala:34: error: type mismatch;
found : MultiInv[A]
required: Multi[A,B,C]
Note: A >: B (and MultiInv[A] <: Multi[A,A,C]), but class Multi is invariant in type Inv.
You may wish to define Inv as -Inv instead. (SLS 4.5)
def g4 = Set[Multi[A, B, C]]() + new MultiInv[A]
- ^
+ ^
found-req-variance.scala:36: error: type mismatch;
found : MultiInv[C]
required: Multi[A,B,C]
Note: C <: B (and MultiInv[C] <: Multi[A,C,C]), but class Multi is invariant in type Inv.
You may wish to define Inv as +Inv instead. (SLS 4.5)
def g6 = Set[Multi[A, B, C]]() + new MultiInv[C]
- ^
+ ^
found-req-variance.scala:47: error: type mismatch;
found : FF1[A,A]
required: FF1[B,B]
@@ -160,7 +160,7 @@ found-req-variance.scala:94: error: type mismatch;
Note: Int <: AnyVal (and Misc.MyData <: Misc.Data[Int]), but class Data is invariant in type A.
You may wish to define A as +A instead. (SLS 4.5)
def f1 = Set[Data[AnyVal]]() + new MyData
- ^
+ ^
found-req-variance.scala:100: error: type mismatch;
found : Set[String]
required: Set[CharSequence]
@@ -174,7 +174,7 @@ found-req-variance.scala:104: error: type mismatch;
Note: String <: Object, but class Trippy is invariant in type T2.
You may wish to define T2 as +T2 instead. (SLS 4.5)
def g1 = Set[Trippy[AnyRef, AnyRef, AnyRef]]() + new Trippy[String, String, String]
- ^
+ ^
found-req-variance.scala:105: error: type mismatch;
found : scala.collection.immutable.Map[AnyRef,String]
required: Map[String,String]
diff --git a/test/files/neg/lazyvals.check b/test/files/neg/lazyvals.check
index 1ae8b13d92..c4daf9d842 100644
--- a/test/files/neg/lazyvals.check
+++ b/test/files/neg/lazyvals.check
@@ -7,9 +7,9 @@ lazyvals.scala:9: error: lazy not allowed here. Only vals can be lazy
lazyvals.scala:12: error: lazy not allowed here. Only vals can be lazy
lazy def q: Double = 0.0
^
-lazyvals.scala:15: error: lazy values may not be abstract
+lazyvals.scala:15: error: '=' expected but ';' found.
lazy val t;
- ^
+ ^
lazyvals.scala:20: error: lazy not allowed here. Only vals can be lazy
lazy trait T {}
^
diff --git a/test/files/neg/macro-quasiquotes.check b/test/files/neg/macro-quasiquotes.check
index a2d48723b5..96ef75dd32 100644
--- a/test/files/neg/macro-quasiquotes.check
+++ b/test/files/neg/macro-quasiquotes.check
@@ -1,6 +1,6 @@
Macros_1.scala:14: error: macro implementation has wrong shape:
required: (x: Impls.this.c.Expr[Int]): Impls.this.c.Expr[Any]
- found : (x: Impls.this.c.universe.Block): Impls.this.c.universe.Apply
+ found : (x: Impls.this.c.universe.Block): Impls.this.c.universe.Tree
type mismatch for parameter x: Impls.this.c.Expr[Int] does not conform to Impls.this.c.universe.Block
def m3(x: Int) = macro Impls.impl3
^
diff --git a/test/files/neg/multi-array.check b/test/files/neg/multi-array.check
index 6bdeb34c9e..511caa126f 100644
--- a/test/files/neg/multi-array.check
+++ b/test/files/neg/multi-array.check
@@ -1,4 +1,4 @@
multi-array.scala:7: error: too many arguments for constructor Array: (_length: Int)Array[T]
val a: Array[Int] = new Array(10, 10)
- ^
+ ^
one error found
diff --git a/test/files/neg/names-defaults-neg.check b/test/files/neg/names-defaults-neg.check
index 4966779cc3..cdc12c2490 100644
--- a/test/files/neg/names-defaults-neg.check
+++ b/test/files/neg/names-defaults-neg.check
@@ -97,7 +97,7 @@ names-defaults-neg.scala:82: error: type mismatch;
required: String
Error occurred in an application involving default arguments.
new A2[String]()
- ^
+ ^
names-defaults-neg.scala:86: error: module extending its companion class cannot use default constructor arguments
object C extends C()
^
diff --git a/test/files/neg/nested-annotation.check b/test/files/neg/nested-annotation.check
index c077d35a29..ca263943fe 100644
--- a/test/files/neg/nested-annotation.check
+++ b/test/files/neg/nested-annotation.check
@@ -5,6 +5,6 @@ class ComplexAnnotation(val value: Annotation) extends ClassfileAnnotation
^
nested-annotation.scala:8: error: nested classfile annotations must be defined in java; found: inline
@ComplexAnnotation(new inline) def bippy(): Int = 1
- ^
+ ^
one warning found
one error found
diff --git a/test/files/neg/no-implicit-to-anyref.check b/test/files/neg/no-implicit-to-anyref.check
index 5ab5fd12a1..fe417ad8b0 100644
--- a/test/files/neg/no-implicit-to-anyref.check
+++ b/test/files/neg/no-implicit-to-anyref.check
@@ -18,5 +18,5 @@ Note that AV extends Any, not AnyRef.
Such types can participate in value classes, but instances
cannot appear in singleton types or in reference comparisons.
new AV(0): AnyRef
- ^
+ ^
four errors found
diff --git a/test/files/neg/no-predef.check b/test/files/neg/no-predef.check
index fc538892ef..a63d8c5ba5 100644
--- a/test/files/neg/no-predef.check
+++ b/test/files/neg/no-predef.check
@@ -7,7 +7,7 @@ no-predef.scala:3: error: type mismatch;
found : java.lang.Long
required: scala.Long
def f2 = new java.lang.Long(5) : Long
- ^
+ ^
no-predef.scala:4: error: value map is not a member of String
def f3 = "abc" map (_ + 1)
^
diff --git a/test/files/neg/parser-errors.check b/test/files/neg/parser-errors.check
deleted file mode 100644
index 0ab3331c0c..0000000000
--- a/test/files/neg/parser-errors.check
+++ /dev/null
@@ -1,16 +0,0 @@
-parser-errors.scala:1: error: lazy values may not be abstract
-abstract class A1 { lazy val foo: Int }
- ^
-parser-errors.scala:2: error: pattern definition may not be abstract
-abstract class A2 { val Some(x) }
- ^
-parser-errors.scala:3: error: an explicit type is required for default initialization
-abstract class A3 { var x = _ }
- ^
-parser-errors.scala:4: error: only vars are eligible for default initialization
-abstract class A4 { val x: Int = _ }
- ^
-parser-errors.scala:5: error: pattern definition is ineligible for default initialization
-abstract class A5 { var Some(x) = _ }
- ^
-5 errors found
diff --git a/test/files/neg/parser-errors.scala b/test/files/neg/parser-errors.scala
deleted file mode 100644
index 7b1a290629..0000000000
--- a/test/files/neg/parser-errors.scala
+++ /dev/null
@@ -1,5 +0,0 @@
-abstract class A1 { lazy val foo: Int }
-abstract class A2 { val Some(x) }
-abstract class A3 { var x = _ }
-abstract class A4 { val x: Int = _ }
-abstract class A5 { var Some(x) = _ }
diff --git a/test/files/neg/parser-import-errors.check b/test/files/neg/parser-import-errors.check
deleted file mode 100644
index e211c275a6..0000000000
--- a/test/files/neg/parser-import-errors.check
+++ /dev/null
@@ -1,28 +0,0 @@
-parser-import-errors.scala:12: error: not found: type B1
- new B1
- ^
-parser-import-errors.scala:13: error: not found: type C1
- new C1
- ^
-parser-import-errors.scala:19: error: object X1 is not a member of package p1
- import p1.{ A1 => X1, X1 => A1 }
- ^
-parser-import-errors.scala:21: error: not found: type A1
- new A1
- ^
-parser-import-errors.scala:22: error: not found: type B1
- new B1
- ^
-parser-import-errors.scala:23: error: not found: type C1
- new C1
- ^
-parser-import-errors.scala:33: error: not found: type C1
- new C1
- ^
-parser-import-errors.scala:38: error: A1 appears twice as a target of a renaming
- import p1.{ A1, B1 => A1 }
- ^
-parser-import-errors.scala:45: error: object Z1 is not a member of package p1
- import p1.{ Z1, B1 => Z1 }
- ^
-9 errors found
diff --git a/test/files/neg/parser-import-errors.scala b/test/files/neg/parser-import-errors.scala
deleted file mode 100644
index 010bb95a1e..0000000000
--- a/test/files/neg/parser-import-errors.scala
+++ /dev/null
@@ -1,49 +0,0 @@
-package p1 {
- class A1
- class B1
- class C1
-}
-
-package p2 {
- import p1.{ A1, B1 => Q1, C1 => _ }
-
- class X {
- new A1
- new B1
- new C1
- new Q1
- }
-}
-
-package p3 {
- import p1.{ A1 => X1, X1 => A1 }
- class X {
- new A1
- new B1
- new C1
- new X1
- }
-}
-
-package p4 {
- import p1.{ A1 => B1, B1 => A1 }
- class X {
- new A1
- new B1
- new C1
- }
-}
-
-package p5 {
- import p1.{ A1, B1 => A1 }
- class X {
- new A1
- }
-}
-
-package p6 {
- import p1.{ Z1, B1 => Z1 }
- class X {
- new Z1
- }
-}
diff --git a/test/files/neg/primitive-sigs-1.check b/test/files/neg/primitive-sigs-1.check
index d0619fa1d3..77dc457a49 100644
--- a/test/files/neg/primitive-sigs-1.check
+++ b/test/files/neg/primitive-sigs-1.check
@@ -2,5 +2,5 @@ B.scala:3: error: type mismatch;
found : Bippy
required: AC[Integer]
J.f(new Bippy())
- ^
+ ^
one error found
diff --git a/test/files/neg/protected-constructors.check b/test/files/neg/protected-constructors.check
index b636d076e4..f44d7db9b9 100644
--- a/test/files/neg/protected-constructors.check
+++ b/test/files/neg/protected-constructors.check
@@ -1,12 +1,12 @@
protected-constructors.scala:17: error: too many arguments for constructor Foo1: ()dingus.Foo1
val foo1 = new Foo1("abc")
- ^
+ ^
protected-constructors.scala:18: error: constructor Foo2 in class Foo2 cannot be accessed in object P
Access to protected constructor Foo2 not permitted because
enclosing object P in package hungus is not a subclass of
class Foo2 in package dingus where target is defined
val foo2 = new Foo2("abc")
- ^
+ ^
protected-constructors.scala:19: error: class Foo3 in object Ding cannot be accessed in object dingus.Ding
Access to protected class Foo3 not permitted because
enclosing object P in package hungus is not a subclass of
diff --git a/test/files/neg/saito.check b/test/files/neg/saito.check
index f78b300b4c..061a45b76e 100644
--- a/test/files/neg/saito.check
+++ b/test/files/neg/saito.check
@@ -1,4 +1,4 @@
saito.scala:10: error: class A cannot be instantiated because it does not conform to its self-type A with B
val a: A = new A; // should not be allowed
- ^
+ ^
one error found
diff --git a/test/files/neg/sensitive.check b/test/files/neg/sensitive.check
index 9270e639c3..32d988ec97 100644
--- a/test/files/neg/sensitive.check
+++ b/test/files/neg/sensitive.check
@@ -1,4 +1,4 @@
sensitive.scala:17: error: constructor Sensitive in class Sensitive cannot be accessed in object Attacker
val y = new Sensitive()
- ^
+ ^
one error found
diff --git a/test/files/neg/stringinterpolation_macro-neg.check b/test/files/neg/stringinterpolation_macro-neg.check
index fa4f2c9472..457f497f2f 100644
--- a/test/files/neg/stringinterpolation_macro-neg.check
+++ b/test/files/neg/stringinterpolation_macro-neg.check
@@ -1,6 +1,6 @@
stringinterpolation_macro-neg.scala:8: error: too few parts
new StringContext().f()
- ^
+ ^
stringinterpolation_macro-neg.scala:9: error: too few arguments for interpolated string
new StringContext("", " is ", "%2d years old").f(s)
^
diff --git a/test/files/neg/t0209.check b/test/files/neg/t0209.check
index 4ba5fef4e9..1904e58e7a 100644
--- a/test/files/neg/t0209.check
+++ b/test/files/neg/t0209.check
@@ -2,5 +2,5 @@ t0209.scala:15: error: type mismatch;
found : C
required: _1.type where val _1: A
(new B: A).f(new C)
- ^
+ ^
one error found
diff --git a/test/files/neg/t1038.check b/test/files/neg/t1038.check
index c74d8b338f..b191b89ad1 100644
--- a/test/files/neg/t1038.check
+++ b/test/files/neg/t1038.check
@@ -1,5 +1,5 @@
t1038.scala:4: error: not enough arguments for constructor X: (x: Int)X.
Unspecified value parameter x.
val a = new X
- ^
+ ^
one error found
diff --git a/test/files/neg/t1623.check b/test/files/neg/t1623.check
index e30db5cddd..251039ad30 100644
--- a/test/files/neg/t1623.check
+++ b/test/files/neg/t1623.check
@@ -1,4 +1,4 @@
t1623.scala:11: error: class BImpl cannot be instantiated because it does not conform to its self-type test.BImpl with test.A
val b = new BImpl
- ^
+ ^
one error found
diff --git a/test/files/neg/t1705.check b/test/files/neg/t1705.check
index 12f5c27de6..7f75bd0fb5 100644
--- a/test/files/neg/t1705.check
+++ b/test/files/neg/t1705.check
@@ -1,6 +1,6 @@
t1705.scala:9: error: can't existentially abstract over parameterized type this.T[Z]
val c = new C{
- ^
+ ^
t1705.scala:14: error: can't existentially abstract over parameterized type C[String]
val x1 = {
^
diff --git a/test/files/neg/t2775.check b/test/files/neg/t2775.check
index 2c901665d6..934a970f2e 100644
--- a/test/files/neg/t2775.check
+++ b/test/files/neg/t2775.check
@@ -1,4 +1,4 @@
t2775.scala:1: error: cannot find class tag for element type B.this.T
trait B[S] { type T = S; val c = new Array[T](1) }
- ^
+ ^
one error found
diff --git a/test/files/neg/t3453.check b/test/files/neg/t3453.check
index 2472e8b212..52c948128c 100644
--- a/test/files/neg/t3453.check
+++ b/test/files/neg/t3453.check
@@ -2,20 +2,20 @@ t3453.scala:18: error: type mismatch;
found : A
required: B
new A
- ^
+ ^
t3453.scala:36: error: type mismatch;
found : A
required: B
new A
- ^
+ ^
t3453.scala:50: error: type mismatch;
found : A
required: B
new A
- ^
+ ^
t3453.scala:64: error: type mismatch;
found : A
required: B
new A
- ^
+ ^
four errors found
diff --git a/test/files/neg/t3692-new.check b/test/files/neg/t3692-new.check
index 358eaed41e..9b96449930 100644
--- a/test/files/neg/t3692-new.check
+++ b/test/files/neg/t3692-new.check
@@ -9,7 +9,7 @@ t3692-new.scala:16: warning: non-variable type argument Int in type pattern Map[
^
t3692-new.scala:15: warning: unreachable code
case m1: Map[Int, V] => new java.util.HashMap[Integer, V]
- ^
+ ^
t3692-new.scala:4: warning: Tester has a main method with parameter type Array[String], but Tester will not be a runnable program.
Reason: main method must have exact signature (Array[String])Unit
object Tester {
diff --git a/test/files/neg/t3977.check b/test/files/neg/t3977.check
index 4242059463..72335a0926 100644
--- a/test/files/neg/t3977.check
+++ b/test/files/neg/t3977.check
@@ -1,4 +1,4 @@
t3977.scala:12: error: could not find implicit value for parameter w: False#If[E]
new NoNull
- ^
+ ^
one error found
diff --git a/test/files/neg/t4163.check b/test/files/neg/t4163.check
index a09a522e3a..47bc78d31c 100644
--- a/test/files/neg/t4163.check
+++ b/test/files/neg/t4163.check
@@ -1,4 +1,7 @@
-t4163.scala:4: error: for comprehension must start with generator: '<-' expected but '=' found.
+t4163.scala:4: error: '<-' expected but '=' found.
x = 3
^
-one error found
+t4163.scala:5: error: illegal start of simple expression
+ y <- 0 to 100
+^
+two errors found
diff --git a/test/files/neg/t4417.check b/test/files/neg/t4417.check
index dfc9feca24..dbd0f1df46 100644
--- a/test/files/neg/t4417.check
+++ b/test/files/neg/t4417.check
@@ -3,5 +3,5 @@ t4417.scala:11: error: constructor Pixel$mcD$sp in class Pixel$mcD$sp cannot be
enclosing object Pixel is not a subclass of
class Pixel$mcD$sp where target is defined
def apply(v: Double): Pixel1d = new Pixel1d(v)
- ^
+ ^
one error found
diff --git a/test/files/neg/t4727.check b/test/files/neg/t4727.check
index 55d4d01b97..a17cdde044 100644
--- a/test/files/neg/t4727.check
+++ b/test/files/neg/t4727.check
@@ -1,5 +1,5 @@
t4727.scala:5: error: an expression of type Null is ineligible for implicit conversion
Error occurred in an application involving default arguments.
new C[Int]
- ^
+ ^
one error found
diff --git a/test/files/neg/t4851.check b/test/files/neg/t4851.check
index 6d0f424e82..4f2919807e 100644
--- a/test/files/neg/t4851.check
+++ b/test/files/neg/t4851.check
@@ -3,19 +3,19 @@ S.scala:2: warning: Adapting argument list by inserting (): leaky (Object-receiv
given arguments: <none>
after adaptation: new J((): Unit)
val x1 = new J
- ^
+ ^
S.scala:3: warning: Adapting argument list by inserting (): leaky (Object-receiving) target makes this especially dangerous.
signature: J(x: Any): J
given arguments: <none>
after adaptation: new J((): Unit)
val x2 = new J()
- ^
+ ^
S.scala:4: warning: Adapting argument list by creating a 5-tuple: this may not be what you want.
signature: J(x: Any): J
given arguments: 1, 2, 3, 4, 5
after adaptation: new J((1, 2, 3, 4, 5): (Int, Int, Int, Int, Int))
val x3 = new J(1, 2, 3, 4, 5)
- ^
+ ^
S.scala:6: warning: Adapting argument list by creating a 3-tuple: this may not be what you want.
signature: Some.apply[A](x: A): Some[A]
given arguments: 1, 2, 3
@@ -27,19 +27,19 @@ S.scala:7: warning: Adapting argument list by creating a 3-tuple: this may not b
given arguments: 1, 2, 3
after adaptation: new Some((1, 2, 3): (Int, Int, Int))
val y2 = new Some(1, 2, 3)
- ^
+ ^
S.scala:9: warning: Adapting argument list by inserting (): this is unlikely to be what you want.
signature: J2[T](x: T): J2[T]
given arguments: <none>
after adaptation: new J2((): Unit)
val z1 = new J2
- ^
+ ^
S.scala:10: warning: Adapting argument list by inserting (): this is unlikely to be what you want.
signature: J2[T](x: T): J2[T]
given arguments: <none>
after adaptation: new J2((): Unit)
val z2 = new J2()
- ^
+ ^
S.scala:14: warning: Adapting argument list by creating a 3-tuple: this may not be what you want.
signature: Test.anyId(a: Any): Any
given arguments: 1, 2, 3
diff --git a/test/files/neg/t4987.check b/test/files/neg/t4987.check
index ee058f0ac1..8d7344d27b 100644
--- a/test/files/neg/t4987.check
+++ b/test/files/neg/t4987.check
@@ -1,4 +1,4 @@
t4987.scala:2: error: constructor Foo2 in class Foo2 cannot be accessed in object Bar2
object Bar2 { new Foo2(0, 0) }
- ^
+ ^
one error found
diff --git a/test/files/neg/t5120.check b/test/files/neg/t5120.check
index fc65ca16a5..34d4ebde31 100644
--- a/test/files/neg/t5120.check
+++ b/test/files/neg/t5120.check
@@ -2,11 +2,11 @@ t5120.scala:11: error: type mismatch;
found : Object
required: _1
List(str, other) foreach (_.x1 = new AnyRef)
- ^
+ ^
t5120.scala:25: error: type mismatch;
found : Thread
required: h.T
(which expands to) _2
List(str, num).foreach(h => h.f1 = new Thread())
- ^
+ ^
two errors found
diff --git a/test/files/neg/t5666.check b/test/files/neg/t5666.check
index da6b9d73e7..1c714796ba 100644
--- a/test/files/neg/t5666.check
+++ b/test/files/neg/t5666.check
@@ -1,37 +1,37 @@
t5666.scala:2: error: class Any is abstract; cannot be instantiated
new Any
- ^
+ ^
t5666.scala:3: error: class AnyVal is abstract; cannot be instantiated
new AnyVal
- ^
+ ^
t5666.scala:4: error: class Double is abstract; cannot be instantiated
new Double
- ^
+ ^
t5666.scala:5: error: class Float is abstract; cannot be instantiated
new Float
- ^
+ ^
t5666.scala:6: error: class Long is abstract; cannot be instantiated
new Long
- ^
+ ^
t5666.scala:7: error: class Int is abstract; cannot be instantiated
new Int
- ^
+ ^
t5666.scala:8: error: class Char is abstract; cannot be instantiated
new Char
- ^
+ ^
t5666.scala:9: error: class Short is abstract; cannot be instantiated
new Short
- ^
+ ^
t5666.scala:10: error: class Byte is abstract; cannot be instantiated
new Byte
- ^
+ ^
t5666.scala:11: error: class Boolean is abstract; cannot be instantiated
new Boolean
- ^
+ ^
t5666.scala:12: error: class Unit is abstract; cannot be instantiated
new Unit
- ^
+ ^
t5666.scala:13: error: class Nothing is abstract; cannot be instantiated
new Nothing
- ^
+ ^
12 errors found
diff --git a/test/files/neg/t5761.check b/test/files/neg/t5761.check
index 8086af2fcf..89d766fe34 100644
--- a/test/files/neg/t5761.check
+++ b/test/files/neg/t5761.check
@@ -5,7 +5,7 @@ Unspecified value parameter x.
t5761.scala:8: error: not enough arguments for constructor D: (x: Int)D[Int].
Unspecified value parameter x.
println(new D[Int]()) // no crash
- ^
+ ^
t5761.scala:9: error: not enough arguments for constructor D: (x: Int)D[Int].
Unspecified value parameter x.
println(new D[Int]{}) // crash
diff --git a/test/files/neg/t5803.check b/test/files/neg/t5803.check
index c4f901e511..6a2de2e1df 100644
--- a/test/files/neg/t5803.check
+++ b/test/files/neg/t5803.check
@@ -1,4 +1,4 @@
t5803.scala:3: error: could not find implicit value for parameter ev: Nothing
new Foo(): String
- ^
+ ^
one error found
diff --git a/test/files/neg/t6074.check b/test/files/neg/t6074.check
index 6abf5e2906..38670e5b3d 100644
--- a/test/files/neg/t6074.check
+++ b/test/files/neg/t6074.check
@@ -1,4 +1,4 @@
t6074.scala:5: error: constructor A in class A cannot be accessed in object T
def t = new A()
- ^
+ ^
one error found
diff --git a/test/files/neg/t6601.check b/test/files/neg/t6601.check
index b05c67ad9a..1410e1b11a 100644
--- a/test/files/neg/t6601.check
+++ b/test/files/neg/t6601.check
@@ -1,4 +1,4 @@
AccessPrivateConstructor_2.scala:2: error: constructor PrivateConstructor in class PrivateConstructor cannot be accessed in class AccessPrivateConstructor
new PrivateConstructor("") // Scalac should forbid accessing to the private constructor!
- ^
+ ^
one error found
diff --git a/test/files/neg/t6667b.check b/test/files/neg/t6667b.check
index a8705fa1c2..99cea9a47c 100644
--- a/test/files/neg/t6667b.check
+++ b/test/files/neg/t6667b.check
@@ -3,11 +3,11 @@ t6667b.scala:16: error: ambiguous implicit values:
and value b of type Test.Box
match expected type Test.Box
new Test()
- ^
+ ^
t6667b.scala:19: error: ambiguous implicit values:
both value a in object Test of type => Test.Box
and value b of type Test.Box
match expected type Test.Box
new Test()
- ^
+ ^
two errors found
diff --git a/test/files/neg/t7385.check b/test/files/neg/t7385.check
index c196ec0b4f..70d3c3fb61 100644
--- a/test/files/neg/t7385.check
+++ b/test/files/neg/t7385.check
@@ -1,7 +1,10 @@
-t7385.scala:2: error: parenthesized conditional expression expected
+t7385.scala:2: error: '(' expected but identifier found.
do { println("bippy") } while i<10
^
-t7385.scala:6: error: parenthesized conditional expression expected
+t7385.scala:6: error: '(' expected but identifier found.
while i<10 { () }
^
-two errors found
+t7385.scala:7: error: illegal start of simple expression
+}
+^
+three errors found
diff --git a/test/files/neg/t7473.check b/test/files/neg/t7473.check
index c686466a44..bc8c29d463 100644
--- a/test/files/neg/t7473.check
+++ b/test/files/neg/t7473.check
@@ -1,7 +1,7 @@
-t7473.scala:5: error: for comprehension must start with generator: '<-' expected but '=' found.
- for (x = Option(i); if x == j) yield 42 //t7473.scala:4: error: '<-' expected but '=' found.
- ^
-t7473.scala:8: error: for comprehension must start with generator: '<-' expected but '=' found.
+t7473.scala:6: error: '<-' expected but '=' found.
(for (x = Option(i); if x == j) yield 42) toList
^
+t7473.scala:6: error: illegal start of simple expression
+ (for (x = Option(i); if x == j) yield 42) toList
+ ^
two errors found
diff --git a/test/files/neg/t7473.scala b/test/files/neg/t7473.scala
index 1eb9e6cb7a..593231d5f2 100644
--- a/test/files/neg/t7473.scala
+++ b/test/files/neg/t7473.scala
@@ -1,9 +1,7 @@
object Foo {
val i,j = 3
-
- for (x = Option(i); if x == j) yield 42 //t7473.scala:4: error: '<-' expected but '=' found.
-
+ //for (x = Option(i); if x == j) yield 42 //t7473.scala:4: error: '<-' expected but '=' found.
// evil postfix!
(for (x = Option(i); if x == j) yield 42) toList
}
diff --git a/test/files/neg/t771.check b/test/files/neg/t771.check
index 51b0c97f8c..c0d1e002f8 100644
--- a/test/files/neg/t771.check
+++ b/test/files/neg/t771.check
@@ -1,4 +1,4 @@
t771.scala:4: error: trait Iterator is abstract; cannot be instantiated
def c[A](it:java.util.Iterator[A]) = new scala.Iterator[A]
- ^
+ ^
one error found
diff --git a/test/files/neg/t7848-interp-warn.check b/test/files/neg/t7848-interp-warn.check
new file mode 100644
index 0000000000..cbdc9f4c27
--- /dev/null
+++ b/test/files/neg/t7848-interp-warn.check
@@ -0,0 +1,9 @@
+t7848-interp-warn.scala:7: warning: `$foo` looks like an interpolated identifier! Did you forget the interpolator?
+ "An important $foo message!"
+ ^
+t7848-interp-warn.scala:11: warning: That looks like an interpolated expression! Did you forget the interpolator?
+ "A doubly important ${foo * 2} message!"
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+two warnings found
+one error found
diff --git a/test/files/neg/t7848-interp-warn.flags b/test/files/neg/t7848-interp-warn.flags
new file mode 100644
index 0000000000..7949c2afa2
--- /dev/null
+++ b/test/files/neg/t7848-interp-warn.flags
@@ -0,0 +1 @@
+-Xlint -Xfatal-warnings
diff --git a/test/files/neg/t7848-interp-warn.scala b/test/files/neg/t7848-interp-warn.scala
new file mode 100644
index 0000000000..bb3eeff60c
--- /dev/null
+++ b/test/files/neg/t7848-interp-warn.scala
@@ -0,0 +1,13 @@
+
+package test
+
+object Test {
+ def f = {
+ val foo = "bar"
+ "An important $foo message!"
+ }
+ def g = {
+ val foo = "bar"
+ "A doubly important ${foo * 2} message!"
+ }
+}
diff --git a/test/files/pos/t7854.scala b/test/files/pos/t7854.scala
deleted file mode 100644
index d4de7dfe38..0000000000
--- a/test/files/pos/t7854.scala
+++ /dev/null
@@ -1,5 +0,0 @@
-class A {
- var f: Int => Unit = _ => ()
-
- f = null
-}
diff --git a/test/files/pos/t7864.flags b/test/files/pos/t7864.flags
new file mode 100644
index 0000000000..7ccd56103a
--- /dev/null
+++ b/test/files/pos/t7864.flags
@@ -0,0 +1 @@
+-Xlint \ No newline at end of file
diff --git a/test/files/pos/t7864.scala b/test/files/pos/t7864.scala
new file mode 100644
index 0000000000..b2d8911a17
--- /dev/null
+++ b/test/files/pos/t7864.scala
@@ -0,0 +1,5 @@
+object Test {
+ val f = 0;
+ ({ toString; (x: Any) => x})("$f ")
+}
+
diff --git a/test/files/run/existential-rangepos.check b/test/files/run/existential-rangepos.check
index f426c6471f..1212b60bae 100644
--- a/test/files/run/existential-rangepos.check
+++ b/test/files/run/existential-rangepos.check
@@ -1,13 +1,13 @@
[[syntax trees at end of patmat]] // newSource1.scala
[0:76]package [0:0]<empty> {
- [15/0:76]abstract class A[[17:18]T[17:18]] extends [20:76][76]scala.AnyRef {
+ [0:76]abstract class A[[17:18]T[17:18]] extends [20:76][76]scala.AnyRef {
[76]def <init>(): [20]A[T] = [76]{
[76][76][76]A.super.<init>();
[20]()
};
- [28:51]private[this] val foo: [28]Set[_ <: T] = [47:51]null;
+ [24:51]private[this] val foo: [28]Set[_ <: T] = [47:51]null;
[28]<stable> <accessor> def foo: [28]Set[_ <: T] = [28][28]A.this.foo;
- [58:74]<stable> <accessor> def bar: [58]Set[_ <: T]
+ [54:74]<stable> <accessor> def bar: [58]Set[_ <: T]
}
}
diff --git a/test/files/run/position-val-def.check b/test/files/run/position-val-def.check
new file mode 100644
index 0000000000..a92c77c68c
--- /dev/null
+++ b/test/files/run/position-val-def.check
@@ -0,0 +1,30 @@
+val x = 0
+[0:9]val x = [8:9]0
+
+var x = 0
+[0:9]var x = [8:9]0
+
+val x, y = 0
+[NoPosition]{
+ [0:5]val x = [11]0;
+ [7:12]val y = [11:12]0;
+ [NoPosition]()
+}
+
+var x, y = 0
+[NoPosition]{
+ [0:5]var x = [11]0;
+ [7:12]var y = [11:12]0;
+ [NoPosition]()
+}
+
+val (x, y) = 0
+[NoPosition]{
+ <0:14><synthetic> <artifact> private[this] val x$1 = <4:14>[13:14][13:14]0: @[13]scala.unchecked match {
+ <4:10>case <4:10>[4]scala.Tuple2(<5:6>(x @ [5]_), <8:9>(y @ [8]_)) => <4:10><4:10>scala.Tuple2(<4:10>x, <4:10>y)
+ };
+ [5:6]val x = [5]x$1._1;
+ [8:9]val y = [8]x$1._2;
+ [NoPosition]()
+}
+
diff --git a/test/files/run/position-val-def.scala b/test/files/run/position-val-def.scala
new file mode 100644
index 0000000000..62cb54acf8
--- /dev/null
+++ b/test/files/run/position-val-def.scala
@@ -0,0 +1,26 @@
+import scala.reflect.runtime.universe._
+import scala.reflect.runtime.{universe => ru}
+import scala.reflect.runtime.{currentMirror => cm}
+import scala.tools.reflect.ToolBox
+
+object Test {
+ val toolbox = cm.mkToolBox(options = "-Yrangepos")
+
+ def main(args: Array[String]) {
+ def test(expr: String) {
+ val t = toolbox.parse(expr)
+ println(expr)
+ println(show(t, printPositions = true))
+ println()
+ }
+ val tests = """
+ val x = 0
+ var x = 0
+ val x, y = 0
+ var x, y = 0
+ val (x, y) = 0
+ """
+ val exprs = tests.split("\\n").map(_.trim).filterNot(_.isEmpty)
+ exprs foreach test
+ }
+}
diff --git a/test/files/run/t4742.flags b/test/files/run/t4742.flags
new file mode 100644
index 0000000000..ae08446055
--- /dev/null
+++ b/test/files/run/t4742.flags
@@ -0,0 +1 @@
+-Xcheckinit \ No newline at end of file
diff --git a/test/files/run/t4742.scala b/test/files/run/t4742.scala
new file mode 100644
index 0000000000..3b42c0c120
--- /dev/null
+++ b/test/files/run/t4742.scala
@@ -0,0 +1,7 @@
+trait T { val x: Int = 0 }
+object O extends T { override final val x = 1 }
+
+object Test extends App {
+ // was throwing an UnitializedFieldError as constant 1 is folded into the accessor
+ assert((O: T).x == 1)
+}
diff --git a/test/files/run/t5064.check b/test/files/run/t5064.check
index 7b92e40c35..61ccfd16e7 100644
--- a/test/files/run/t5064.check
+++ b/test/files/run/t5064.check
@@ -1,19 +1,19 @@
[53] T5064.super.<init>()
[53] T5064.super.<init>
[53] this
-[20/16:23] immutable.this.List.apply(scala.this.Predef.wrapIntArray(Array[Int]{1}))
+[16:23] immutable.this.List.apply(scala.this.Predef.wrapIntArray(Array[Int]{1}))
[16:20] immutable.this.List.apply
<16:20> immutable.this.List
<16:20> immutable.this
-[20/16:23] scala.this.Predef.wrapIntArray(Array[Int]{1})
+[16:23] scala.this.Predef.wrapIntArray(Array[Int]{1})
[20] scala.this.Predef.wrapIntArray
[20] scala.this.Predef
[20] scala.this
-[29/26:32] collection.this.Seq.apply(scala.this.Predef.wrapIntArray(Array[Int]{1}))
+[26:32] collection.this.Seq.apply(scala.this.Predef.wrapIntArray(Array[Int]{1}))
[26:29] collection.this.Seq.apply
<26:29> collection.this.Seq
<26:29> collection.this
-[29/26:32] scala.this.Predef.wrapIntArray(Array[Int]{1})
+[26:32] scala.this.Predef.wrapIntArray(Array[Int]{1})
[29] scala.this.Predef.wrapIntArray
[29] scala.this.Predef
[29] scala.this
diff --git a/test/files/run/t5385.check b/test/files/run/t5385.check
index f56464facd..1df74fcfb5 100644
--- a/test/files/run/t5385.check
+++ b/test/files/run/t5385.check
@@ -1,8 +1,8 @@
-[6/0:9] class Azz
-[6/0:9] class Bzz
-[6/0:9] class Czz
-[6/0:9] class Dzz
-[6/0:11] class Ezz
-[6/0:11] class Fzz
-[6/0:13] class Gzz
-[6/0:13] class Hzz
+[0:9] class Azz
+[0:9] class Bzz
+[0:9] class Czz
+[0:9] class Dzz
+[0:11] class Ezz
+[0:11] class Fzz
+[0:13] class Gzz
+[0:13] class Hzz
diff --git a/test/files/run/t5603.check b/test/files/run/t5603.check
index 46fcdd4470..188f39ff82 100644
--- a/test/files/run/t5603.check
+++ b/test/files/run/t5603.check
@@ -1,29 +1,29 @@
[[syntax trees at end of parser]] // newSource1.scala
[0:241]package [0:0]<empty> {
- [6/0:82]abstract trait Greeting extends [15:82][83]scala.AnyRef {
+ [0:82]abstract trait Greeting extends [15:82][83]scala.AnyRef {
[15]def $init$() = [15]{
[15]()
};
- [27:39]val name: [33:39]String;
- [50:76]val msg = [71/56:76][71/56:72][56:71]"How are you, ".$plus([72:76]name)
+ [23:39]val name: [33:39]String;
+ [46:76]val msg = [56:76][56:72][56:71]"How are you, ".$plus([72:76]name)
};
- [93/87:209]class C extends [94:209][151:159]Greeting {
- [123:139]val nameElse = _;
+ [87:209]class C extends [94:209][151:159]Greeting {
+ [119:139]val nameElse = _;
[95:101]<paramaccessor> private[this] val i: [98:101]Int = _;
- <123:139>def <init>([95]i: [98]Int) = <123:139>{
- <123:139>val nameElse = <134:139>"Bob";
- [X][X][X]super.<init>();
+ <119:139>def <init>([95]i: [98]Int) = <119:139>{
+ <119:139>val nameElse = <134:139>"Bob";
+ [NoPosition][NoPosition][NoPosition]super.<init>();
[94]()
};
- [172:184]val name = [179:184]"avc";
- [198/191:203][191:198]println([199:202]msg)
+ [168:184]val name = [179:184]"avc";
+ [191:203][191:198]println([199:202]msg)
};
- [222/215:241]object Test extends [227:241][235:238]App {
+ [215:241]object Test extends [227:241][235:238]App {
[227]def <init>() = [227]{
- [X][X][X]super.<init>();
+ [NoPosition][NoPosition][NoPosition]super.<init>();
[227]()
};
- [X]<empty>
+ [NoPosition]<empty>
}
}
diff --git a/test/files/run/t6288.check b/test/files/run/t6288.check
index 0da03c0439..a032a10de6 100644
--- a/test/files/run/t6288.check
+++ b/test/files/run/t6288.check
@@ -18,7 +18,7 @@
[64]case6(){
[64][64]matchEnd4([64]throw [64][64][64]new [64]MatchError([64]x1))
};
- [64]matchEnd4(x: [X]Unit){
+ [64]matchEnd4(x: [NoPosition]Unit){
[64]x
}
}
@@ -44,7 +44,7 @@
[175]case6(){
[175][175]matchEnd4([175]throw [175][175][175]new [175]MatchError([175]x1))
};
- [175]matchEnd4(x: [X]Unit){
+ [175]matchEnd4(x: [NoPosition]Unit){
[175]x
}
}
@@ -70,7 +70,7 @@
[273]case6(){
[273][273]matchEnd4([273]throw [273][273][273]new [273]MatchError([273]x1))
};
- [273]matchEnd4(x: [X]Unit){
+ [273]matchEnd4(x: [NoPosition]Unit){
[273]x
}
}
diff --git a/test/files/run/t6768.check b/test/files/run/t6768.check
deleted file mode 100644
index 64df4568ec..0000000000
--- a/test/files/run/t6768.check
+++ /dev/null
@@ -1,12 +0,0 @@
-[[syntax trees at end of typer]] // newSource1.scala
-[1:58]package [1:1]<empty> {
- [7/1:58]class A extends [9:58][58]scala.AnyRef {
- [58]def <init>(): [9]A = [58]{
- [58][58][58]A.super.<init>();
- [9]()
- };
- [17/13:31]def f1: [17]Some[String] = [26/22:31][22:26][22:26]scala.Some.apply[[22]String]([27:30]"a");
- [38/34:56]def f2: [38]Some[String] = [47/43:56][47:51][47:51]new [47:51]<type: [47:51]scala.Some>([52:55]"b")
- }
-}
-
diff --git a/test/files/run/t6768.scala b/test/files/run/t6768.scala
deleted file mode 100644
index 11470a0ef8..0000000000
--- a/test/files/run/t6768.scala
+++ /dev/null
@@ -1,12 +0,0 @@
-import scala.tools.partest._
-
-object Test extends DirectTest {
- override def extraSettings: String = "-usejavacp -Xprint:typer -Yrangepos -Xprint-pos -d " + testOutput.path
- override def show() = Console.withErr(System.out)(compile())
-
- override def code = """
-class A {
- def f1 = Some("a")
- def f2 = new Some("b")
-}"""
-}
diff --git a/test/files/run/t7271.check b/test/files/run/t7271.check
index 86b5230fd7..f7a23018ca 100644
--- a/test/files/run/t7271.check
+++ b/test/files/run/t7271.check
@@ -2,7 +2,7 @@
[6]package [6]<empty> {
[6]class C extends [8][91]scala.AnyRef {
[8]def <init>() = [8]{
- [X][X][X]super.<init>();
+ [NoPosition][NoPosition][NoPosition]super.<init>();
[8]()
};
[20]def quote = [28][28][28][28]StringContext([30]"foo", [40]"baz").s([35]this);
diff --git a/test/files/run/t7852.check b/test/files/run/t7852.check
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/files/run/t7852.check
diff --git a/test/files/run/t7852.flags b/test/files/run/t7852.flags
new file mode 100644
index 0000000000..f6262fd3e0
--- /dev/null
+++ b/test/files/run/t7852.flags
@@ -0,0 +1 @@
+-Ynooptimise
diff --git a/test/files/run/t7852.scala b/test/files/run/t7852.scala
new file mode 100644
index 0000000000..c93db718fd
--- /dev/null
+++ b/test/files/run/t7852.scala
@@ -0,0 +1,39 @@
+import scala.tools.partest.BytecodeTest
+import scala.tools.asm
+import scala.tools.asm.util._
+import scala.tools.nsc.util.stringFromWriter
+import scala.collection.JavaConverters._
+
+object Test extends BytecodeTest {
+ val nullChecks = Set(asm.Opcodes.IFNONNULL, asm.Opcodes.IFNULL)
+
+ def show: Unit = {
+ def test(methodName: String, expected: Int) {
+ val classNode = loadClassNode("Lean")
+ val methodNode = getMethod(classNode, methodName)
+ val got = countNullChecks(methodNode.instructions)
+ assert(got == expected, s"expected $expected but got $got comparisons")
+ }
+ test("string", expected = 0)
+ test("module", expected = 0)
+ test("moduleIndirect", expected = 2)
+ }
+
+ def countNullChecks(insnList: asm.tree.InsnList): Int =
+ insnList.iterator.asScala.map(_.getOpcode).count(nullChecks)
+}
+
+class Lean {
+ def string {
+ "" == toString
+ }
+
+ def module {
+ Nil == (toString: Any)
+ }
+
+ def moduleIndirect {
+ val n: Nil.type = null
+ n == (toString: Any) // still need null checks here.
+ }
+}
diff --git a/test/files/run/t7868.scala b/test/files/run/t7868.scala
new file mode 100644
index 0000000000..1f938adf31
--- /dev/null
+++ b/test/files/run/t7868.scala
@@ -0,0 +1,13 @@
+object A {
+ def unapply(n: Int): Option[Int] = Some(n)
+
+ def run = (0: Short) match {
+ case A(_) =>
+ case _ =>
+ }
+}
+
+
+object Test extends App {
+ A.run
+}
diff --git a/test/files/run/t7868b.check b/test/files/run/t7868b.check
new file mode 100644
index 0000000000..6577c4bc4e
--- /dev/null
+++ b/test/files/run/t7868b.check
@@ -0,0 +1,6 @@
+Expr[Int]({
+ val x = (0: Short): @unchecked match {
+ case A((x @ _)) => x
+ };
+ x
+})
diff --git a/test/files/run/t7868b.scala b/test/files/run/t7868b.scala
new file mode 100644
index 0000000000..759eeaf862
--- /dev/null
+++ b/test/files/run/t7868b.scala
@@ -0,0 +1,11 @@
+object A {
+ def unapply(n: Int): Option[Int] = Some(1)
+}
+
+object Test extends App {
+ import reflect.runtime.universe._
+ println(reify {
+ val A(x) = (0: Short)
+ x
+ })
+}
diff --git a/test/files/run/t7876.scala b/test/files/run/t7876.scala
new file mode 100644
index 0000000000..aeec8c8cce
--- /dev/null
+++ b/test/files/run/t7876.scala
@@ -0,0 +1,26 @@
+import scala.tools.partest._
+
+// Type constructors for FunctionN and TupleN should not be considered as function type / tuple types.
+object Test extends DirectTest {
+ override def extraSettings: String = "-usejavacp"
+
+ def code = ""
+
+ def show() {
+ val global = newCompiler()
+ new global.Run()
+ import global._, definitions._
+ val function0TC = FunctionClass(0).typeConstructor
+ val tuple1TC = TupleClass(1).typeConstructor
+ FunctionClass.seq.foreach { sym =>
+ val tc = sym.typeConstructor
+ assert(!isFunctionType(tc), s"$tc")
+ assert(!isFunctionTypeDirect(tc), s"$tc (direct)")
+ }
+ TupleClass.seq.foreach { sym =>
+ val tc = sym.typeConstructor
+ assert(!isTupleType(tc), s"$sym")
+ assert(!isTupleTypeDirect(tc), s"$tc (direct)")
+ }
+ }
+}
diff --git a/test/files/scalacheck/quasiquotes/TermConstructionProps.scala b/test/files/scalacheck/quasiquotes/TermConstructionProps.scala
index c6cca85c81..753ad1aa59 100644
--- a/test/files/scalacheck/quasiquotes/TermConstructionProps.scala
+++ b/test/files/scalacheck/quasiquotes/TermConstructionProps.scala
@@ -167,4 +167,28 @@ object TermConstructionProps extends QuasiquoteProperties("term construction") {
val x = q"val x: Int = 1"
assertThrows[IllegalArgumentException] { q"($x) => x" }
}
+
+ property("assign variable") = test {
+ val v = q"v"
+ val value = q"foo"
+ assertEqAst(q"$v = $value", "v = foo")
+ }
+
+ property("assign update 1") = test {
+ val v = q"v"
+ val args = q"1" :: q"2" :: Nil
+ val value = q"foo"
+ assertEqAst(q"$v(..$args) = $value", "v(1, 2) = foo")
+ }
+
+ property("assign update 2") = test {
+ val a = q"v(0)"
+ val value = q"foo"
+ assertEqAst(q"$a = $value", "v(0) = foo")
+ }
+
+ property("assign or named arg") = test {
+ val assignx = q"x = 1"
+ assertEqAst(q"f($assignx)", "f(x = 1)")
+ }
}
diff --git a/test/files/scalacheck/quasiquotes/TermDeconstructionProps.scala b/test/files/scalacheck/quasiquotes/TermDeconstructionProps.scala
index 45c7ee4bb7..22d4b1ce4f 100644
--- a/test/files/scalacheck/quasiquotes/TermDeconstructionProps.scala
+++ b/test/files/scalacheck/quasiquotes/TermDeconstructionProps.scala
@@ -91,4 +91,24 @@ object TermDeconstructionProps extends QuasiquoteProperties("term deconstruction
matches("new { val early = 1} with Parent[Int] { body }")
matches("new Foo { selfie => }")
}
+
+ property("exhaustive assign pattern") = test {
+ def matches(tree: Tree) { val q"$rhs = $lhs" = tree }
+ matches(parse("left = right"))
+ matches(parse("arr(1) = 2"))
+ matches(AssignOrNamedArg(EmptyTree, EmptyTree))
+ }
+
+ property("deconstruct update 1") = test {
+ val q"$obj(..$args) = $value" = q"foo(bar) = baz"
+ assert(obj ≈ q"foo")
+ assert(args ≈ List(q"bar"))
+ assert(value ≈ q"baz")
+ }
+
+ property("deconstruct update 2") = test {
+ val q"$left = $value" = q"foo(bar) = baz"
+ assert(left ≈ q"foo(bar)")
+ assert(value ≈ q"baz")
+ }
}
diff --git a/test/scaladoc/run/SI-4676.scala b/test/scaladoc/run/SI-4676.scala
index b83a59a472..99b3c5568a 100644
--- a/test/scaladoc/run/SI-4676.scala
+++ b/test/scaladoc/run/SI-4676.scala
@@ -21,6 +21,7 @@ object Test extends ScaladocModelTest {
// check correct expansion of the use case signature
val x = rootPackage._class("SI_4676")._method("x")
- assert(x.valueParams(0)(0).resultType.name == "(String, String)", "parameter ss of method x has type (String, String")
+ val resultType = x.valueParams(0)(0).resultType.name
+ assert(resultType == "SS", s"parameter ss of method x has type $resultType, expected SS!")
}
} \ No newline at end of file
diff --git a/test/scaladoc/run/t7876.check b/test/scaladoc/run/t7876.check
new file mode 100644
index 0000000000..619c56180b
--- /dev/null
+++ b/test/scaladoc/run/t7876.check
@@ -0,0 +1 @@
+Done.
diff --git a/test/scaladoc/run/t7876.scala b/test/scaladoc/run/t7876.scala
new file mode 100644
index 0000000000..63c63f8a0c
--- /dev/null
+++ b/test/scaladoc/run/t7876.scala
@@ -0,0 +1,19 @@
+import scala.tools.nsc.doc.model._
+import scala.tools.partest.ScaladocModelTest
+
+object Test extends ScaladocModelTest {
+
+ override def code = """
+ import language.higherKinds
+ trait T[M[_]]
+ class C extends T[Function0]
+ class D extends T[Tuple1]
+ """
+
+ def scaladocSettings = ""
+
+ def testModel(rootPackage: Package) = {
+ import access._
+ // did not crash
+ }
+}
diff --git a/test/scaladoc/run/t7876b.check b/test/scaladoc/run/t7876b.check
new file mode 100644
index 0000000000..21aaf3b295
--- /dev/null
+++ b/test/scaladoc/run/t7876b.check
@@ -0,0 +1,3 @@
+foo: FInt
+foo: TInt
+Done.
diff --git a/test/scaladoc/run/t7876b.scala b/test/scaladoc/run/t7876b.scala
new file mode 100644
index 0000000000..4d5b8c22cf
--- /dev/null
+++ b/test/scaladoc/run/t7876b.scala
@@ -0,0 +1,24 @@
+import scala.tools.nsc.doc.model._
+import scala.tools.partest.ScaladocModelTest
+
+// Don't dealias just to print a Function or Tuple type.
+object Test extends ScaladocModelTest {
+
+ override def code = """
+ class Test {
+ type FInt = Function0[Int]
+ type TInt = Tuple1[Int]
+ def foo: FInt
+ def bar: TInt
+ }
+ """
+
+ def scaladocSettings = ""
+
+ def testModel(rootPackage: Package) = {
+ import access._
+ List("foo", "bar").foreach { name =>
+ println("foo: " + rootPackage._class("Test")._method(name).resultType.name)
+ }
+ }
+}