summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--[-rwxr-xr-x]test/disabled/pos/t1545.scala0
-rw-r--r--[-rwxr-xr-x]test/files/bench/equality/eq.scala0
-rw-r--r--[-rwxr-xr-x]test/files/bench/equality/eqeq.scala0
-rw-r--r--test/files/jvm/interpreter.check6
-rw-r--r--test/files/jvm/throws-annot-from-java.check8
-rw-r--r--test/files/neg/name-lookup-stable.check2
-rw-r--r--test/files/neg/name-lookup-stable.scala2
-rw-r--r--[-rwxr-xr-x]test/files/neg/override.scala0
-rw-r--r--[-rwxr-xr-x]test/files/neg/t2336.scala0
-rw-r--r--[-rwxr-xr-x]test/files/neg/t2494.scala0
-rw-r--r--[-rwxr-xr-x]test/files/neg/t2773.scala0
-rw-r--r--[-rwxr-xr-x]test/files/neg/t2779.scala0
-rw-r--r--[-rwxr-xr-x]test/files/neg/t2870.scala0
-rw-r--r--[-rwxr-xr-x]test/files/neg/t2918.scala0
-rw-r--r--[-rwxr-xr-x]test/files/neg/t3006.scala0
-rw-r--r--[-rwxr-xr-x]test/files/neg/t3224.scala0
-rw-r--r--test/files/neg/t5376.scala2
-rw-r--r--[-rwxr-xr-x]test/files/neg/t6446-additional.check0
-rw-r--r--[-rwxr-xr-x]test/files/neg/t6446-list.check0
-rw-r--r--[-rwxr-xr-x]test/files/neg/t6446-missing.check0
-rw-r--r--test/files/neg/t6666d.check4
-rw-r--r--[-rwxr-xr-x]test/files/neg/t771.scala0
-rw-r--r--test/files/neg/t8597b.scala2
-rw-r--r--test/files/neg/t8675b.scala2
-rw-r--r--test/files/neg/virtpatmat_exhaust_compound.scala2
-rw-r--r--[-rwxr-xr-x]test/files/pos/lexical.scala0
-rw-r--r--[-rwxr-xr-x]test/files/pos/packageobjs.scala0
-rw-r--r--[-rwxr-xr-x]test/files/pos/spec-t6286.scala0
-rw-r--r--[-rwxr-xr-x]test/files/pos/t1459/AbstractBase.java0
-rw-r--r--[-rwxr-xr-x]test/files/pos/t1459/App.scala0
-rw-r--r--[-rwxr-xr-x]test/files/pos/t1459/Caller.java0
-rw-r--r--[-rwxr-xr-x]test/files/pos/t1722/Test.scala0
-rw-r--r--[-rwxr-xr-x]test/files/pos/t1722/Top.scala0
-rw-r--r--[-rwxr-xr-x]test/files/pos/t1756.scala0
-rw-r--r--[-rwxr-xr-x]test/files/pos/t2060.scala0
-rw-r--r--[-rwxr-xr-x]test/files/pos/t2082.scala0
-rw-r--r--[-rwxr-xr-x]test/files/pos/t2179.scala0
-rw-r--r--test/files/pos/t2405.scala4
-rw-r--r--[-rwxr-xr-x]test/files/pos/t2425.scala0
-rw-r--r--[-rwxr-xr-x]test/files/pos/t2429.scala0
-rw-r--r--[-rwxr-xr-x]test/files/pos/t2433/A.java0
-rw-r--r--[-rwxr-xr-x]test/files/pos/t2433/B.java0
-rw-r--r--[-rwxr-xr-x]test/files/pos/t2433/Test.scala0
-rw-r--r--[-rwxr-xr-x]test/files/pos/t2484.scala0
-rw-r--r--[-rwxr-xr-x]test/files/pos/t2504.scala0
-rw-r--r--[-rwxr-xr-x]test/files/pos/t2545.scala0
-rw-r--r--[-rwxr-xr-x]test/files/pos/t2635.scala0
-rw-r--r--[-rwxr-xr-x]test/files/pos/t2683.scala0
-rw-r--r--[-rwxr-xr-x]test/files/pos/t2913.scala0
-rw-r--r--[-rwxr-xr-x]test/files/pos/t2956/t2956.scala0
-rw-r--r--[-rwxr-xr-x]test/files/pos/t3174.scala0
-rw-r--r--[-rwxr-xr-x]test/files/pos/t3174b.scala0
-rw-r--r--[-rwxr-xr-x]test/files/pos/t3568.scala0
-rw-r--r--[-rwxr-xr-x]test/files/pos/t4553.scala0
-rw-r--r--test/files/pos/t6666d.scala (renamed from test/files/neg/t6666d.scala)0
-rw-r--r--test/files/pos/t8002-nested-scope.scala2
-rw-r--r--test/files/pos/t9369.flags1
-rw-r--r--test/files/pos/t9369.scala24
-rw-r--r--test/files/pos/t9370/sample_2.flags2
-rw-r--r--test/files/pos/t9442.scala14
-rw-r--r--test/files/pos/t9475.scala19
-rw-r--r--test/files/presentation/callcc-interpreter.check11
-rw-r--r--[-rwxr-xr-x]test/files/presentation/doc/doc.scala0
-rw-r--r--[-rwxr-xr-x]test/files/presentation/doc/src/Class.scala0
-rw-r--r--[-rwxr-xr-x]test/files/presentation/doc/src/p/Base.scala0
-rw-r--r--[-rwxr-xr-x]test/files/presentation/doc/src/p/Derived.scala0
-rw-r--r--test/files/run/class-symbol-contravariant.check8
-rw-r--r--test/files/run/constant-type.check8
-rw-r--r--test/files/run/constrained-types.check8
-rw-r--r--test/files/run/dead-code-elimination.scala2
-rw-r--r--test/files/run/idempotency-case-classes.check3
-rw-r--r--test/files/run/kind-repl-command.check2
-rw-r--r--[-rwxr-xr-x]test/files/run/list_map.scala0
-rw-r--r--test/files/run/names-defaults.scala2
-rw-r--r--test/files/run/nothingTypeNoOpt.scala2
-rw-r--r--test/files/run/reflection-fieldmirror-ctorparam.check6
-rw-r--r--test/files/run/reify-repl-fail-gracefully.check2
-rw-r--r--test/files/run/reify_newimpl_22.check2
-rw-r--r--test/files/run/reify_newimpl_23.check2
-rw-r--r--test/files/run/reify_newimpl_25.check2
-rw-r--r--test/files/run/reify_newimpl_26.check2
-rw-r--r--test/files/run/repl-bare-expr.check12
-rw-r--r--test/files/run/repl-parens.check12
-rw-r--r--test/files/run/repl-paste-2.check4
-rw-r--r--test/files/run/repl-power.check11
-rw-r--r--test/files/run/repl-power.scala5
-rw-r--r--test/files/run/repl-reset.check8
-rw-r--r--test/files/run/repl-serialization.check1
-rw-r--r--test/files/run/repl-transcript.check2
-rw-r--r--test/files/run/repl-trim-stack-trace.scala6
-rw-r--r--test/files/run/t1931.scala43
-rw-r--r--[-rwxr-xr-x]test/files/run/t2127.scala0
-rw-r--r--[-rwxr-xr-x]test/files/run/t2503.scala0
-rw-r--r--[-rwxr-xr-x]test/files/run/t3026.scala0
-rw-r--r--test/files/run/t4542.check2
-rw-r--r--test/files/run/t4594-repl-settings.scala2
-rw-r--r--test/files/run/t4658.check7
-rw-r--r--test/files/run/t4658.scala11
-rw-r--r--test/files/run/t5655.check4
-rw-r--r--[-rwxr-xr-x]test/files/run/t5699.check0
-rw-r--r--[-rwxr-xr-x]test/files/run/t5699.scala0
-rw-r--r--[-rwxr-xr-x]test/files/run/t5717.scala0
-rw-r--r--test/files/run/t6146b.check8
-rw-r--r--test/files/run/t6439.check8
-rw-r--r--[-rwxr-xr-x]test/files/run/t7246.check0
-rw-r--r--[-rwxr-xr-x]test/files/run/t7246/Outer.java0
-rw-r--r--[-rwxr-xr-x]test/files/run/t7246/Test.scala0
-rw-r--r--[-rwxr-xr-x]test/files/run/t7246b.check0
-rw-r--r--[-rwxr-xr-x]test/files/run/t7246b/Base.scala0
-rw-r--r--[-rwxr-xr-x]test/files/run/t7246b/Outer.java0
-rw-r--r--[-rwxr-xr-x]test/files/run/t7246b/Test.scala0
-rw-r--r--test/files/run/t7319.check6
-rw-r--r--[-rwxr-xr-x]test/files/run/t7341.flags0
-rw-r--r--[-rwxr-xr-x]test/files/run/t7341.scala0
-rw-r--r--test/files/run/t7747-repl.check40
-rw-r--r--test/files/run/t8047.scala2
-rw-r--r--test/files/run/t8346.check6
-rw-r--r--test/files/run/t8346.scala34
-rw-r--r--test/files/run/t9170.scala24
-rw-r--r--test/files/run/t9206.scala4
-rw-r--r--test/files/run/t9375.check60
-rw-r--r--test/files/run/t9375.scala279
-rw-r--r--test/files/run/t9388-bin-compat.scala16
-rw-r--r--test/files/run/t9425.scala8
-rw-r--r--test/files/run/toolbox_expand_macro.check1
-rw-r--r--test/files/run/toolbox_expand_macro.scala23
-rw-r--r--test/files/run/tpeCache-tyconCache.check8
-rw-r--r--[-rwxr-xr-x]test/files/run/viewtest.scala0
-rw-r--r--[-rwxr-xr-x]test/files/run/weakconform.scala0
-rw-r--r--test/files/run/xMigration.check6
-rw-r--r--test/files/scalacheck/range.scala17
-rw-r--r--test/junit/scala/collection/immutable/PagedSeqTest.scala6
-rw-r--r--test/junit/scala/collection/immutable/RangeConsistencyTest.scala24
-rw-r--r--test/junit/scala/collection/immutable/SetTests.scala81
-rw-r--r--test/junit/scala/tools/nsc/backend/jvm/analysis/ProdConsAnalyzerTest.scala2
-rw-r--r--test/junit/scala/tools/nsc/interpreter/CompletionTest.scala180
-rwxr-xr-xtest/partest1
-rwxr-xr-xtest/partest.bat104
-rw-r--r--[-rwxr-xr-x]test/pending/run/t3609.scala0
-rw-r--r--[-rwxr-xr-x]test/scaladoc/run/SI-191.check0
-rw-r--r--[-rwxr-xr-x]test/scaladoc/run/SI-191.scala0
-rw-r--r--[-rwxr-xr-x]test/scaladoc/run/SI-7367.check0
-rw-r--r--[-rwxr-xr-x]test/scaladoc/run/SI-7367.scala0
-rw-r--r--[-rwxr-xr-x]test/scaladoc/run/SI-8479.scala0
-rw-r--r--[-rwxr-xr-x]test/script-tests/README0
145 files changed, 945 insertions, 291 deletions
diff --git a/test/disabled/pos/t1545.scala b/test/disabled/pos/t1545.scala
index 4c5908b8a1..4c5908b8a1 100755..100644
--- a/test/disabled/pos/t1545.scala
+++ b/test/disabled/pos/t1545.scala
diff --git a/test/files/bench/equality/eq.scala b/test/files/bench/equality/eq.scala
index 8ac5b5ef5c..8ac5b5ef5c 100755..100644
--- a/test/files/bench/equality/eq.scala
+++ b/test/files/bench/equality/eq.scala
diff --git a/test/files/bench/equality/eqeq.scala b/test/files/bench/equality/eqeq.scala
index afccece88a..afccece88a 100755..100644
--- a/test/files/bench/equality/eqeq.scala
+++ b/test/files/bench/equality/eqeq.scala
diff --git a/test/files/jvm/interpreter.check b/test/files/jvm/interpreter.check
index 08372685d6..ce3c8062d7 100644
--- a/test/files/jvm/interpreter.check
+++ b/test/files/jvm/interpreter.check
@@ -30,7 +30,7 @@ scala> val four: anotherint = 4
four: anotherint = 4
scala> val bogus: anotherint = "hello"
-<console>:11: error: type mismatch;
+<console>:12: error: type mismatch;
found : String("hello")
required: anotherint
(which expands to) Int
@@ -353,7 +353,7 @@ defined class Term
scala> def f(e: Exp) = e match { // non-exhaustive warning here
case _:Fact => 3
}
-<console>:21: warning: match may not be exhaustive.
+<console>:22: warning: match may not be exhaustive.
It would fail on the following inputs: Exp(), Term()
def f(e: Exp) = e match { // non-exhaustive warning here
^
@@ -363,6 +363,6 @@ scala> :quit
plusOne: (x: Int)Int
res0: Int = 6
res0: String = after reset
-<console>:11: error: not found: value plusOne
+<console>:12: error: not found: value plusOne
plusOne(5) // should be undefined now
^
diff --git a/test/files/jvm/throws-annot-from-java.check b/test/files/jvm/throws-annot-from-java.check
index ace264a4f5..bf639260e7 100644
--- a/test/files/jvm/throws-annot-from-java.check
+++ b/test/files/jvm/throws-annot-from-java.check
@@ -1,10 +1,8 @@
scala> :power
-** Power User mode enabled - BEEP WHIR GYVE **
-** :phase has been set to 'typer'. **
-** scala.tools.nsc._ has been imported **
-** global._, definitions._ also imported **
-** Try :help, :vals, power.<tab> **
+Power mode enabled. :phase is at typer.
+import scala.tools.nsc._, intp.global._, definitions._
+Try :help or completions for vals._ and power._
scala> :paste
// Entering paste mode (ctrl-D to finish)
diff --git a/test/files/neg/name-lookup-stable.check b/test/files/neg/name-lookup-stable.check
index 751df9505e..68d98c4162 100644
--- a/test/files/neg/name-lookup-stable.check
+++ b/test/files/neg/name-lookup-stable.check
@@ -6,6 +6,6 @@ import ColumnOption._
name-lookup-stable.scala:17: error: reference to PrimaryKey is ambiguous;
it is both defined in class A and imported subsequently by
import ColumnOption._
- PrimaryKey // was already ambigious in 2.10.3
+ PrimaryKey // was already ambiguous in 2.10.3
^
two errors found
diff --git a/test/files/neg/name-lookup-stable.scala b/test/files/neg/name-lookup-stable.scala
index 0d862f06e1..2941e05875 100644
--- a/test/files/neg/name-lookup-stable.scala
+++ b/test/files/neg/name-lookup-stable.scala
@@ -14,7 +14,7 @@ class A {
(null: Any) match { case PrimaryKey => }
- PrimaryKey // was already ambigious in 2.10.3
+ PrimaryKey // was already ambiguous in 2.10.3
}
}
diff --git a/test/files/neg/override.scala b/test/files/neg/override.scala
index 7975516061..7975516061 100755..100644
--- a/test/files/neg/override.scala
+++ b/test/files/neg/override.scala
diff --git a/test/files/neg/t2336.scala b/test/files/neg/t2336.scala
index 4cea02b721..4cea02b721 100755..100644
--- a/test/files/neg/t2336.scala
+++ b/test/files/neg/t2336.scala
diff --git a/test/files/neg/t2494.scala b/test/files/neg/t2494.scala
index 71e6bc4bbf..71e6bc4bbf 100755..100644
--- a/test/files/neg/t2494.scala
+++ b/test/files/neg/t2494.scala
diff --git a/test/files/neg/t2773.scala b/test/files/neg/t2773.scala
index aaa6351c83..aaa6351c83 100755..100644
--- a/test/files/neg/t2773.scala
+++ b/test/files/neg/t2773.scala
diff --git a/test/files/neg/t2779.scala b/test/files/neg/t2779.scala
index d025055aa0..d025055aa0 100755..100644
--- a/test/files/neg/t2779.scala
+++ b/test/files/neg/t2779.scala
diff --git a/test/files/neg/t2870.scala b/test/files/neg/t2870.scala
index 4de19242e3..4de19242e3 100755..100644
--- a/test/files/neg/t2870.scala
+++ b/test/files/neg/t2870.scala
diff --git a/test/files/neg/t2918.scala b/test/files/neg/t2918.scala
index ff2be39ae0..ff2be39ae0 100755..100644
--- a/test/files/neg/t2918.scala
+++ b/test/files/neg/t2918.scala
diff --git a/test/files/neg/t3006.scala b/test/files/neg/t3006.scala
index a84b69c842..a84b69c842 100755..100644
--- a/test/files/neg/t3006.scala
+++ b/test/files/neg/t3006.scala
diff --git a/test/files/neg/t3224.scala b/test/files/neg/t3224.scala
index b7af8a67b5..b7af8a67b5 100755..100644
--- a/test/files/neg/t3224.scala
+++ b/test/files/neg/t3224.scala
diff --git a/test/files/neg/t5376.scala b/test/files/neg/t5376.scala
index 8da3868566..b1ba41bd54 100644
--- a/test/files/neg/t5376.scala
+++ b/test/files/neg/t5376.scala
@@ -12,7 +12,7 @@ object Test {
"a": Int
}
- // Import one implict and one non-implicit method with the
+ // Import one implicit and one non-implicit method with the
// same name in the same scope.
def m2 = {
import O1._
diff --git a/test/files/neg/t6446-additional.check b/test/files/neg/t6446-additional.check
index a87af2f1e5..a87af2f1e5 100755..100644
--- a/test/files/neg/t6446-additional.check
+++ b/test/files/neg/t6446-additional.check
diff --git a/test/files/neg/t6446-list.check b/test/files/neg/t6446-list.check
index fa5c581941..fa5c581941 100755..100644
--- a/test/files/neg/t6446-list.check
+++ b/test/files/neg/t6446-list.check
diff --git a/test/files/neg/t6446-missing.check b/test/files/neg/t6446-missing.check
index 029c8057c3..029c8057c3 100755..100644
--- a/test/files/neg/t6446-missing.check
+++ b/test/files/neg/t6446-missing.check
diff --git a/test/files/neg/t6666d.check b/test/files/neg/t6666d.check
deleted file mode 100644
index b4785f0129..0000000000
--- a/test/files/neg/t6666d.check
+++ /dev/null
@@ -1,4 +0,0 @@
-t6666d.scala:7: error: Implementation restriction: access of object TreeOrd$1 from object TreeOrd$2, would require illegal premature access to the unconstructed `this` of class Test
- implicit object TreeOrd extends Ordering[K](){
- ^
-one error found
diff --git a/test/files/neg/t771.scala b/test/files/neg/t771.scala
index 26bf441648..26bf441648 100755..100644
--- a/test/files/neg/t771.scala
+++ b/test/files/neg/t771.scala
diff --git a/test/files/neg/t8597b.scala b/test/files/neg/t8597b.scala
index b29d591cb1..cbf0bf1c5a 100644
--- a/test/files/neg/t8597b.scala
+++ b/test/files/neg/t8597b.scala
@@ -4,7 +4,7 @@ object Unchecked {
// t is a fresh pattern type variable, despite our attempts to
// backtick our way to the enclosing `t`. Under this interpretation,
- // the absense of an unchecked warning is expected.
+ // the absence of an unchecked warning is expected.
(null: Any) match {
case _: Some[t] => // no warn
}
diff --git a/test/files/neg/t8675b.scala b/test/files/neg/t8675b.scala
index bffed2141c..b2212fa234 100644
--- a/test/files/neg/t8675b.scala
+++ b/test/files/neg/t8675b.scala
@@ -9,7 +9,7 @@ object Test {
}
trait Reportable1[Params, R]
- // "missing paramater type" error was swallowed in 2.11.0 leading to a crash
+ // "missing parameter type" error was swallowed in 2.11.0 leading to a crash
// in the backend.
//
// This error is itself a regression (or at least a change) in 2.11.0-M7,
diff --git a/test/files/neg/virtpatmat_exhaust_compound.scala b/test/files/neg/virtpatmat_exhaust_compound.scala
index 386c7af98d..4ff04dd06a 100644
--- a/test/files/neg/virtpatmat_exhaust_compound.scala
+++ b/test/files/neg/virtpatmat_exhaust_compound.scala
@@ -10,7 +10,7 @@ case object O3 extends Base2
case object O4 extends Base with Base2
object Test {
- val a /*: Product with Serialiable with Base */ = if (true) O1 else O2
+ val a /*: Product with Serializable with Base */ = if (true) O1 else O2
a match {
case null =>
}
diff --git a/test/files/pos/lexical.scala b/test/files/pos/lexical.scala
index 8c29513bb5..8c29513bb5 100755..100644
--- a/test/files/pos/lexical.scala
+++ b/test/files/pos/lexical.scala
diff --git a/test/files/pos/packageobjs.scala b/test/files/pos/packageobjs.scala
index ccab133716..ccab133716 100755..100644
--- a/test/files/pos/packageobjs.scala
+++ b/test/files/pos/packageobjs.scala
diff --git a/test/files/pos/spec-t6286.scala b/test/files/pos/spec-t6286.scala
index 4d87998ec6..4d87998ec6 100755..100644
--- a/test/files/pos/spec-t6286.scala
+++ b/test/files/pos/spec-t6286.scala
diff --git a/test/files/pos/t1459/AbstractBase.java b/test/files/pos/t1459/AbstractBase.java
index 492419416c..492419416c 100755..100644
--- a/test/files/pos/t1459/AbstractBase.java
+++ b/test/files/pos/t1459/AbstractBase.java
diff --git a/test/files/pos/t1459/App.scala b/test/files/pos/t1459/App.scala
index 36e5022e94..36e5022e94 100755..100644
--- a/test/files/pos/t1459/App.scala
+++ b/test/files/pos/t1459/App.scala
diff --git a/test/files/pos/t1459/Caller.java b/test/files/pos/t1459/Caller.java
index 4ae51d8c57..4ae51d8c57 100755..100644
--- a/test/files/pos/t1459/Caller.java
+++ b/test/files/pos/t1459/Caller.java
diff --git a/test/files/pos/t1722/Test.scala b/test/files/pos/t1722/Test.scala
index f236d3fdc4..f236d3fdc4 100755..100644
--- a/test/files/pos/t1722/Test.scala
+++ b/test/files/pos/t1722/Test.scala
diff --git a/test/files/pos/t1722/Top.scala b/test/files/pos/t1722/Top.scala
index 4ac52412aa..4ac52412aa 100755..100644
--- a/test/files/pos/t1722/Top.scala
+++ b/test/files/pos/t1722/Top.scala
diff --git a/test/files/pos/t1756.scala b/test/files/pos/t1756.scala
index 1d067c3b04..1d067c3b04 100755..100644
--- a/test/files/pos/t1756.scala
+++ b/test/files/pos/t1756.scala
diff --git a/test/files/pos/t2060.scala b/test/files/pos/t2060.scala
index 2c701150e4..2c701150e4 100755..100644
--- a/test/files/pos/t2060.scala
+++ b/test/files/pos/t2060.scala
diff --git a/test/files/pos/t2082.scala b/test/files/pos/t2082.scala
index 3a160612fe..3a160612fe 100755..100644
--- a/test/files/pos/t2082.scala
+++ b/test/files/pos/t2082.scala
diff --git a/test/files/pos/t2179.scala b/test/files/pos/t2179.scala
index 89e22b6e2a..89e22b6e2a 100755..100644
--- a/test/files/pos/t2179.scala
+++ b/test/files/pos/t2179.scala
diff --git a/test/files/pos/t2405.scala b/test/files/pos/t2405.scala
index 224b2ce83b..0bc7a771b2 100644
--- a/test/files/pos/t2405.scala
+++ b/test/files/pos/t2405.scala
@@ -6,14 +6,14 @@ object Test1 {
implicitly[Int]
}
-// Testing for the absense of shadowing #1.
+// Testing for the absence of shadowing #1.
object Test2 {
import A.{x => y}
val x = 2
implicitly[Int]
}
-// Testing for the absense of shadowing #2.
+// Testing for the absence of shadowing #2.
object Test3 {
{
import A.{x => y}
diff --git a/test/files/pos/t2425.scala b/test/files/pos/t2425.scala
index 477d5467aa..477d5467aa 100755..100644
--- a/test/files/pos/t2425.scala
+++ b/test/files/pos/t2425.scala
diff --git a/test/files/pos/t2429.scala b/test/files/pos/t2429.scala
index 550681b6a2..550681b6a2 100755..100644
--- a/test/files/pos/t2429.scala
+++ b/test/files/pos/t2429.scala
diff --git a/test/files/pos/t2433/A.java b/test/files/pos/t2433/A.java
index 340690c402..340690c402 100755..100644
--- a/test/files/pos/t2433/A.java
+++ b/test/files/pos/t2433/A.java
diff --git a/test/files/pos/t2433/B.java b/test/files/pos/t2433/B.java
index 151dd71ca1..151dd71ca1 100755..100644
--- a/test/files/pos/t2433/B.java
+++ b/test/files/pos/t2433/B.java
diff --git a/test/files/pos/t2433/Test.scala b/test/files/pos/t2433/Test.scala
index 02fd89b646..02fd89b646 100755..100644
--- a/test/files/pos/t2433/Test.scala
+++ b/test/files/pos/t2433/Test.scala
diff --git a/test/files/pos/t2484.scala b/test/files/pos/t2484.scala
index 88da6aaac8..88da6aaac8 100755..100644
--- a/test/files/pos/t2484.scala
+++ b/test/files/pos/t2484.scala
diff --git a/test/files/pos/t2504.scala b/test/files/pos/t2504.scala
index 67f8226852..67f8226852 100755..100644
--- a/test/files/pos/t2504.scala
+++ b/test/files/pos/t2504.scala
diff --git a/test/files/pos/t2545.scala b/test/files/pos/t2545.scala
index 6ad994223c..6ad994223c 100755..100644
--- a/test/files/pos/t2545.scala
+++ b/test/files/pos/t2545.scala
diff --git a/test/files/pos/t2635.scala b/test/files/pos/t2635.scala
index 7cd5531356..7cd5531356 100755..100644
--- a/test/files/pos/t2635.scala
+++ b/test/files/pos/t2635.scala
diff --git a/test/files/pos/t2683.scala b/test/files/pos/t2683.scala
index 4ba34b554a..4ba34b554a 100755..100644
--- a/test/files/pos/t2683.scala
+++ b/test/files/pos/t2683.scala
diff --git a/test/files/pos/t2913.scala b/test/files/pos/t2913.scala
index 11d8b92053..11d8b92053 100755..100644
--- a/test/files/pos/t2913.scala
+++ b/test/files/pos/t2913.scala
diff --git a/test/files/pos/t2956/t2956.scala b/test/files/pos/t2956/t2956.scala
index eb6e817465..eb6e817465 100755..100644
--- a/test/files/pos/t2956/t2956.scala
+++ b/test/files/pos/t2956/t2956.scala
diff --git a/test/files/pos/t3174.scala b/test/files/pos/t3174.scala
index c3d90a4946..c3d90a4946 100755..100644
--- a/test/files/pos/t3174.scala
+++ b/test/files/pos/t3174.scala
diff --git a/test/files/pos/t3174b.scala b/test/files/pos/t3174b.scala
index 4df1bfe837..4df1bfe837 100755..100644
--- a/test/files/pos/t3174b.scala
+++ b/test/files/pos/t3174b.scala
diff --git a/test/files/pos/t3568.scala b/test/files/pos/t3568.scala
index c8e3fcc4be..c8e3fcc4be 100755..100644
--- a/test/files/pos/t3568.scala
+++ b/test/files/pos/t3568.scala
diff --git a/test/files/pos/t4553.scala b/test/files/pos/t4553.scala
index 4eefe57b2b..4eefe57b2b 100755..100644
--- a/test/files/pos/t4553.scala
+++ b/test/files/pos/t4553.scala
diff --git a/test/files/neg/t6666d.scala b/test/files/pos/t6666d.scala
index 49a688f91b..49a688f91b 100644
--- a/test/files/neg/t6666d.scala
+++ b/test/files/pos/t6666d.scala
diff --git a/test/files/pos/t8002-nested-scope.scala b/test/files/pos/t8002-nested-scope.scala
index a2088bce7a..8ce809e556 100644
--- a/test/files/pos/t8002-nested-scope.scala
+++ b/test/files/pos/t8002-nested-scope.scala
@@ -1,5 +1,5 @@
// This test serves to capture the status quo, but should really
-// emit an accessibiltiy error.
+// emit an accessibility error.
// `Namers#companionSymbolOf` seems too lenient, and currently doesn't
// implement the same-scope checks mentioned:
diff --git a/test/files/pos/t9369.flags b/test/files/pos/t9369.flags
new file mode 100644
index 0000000000..b5a8748652
--- /dev/null
+++ b/test/files/pos/t9369.flags
@@ -0,0 +1 @@
+-Xfatal-warnings -unchecked
diff --git a/test/files/pos/t9369.scala b/test/files/pos/t9369.scala
new file mode 100644
index 0000000000..94be2ea4e7
--- /dev/null
+++ b/test/files/pos/t9369.scala
@@ -0,0 +1,24 @@
+object Test {
+
+ trait Tree
+
+ sealed abstract class Prop
+
+ trait Simple extends Prop
+
+ case class Atom(tree: Tree) extends Prop with Simple
+
+ case class Not(prop: Prop) extends Prop with Simple
+
+ def simplify1(prop: Prop): Prop = prop match {
+ case Atom(tree) => ???
+ case Not(prop) => ???
+ case _ => ???
+ }
+
+ def simplify2(prop: Prop): Prop = prop match {
+ case Not(Atom(tree)) => ???
+ case Not(Not(prop)) => ???
+ case _ => ???
+ }
+} \ No newline at end of file
diff --git a/test/files/pos/t9370/sample_2.flags b/test/files/pos/t9370/sample_2.flags
index 03baca3030..dd7eb55d33 100644
--- a/test/files/pos/t9370/sample_2.flags
+++ b/test/files/pos/t9370/sample_2.flags
@@ -1 +1 @@
--Xplugin:/tmp:. -Xplugin-require:timebomb -Ystop-after:parser
+-Xplugin:/tmp -Xplugin:. -Xplugin-require:timebomb -Ystop-after:parser
diff --git a/test/files/pos/t9442.scala b/test/files/pos/t9442.scala
new file mode 100644
index 0000000000..2ea81e79cb
--- /dev/null
+++ b/test/files/pos/t9442.scala
@@ -0,0 +1,14 @@
+trait Ctx {
+ trait Tree
+}
+trait Lst[+A] {
+ def zip[A1 >: A, B](that: Lst[B]): Nothing
+}
+class C[@specialized(Int) T] {
+ def moo(t: T) = {
+ def foo1(c: Ctx)(l: Lst[c.Tree]) = l zip l
+ def foo2(c: Ctx)(l: Lst[c.Tree]*) = l(0) zip l(1)
+ def foo3(c: Ctx)(l: => Lst[c.Tree]) = l zip l
+ ???
+ }
+}
diff --git a/test/files/pos/t9475.scala b/test/files/pos/t9475.scala
new file mode 100644
index 0000000000..ce9c250ace
--- /dev/null
+++ b/test/files/pos/t9475.scala
@@ -0,0 +1,19 @@
+trait Ctx {
+ trait Tree
+}
+
+trait Lst[+A] {
+ def zip[A1 >: A, B](that: Lst[B]): Nothing
+}
+
+object Test {
+
+ // both of these methods should be transformed by uncurry
+ // such that List[c.Tree] becomes List[Ctx#Tree]:
+ def foo1(c: Ctx)(l: Lst[c.Tree]) = l zip l
+ def foo2[@specialized T](c: Ctx)(l: Lst[c.Tree], t: T) = l zip l
+
+ // if this doesn't happen for the 2nd method, the specialization
+ // transformation fails
+}
+
diff --git a/test/files/presentation/callcc-interpreter.check b/test/files/presentation/callcc-interpreter.check
index 4bf68b3d4e..94a3d64d68 100644
--- a/test/files/presentation/callcc-interpreter.check
+++ b/test/files/presentation/callcc-interpreter.check
@@ -3,7 +3,7 @@ reload: CallccInterpreter.scala
askTypeCompletion at CallccInterpreter.scala(51,34)
================================================================================
[response] askTypeCompletion at (51,34)
-retrieved 57 members
+retrieved 66 members
abstract trait Term extends AnyRef
abstract trait Value extends AnyRef
case class Add extends callccInterpreter.Term with Product with Serializable
@@ -50,6 +50,15 @@ final def synchronized[T0](x$1: T0): T0
final def wait(): Unit
final def wait(x$1: Long): Unit
final def wait(x$1: Long,x$2: Int): Unit
+object Add
+object App
+object Ccc
+object Con
+object Fun
+object Lam
+object M
+object Num
+object Var
private[this] val term0: callccInterpreter.App
private[this] val term1: callccInterpreter.App
private[this] val term2: callccInterpreter.Add
diff --git a/test/files/presentation/doc/doc.scala b/test/files/presentation/doc/doc.scala
index f2233f1828..f2233f1828 100755..100644
--- a/test/files/presentation/doc/doc.scala
+++ b/test/files/presentation/doc/doc.scala
diff --git a/test/files/presentation/doc/src/Class.scala b/test/files/presentation/doc/src/Class.scala
index a974bd6f5c..a974bd6f5c 100755..100644
--- a/test/files/presentation/doc/src/Class.scala
+++ b/test/files/presentation/doc/src/Class.scala
diff --git a/test/files/presentation/doc/src/p/Base.scala b/test/files/presentation/doc/src/p/Base.scala
index d91632b6f6..d91632b6f6 100755..100644
--- a/test/files/presentation/doc/src/p/Base.scala
+++ b/test/files/presentation/doc/src/p/Base.scala
diff --git a/test/files/presentation/doc/src/p/Derived.scala b/test/files/presentation/doc/src/p/Derived.scala
index 1a9c9a26d1..1a9c9a26d1 100755..100644
--- a/test/files/presentation/doc/src/p/Derived.scala
+++ b/test/files/presentation/doc/src/p/Derived.scala
diff --git a/test/files/run/class-symbol-contravariant.check b/test/files/run/class-symbol-contravariant.check
index 1d95273b50..5166fce96a 100644
--- a/test/files/run/class-symbol-contravariant.check
+++ b/test/files/run/class-symbol-contravariant.check
@@ -1,10 +1,8 @@
scala> :power
-** Power User mode enabled - BEEP WHIR GYVE **
-** :phase has been set to 'typer'. **
-** scala.tools.nsc._ has been imported **
-** global._, definitions._ also imported **
-** Try :help, :vals, power.<tab> **
+Power mode enabled. :phase is at typer.
+import scala.tools.nsc._, intp.global._, definitions._
+Try :help or completions for vals._ and power._
scala> val u = rootMirror.universe
u: $r.intp.global.type = <global>
diff --git a/test/files/run/constant-type.check b/test/files/run/constant-type.check
index b92f1481a3..9df1353354 100644
--- a/test/files/run/constant-type.check
+++ b/test/files/run/constant-type.check
@@ -1,10 +1,8 @@
scala> :power
-** Power User mode enabled - BEEP WHIR GYVE **
-** :phase has been set to 'typer'. **
-** scala.tools.nsc._ has been imported **
-** global._, definitions._ also imported **
-** Try :help, :vals, power.<tab> **
+Power mode enabled. :phase is at typer.
+import scala.tools.nsc._, intp.global._, definitions._
+Try :help or completions for vals._ and power._
scala> val s = transformedType(StringClass.toType).asInstanceOf[Type]
s: $r.intp.global.Type = String
diff --git a/test/files/run/constrained-types.check b/test/files/run/constrained-types.check
index 670d6f49aa..5444cf2088 100644
--- a/test/files/run/constrained-types.check
+++ b/test/files/run/constrained-types.check
@@ -133,16 +133,16 @@ y: String = hello
scala>
scala> val x = 3 : Int @Annot(e+f+g+h) // should have a graceful error message
-<console>:11: error: not found: value e
+<console>:12: error: not found: value e
val x = 3 : Int @Annot(e+f+g+h) // should have a graceful error message
^
-<console>:11: error: not found: value f
+<console>:12: error: not found: value f
val x = 3 : Int @Annot(e+f+g+h) // should have a graceful error message
^
-<console>:11: error: not found: value g
+<console>:12: error: not found: value g
val x = 3 : Int @Annot(e+f+g+h) // should have a graceful error message
^
-<console>:11: error: not found: value h
+<console>:12: error: not found: value h
val x = 3 : Int @Annot(e+f+g+h) // should have a graceful error message
^
diff --git a/test/files/run/dead-code-elimination.scala b/test/files/run/dead-code-elimination.scala
index fd3f2a996a..2291b22f7a 100644
--- a/test/files/run/dead-code-elimination.scala
+++ b/test/files/run/dead-code-elimination.scala
@@ -10,7 +10,7 @@
// the stack after code elimination.
//
// Originally, this did not compile, but I included it in the run
-// tests because this was ASM-dependand and did not happen for GenJVM.
+// tests because this was ASM-dependent and did not happen for GenJVM.
//
// Thus, we run the code and force the loading of class B -- if the
// bytecode is incorrect, it will fail the test.
diff --git a/test/files/run/idempotency-case-classes.check b/test/files/run/idempotency-case-classes.check
index 5a8d0ad9d3..ea698cec59 100644
--- a/test/files/run/idempotency-case-classes.check
+++ b/test/files/run/idempotency-case-classes.check
@@ -47,8 +47,7 @@ C(2,3)
case <synthetic> def unapply(x$0: C): Option[(Int, Int)] = if (x$0.==(null))
scala.this.None
else
- Some.apply[(Int, Int)](scala.Tuple2.apply[Int, Int](x$0.x, x$0.y));
- <synthetic> private def readResolve(): Object = C
+ Some.apply[(Int, Int)](scala.Tuple2.apply[Int, Int](x$0.x, x$0.y))
};
Predef.println(C.apply(2, 3))
}
diff --git a/test/files/run/kind-repl-command.check b/test/files/run/kind-repl-command.check
index e050fb4bc1..560529ba03 100644
--- a/test/files/run/kind-repl-command.check
+++ b/test/files/run/kind-repl-command.check
@@ -19,7 +19,7 @@ scala> :k new { def empty = false }
AnyRef{def empty: Boolean}'s kind is A
scala> :k Nonexisting
-<console>:11: error: not found: value Nonexisting
+<console>:12: error: not found: value Nonexisting
Nonexisting
^
diff --git a/test/files/run/list_map.scala b/test/files/run/list_map.scala
index fba3aae228..fba3aae228 100755..100644
--- a/test/files/run/list_map.scala
+++ b/test/files/run/list_map.scala
diff --git a/test/files/run/names-defaults.scala b/test/files/run/names-defaults.scala
index 7fb4a04546..4159dbdf91 100644
--- a/test/files/run/names-defaults.scala
+++ b/test/files/run/names-defaults.scala
@@ -192,7 +192,7 @@ object Test extends App {
println(argName) // should be 4
test5 { argName = 5 }
println(argName) // should be 5
- val a: Unit = test1(a = 10, b = "2") // local values a and b exist, but not ambiuous since they're val's
+ val a: Unit = test1(a = 10, b = "2") // local values a and b exist, but it's not ambiguous since they're vals
// dependent types and copy method
diff --git a/test/files/run/nothingTypeNoOpt.scala b/test/files/run/nothingTypeNoOpt.scala
index 5c5a20fa3b..454539a4b1 100644
--- a/test/files/run/nothingTypeNoOpt.scala
+++ b/test/files/run/nothingTypeNoOpt.scala
@@ -26,7 +26,7 @@ class C {
}
def f5(x: Boolean) = {
- // stack heights need to be the smae. ??? looks to the jvm like returning a value of
+ // stack heights need to be the same. ??? looks to the jvm like returning a value of
// type Nothing$, need to drop or throw it.
println(
if (x) { ???; 10 }
diff --git a/test/files/run/reflection-fieldmirror-ctorparam.check b/test/files/run/reflection-fieldmirror-ctorparam.check
index e391e7ccfe..c66be94ed7 100644
--- a/test/files/run/reflection-fieldmirror-ctorparam.check
+++ b/test/files/run/reflection-fieldmirror-ctorparam.check
@@ -1,3 +1,3 @@
-class scala.ScalaReflectionException: Scala field x isn't represented as a Java field, neither it has a Java accessor method
-note that private parameters of class constructors don't get mapped onto fields and/or accessors,
-unless they are used outside of their declaring constructors.
+class scala.ScalaReflectionException: Scala field x of class A isn't represented as a Java field, nor does it have a
+Java accessor method. One common reason for this is that it may be a private class parameter
+not used outside the primary constructor.
diff --git a/test/files/run/reify-repl-fail-gracefully.check b/test/files/run/reify-repl-fail-gracefully.check
index 025d377a43..32ed876356 100644
--- a/test/files/run/reify-repl-fail-gracefully.check
+++ b/test/files/run/reify-repl-fail-gracefully.check
@@ -8,7 +8,7 @@ import scala.reflect.runtime.universe._
scala>
scala> reify
-<console>:15: error: too few argument lists for macro invocation
+<console>:16: error: too few argument lists for macro invocation
reify
^
diff --git a/test/files/run/reify_newimpl_22.check b/test/files/run/reify_newimpl_22.check
index e69dc60199..985f646579 100644
--- a/test/files/run/reify_newimpl_22.check
+++ b/test/files/run/reify_newimpl_22.check
@@ -15,7 +15,7 @@ scala> {
}
println(code.eval)
}
-<console>:18: free term: Ident(TermName("x")) defined by res0 in <console>:17:14
+<console>:19: free term: Ident(TermName("x")) defined by res0 in <console>:18:14
val code = reify {
^
2
diff --git a/test/files/run/reify_newimpl_23.check b/test/files/run/reify_newimpl_23.check
index 1356d509d3..f60113c69f 100644
--- a/test/files/run/reify_newimpl_23.check
+++ b/test/files/run/reify_newimpl_23.check
@@ -14,7 +14,7 @@ scala> def foo[T]{
}
println(code.eval)
}
-<console>:16: free type: Ident(TypeName("T")) defined by foo in <console>:15:16
+<console>:17: free type: Ident(TypeName("T")) defined by foo in <console>:16:16
val code = reify {
^
foo: [T]=> Unit
diff --git a/test/files/run/reify_newimpl_25.check b/test/files/run/reify_newimpl_25.check
index e512cfc52e..9104d8df0b 100644
--- a/test/files/run/reify_newimpl_25.check
+++ b/test/files/run/reify_newimpl_25.check
@@ -5,7 +5,7 @@ scala> {
val tt = implicitly[TypeTag[x.type]]
println(tt)
}
-<console>:14: free term: Ident(TermName("x")) defined by res0 in <console>:13:14
+<console>:15: free term: Ident(TermName("x")) defined by res0 in <console>:14:14
val tt = implicitly[TypeTag[x.type]]
^
TypeTag[x.type]
diff --git a/test/files/run/reify_newimpl_26.check b/test/files/run/reify_newimpl_26.check
index b203389db1..cbb21854ba 100644
--- a/test/files/run/reify_newimpl_26.check
+++ b/test/files/run/reify_newimpl_26.check
@@ -4,7 +4,7 @@ scala> def foo[T]{
val tt = implicitly[WeakTypeTag[List[T]]]
println(tt)
}
-<console>:12: free type: Ident(TypeName("T")) defined by foo in <console>:10:16
+<console>:13: free type: Ident(TypeName("T")) defined by foo in <console>:11:16
val tt = implicitly[WeakTypeTag[List[T]]]
^
foo: [T]=> Unit
diff --git a/test/files/run/repl-bare-expr.check b/test/files/run/repl-bare-expr.check
index f0c488455f..e0a1f4ecd6 100644
--- a/test/files/run/repl-bare-expr.check
+++ b/test/files/run/repl-bare-expr.check
@@ -1,12 +1,12 @@
scala> 2 ; 3
-<console>:10: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
2 ;;
^
res0: Int = 3
scala> { 2 ; 3 }
-<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:12: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
{ 2 ; 3 }
^
res1: Int = 3
@@ -15,16 +15,16 @@ scala> 5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Mooo
1 +
2 +
3 } ; bippy+88+11
-<console>:10: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = {
^
-<console>:10: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = {
^
-<console>:10: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = {
^
-<console>:10: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = {
^
defined object Cow
diff --git a/test/files/run/repl-parens.check b/test/files/run/repl-parens.check
index 35853f10da..6516f4ea90 100644
--- a/test/files/run/repl-parens.check
+++ b/test/files/run/repl-parens.check
@@ -18,10 +18,10 @@ scala> ( (2 + 2 ) )
res5: Int = 4
scala> 5 ; ( (2 + 2 ) ) ; ((5))
-<console>:10: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
5 ; ( (2 + 2 ) ) ;;
^
-<console>:10: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
5 ; ( (2 + 2 ) ) ;;
^
res6: Int = 5
@@ -38,16 +38,16 @@ res9: String = 4423
scala>
scala> 55 ; ((2 + 2)) ; (1, 2, 3)
-<console>:10: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
55 ; ((2 + 2)) ;;
^
-<console>:10: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
55 ; ((2 + 2)) ;;
^
res10: (Int, Int, Int) = (1,2,3)
scala> 55 ; (x: Int) => x + 1 ; () => ((5))
-<console>:10: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
55 ; (x: Int) => x + 1 ;;
^
res11: () => Int = <function0>
@@ -58,7 +58,7 @@ scala> () => 5
res12: () => Int = <function0>
scala> 55 ; () => 5
-<console>:10: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
55 ;;
^
res13: () => Int = <function0>
diff --git a/test/files/run/repl-paste-2.check b/test/files/run/repl-paste-2.check
index 5b6a84144d..4c589df41a 100644
--- a/test/files/run/repl-paste-2.check
+++ b/test/files/run/repl-paste-2.check
@@ -1,7 +1,7 @@
scala> scala> 999l
-// Detected repl transcript paste: ctrl-D to finish.
+// Detected repl transcript. Paste more, or ctrl-D to finish.
res4: Int = 0123
@@ -42,7 +42,7 @@ scala> res5 + res6
res1: Int = 690
scala> val x = dingus
-<console>:10: error: not found: value dingus
+<console>:11: error: not found: value dingus
val x = dingus
^
diff --git a/test/files/run/repl-power.check b/test/files/run/repl-power.check
index 2a7b7783d9..0d4a30b8e3 100644
--- a/test/files/run/repl-power.check
+++ b/test/files/run/repl-power.check
@@ -1,10 +1,8 @@
scala> :power
-** Power User mode enabled - BEEP WHIR GYVE **
-** :phase has been set to 'typer'. **
-** scala.tools.nsc._ has been imported **
-** global._, definitions._ also imported **
-** Try :help, :vals, power.<tab> **
+Power mode enabled. :phase is at typer.
+import scala.tools.nsc._, intp.global._, definitions._
+Try :help or completions for vals._ and power._
scala> // guarding against "error: reference to global is ambiguous"
@@ -25,4 +23,7 @@ m: $r.treedsl.global.Literal = 10
scala> typed(m).tpe // typed is in scope
res2: $r.treedsl.global.Type = Int(10)
+scala> """escaping is hard, m'kah"""
+res3: String = escaping is hard, m'kah
+
scala> :quit
diff --git a/test/files/run/repl-power.scala b/test/files/run/repl-power.scala
index 4dfeb37885..5ecaad8723 100644
--- a/test/files/run/repl-power.scala
+++ b/test/files/run/repl-power.scala
@@ -1,7 +1,9 @@
import scala.tools.partest.ReplTest
object Test extends ReplTest {
- def code = """
+ def tripleQuote(s: String) = "\"\"\"" + s + "\"\"\""
+
+ def code = s"""
:power
// guarding against "error: reference to global is ambiguous"
global.emptyValDef // "it is imported twice in the same scope by ..."
@@ -9,5 +11,6 @@ val tp = ArrayClass[scala.util.Random] // magic with tags
tp.memberType(Array_apply) // evidence
val m = LIT(10) // treedsl
typed(m).tpe // typed is in scope
+${tripleQuote("escaping is hard, m'kah")}
""".trim
}
diff --git a/test/files/run/repl-reset.check b/test/files/run/repl-reset.check
index b0683fff79..cf4d9a149e 100644
--- a/test/files/run/repl-reset.check
+++ b/test/files/run/repl-reset.check
@@ -28,13 +28,13 @@ Forgetting all expression results and named terms: $intp, BippyBungus, x1, x2, x
Forgetting defined types: BippyBungus
scala> x1 + x2 + x3
-<console>:11: error: not found: value x1
+<console>:12: error: not found: value x1
x1 + x2 + x3
^
-<console>:11: error: not found: value x2
+<console>:12: error: not found: value x2
x1 + x2 + x3
^
-<console>:11: error: not found: value x3
+<console>:12: error: not found: value x3
x1 + x2 + x3
^
@@ -42,7 +42,7 @@ scala> val x1 = 4
x1: Int = 4
scala> new BippyBungus
-<console>:11: error: not found: type BippyBungus
+<console>:12: error: not found: type BippyBungus
new BippyBungus
^
diff --git a/test/files/run/repl-serialization.check b/test/files/run/repl-serialization.check
index eb62729f5c..bbbf0dcdf1 100644
--- a/test/files/run/repl-serialization.check
+++ b/test/files/run/repl-serialization.check
@@ -20,6 +20,5 @@ u: U = U
evaluating O
constructing A
== reconstituting into a fresh classloader
- evaluating O
== evaluating reconstituted lambda
constructing A
diff --git a/test/files/run/repl-transcript.check b/test/files/run/repl-transcript.check
index 762a96b9cc..d0b455cbf6 100644
--- a/test/files/run/repl-transcript.check
+++ b/test/files/run/repl-transcript.check
@@ -1,7 +1,7 @@
scala> scala> class Bippity
-// Detected repl transcript paste: ctrl-D to finish.
+// Detected repl transcript. Paste more, or ctrl-D to finish.
defined class Bippity
diff --git a/test/files/run/repl-trim-stack-trace.scala b/test/files/run/repl-trim-stack-trace.scala
index ea91e32239..c0814905f9 100644
--- a/test/files/run/repl-trim-stack-trace.scala
+++ b/test/files/run/repl-trim-stack-trace.scala
@@ -12,7 +12,7 @@ f: Nothing
scala> f
java.lang.Exception: Uh-oh
- at .f(<console>:10)
+ at .f(<console>:11)
... 69 elided
scala> def f = throw new Exception("")
@@ -20,7 +20,7 @@ f: Nothing
scala> f
java.lang.Exception:
- at .f(<console>:10)
+ at .f(<console>:11)
... 69 elided
scala> def f = throw new Exception
@@ -28,7 +28,7 @@ f: Nothing
scala> f
java.lang.Exception
- at .f(<console>:10)
+ at .f(<console>:11)
... 69 elided
scala> :quit"""
diff --git a/test/files/run/t1931.scala b/test/files/run/t1931.scala
new file mode 100644
index 0000000000..eedfa9b03d
--- /dev/null
+++ b/test/files/run/t1931.scala
@@ -0,0 +1,43 @@
+
+import scala.tools.partest.SessionTest
+
+object Test extends SessionTest {
+
+ def session =
+"""
+scala> val x: Any = 42
+x: Any = 42
+
+scala> x + " works"
+res0: String = 42 works
+
+scala> import Predef.{ any2stringadd => _, _ }
+import Predef.{any2stringadd=>_, _}
+
+scala> x + " works"
+<console>:14: error: value + is not a member of Any
+ x + " works"
+ ^
+
+scala> import Predef._
+import Predef._
+
+scala> x + " works"
+res2: String = 42 works
+
+scala> object Predef { def f = 42 }
+defined object Predef
+
+scala> import Predef._
+import Predef._
+
+scala> f
+<console>:14: error: not found: value f
+ f
+ ^
+
+scala> Predef.f
+res4: Int = 42
+
+scala> :quit"""
+}
diff --git a/test/files/run/t2127.scala b/test/files/run/t2127.scala
index 839c8d6a5c..839c8d6a5c 100755..100644
--- a/test/files/run/t2127.scala
+++ b/test/files/run/t2127.scala
diff --git a/test/files/run/t2503.scala b/test/files/run/t2503.scala
index 21801e2dbd..21801e2dbd 100755..100644
--- a/test/files/run/t2503.scala
+++ b/test/files/run/t2503.scala
diff --git a/test/files/run/t3026.scala b/test/files/run/t3026.scala
index 22dde9cc03..22dde9cc03 100755..100644
--- a/test/files/run/t3026.scala
+++ b/test/files/run/t3026.scala
diff --git a/test/files/run/t4542.check b/test/files/run/t4542.check
index 3ab3eaffd8..6e099222b0 100644
--- a/test/files/run/t4542.check
+++ b/test/files/run/t4542.check
@@ -5,7 +5,7 @@ scala> @deprecated("foooo", "ReplTest version 1.0-FINAL") class Foo() {
defined class Foo
scala> val f = new Foo
-<console>:11: warning: class Foo is deprecated: foooo
+<console>:12: warning: class Foo is deprecated: foooo
val f = new Foo
^
f: Foo = Bippy
diff --git a/test/files/run/t4594-repl-settings.scala b/test/files/run/t4594-repl-settings.scala
index cbd87b5949..f2d1a8b3f8 100644
--- a/test/files/run/t4594-repl-settings.scala
+++ b/test/files/run/t4594-repl-settings.scala
@@ -15,7 +15,7 @@ object Test extends SessionTest {
|scala> :settings -deprecation
|
|scala> def b = depp
- |<console>:11: warning: method depp is deprecated: Please don't do that.
+ |<console>:12: warning: method depp is deprecated: Please don't do that.
| def b = depp
| ^
|b: String
diff --git a/test/files/run/t4658.check b/test/files/run/t4658.check
index bb6405175e..3bc52daef3 100644
--- a/test/files/run/t4658.check
+++ b/test/files/run/t4658.check
@@ -1,5 +1,5 @@
Ranges:
-1073741824
+-1073741824
1073741824
0
0
@@ -20,7 +20,7 @@ Ranges:
-10
IntRanges:
-1073741824
--1073741824
+1073741824
0
0
55
@@ -78,3 +78,6 @@ BigIntRanges:
-24
-30
-10
+BigInt agrees with Long: true
+Long agrees with Int when rounded: true
+Numeric Int agrees with Range: true
diff --git a/test/files/run/t4658.scala b/test/files/run/t4658.scala
index 8c07c50694..7fc6d4584c 100644
--- a/test/files/run/t4658.scala
+++ b/test/files/run/t4658.scala
@@ -2,6 +2,7 @@ import scala.collection.immutable.NumericRange
//#4658
object Test {
+ // Only works for Int values! Need to rethink explicit otherwise.
case class R(start: Int, end: Int, step: Int = 1, inclusive: Boolean = true)
val rangeData = Array(
@@ -28,6 +29,14 @@ object Test {
numericLongRanges.foreach{range => println(range.sum)}
println("BigIntRanges:")
numericBigIntRanges.foreach{range => println(range.sum)}
+ println("BigInt agrees with Long: " +
+ (numericLongRanges zip numericBigIntRanges).forall{ case (lr, bir) => lr.sum == bir.sum }
+ )
+ println("Long agrees with Int when rounded: " +
+ (numericLongRanges zip numericIntRanges).forall{ case (lr, ir) => lr.sum.toInt == ir.sum }
+ )
+ println("Numeric Int agrees with Range: " +
+ (numericIntRanges zip ranges).forall{ case (ir, r) => ir.sum == r.sum }
+ )
}
-
} \ No newline at end of file
diff --git a/test/files/run/t5655.check b/test/files/run/t5655.check
index 857a5ab556..9191997624 100644
--- a/test/files/run/t5655.check
+++ b/test/files/run/t5655.check
@@ -6,7 +6,7 @@ scala> import x._
import x._
scala> x
-<console>:15: error: reference to x is ambiguous;
+<console>:16: error: reference to x is ambiguous;
it is imported twice in the same scope by
import x._
and import x
@@ -14,7 +14,7 @@ and import x
^
scala> x
-<console>:15: error: reference to x is ambiguous;
+<console>:16: error: reference to x is ambiguous;
it is imported twice in the same scope by
import x._
and import x
diff --git a/test/files/run/t5699.check b/test/files/run/t5699.check
index df19644ae6..df19644ae6 100755..100644
--- a/test/files/run/t5699.check
+++ b/test/files/run/t5699.check
diff --git a/test/files/run/t5699.scala b/test/files/run/t5699.scala
index 409bcd250c..409bcd250c 100755..100644
--- a/test/files/run/t5699.scala
+++ b/test/files/run/t5699.scala
diff --git a/test/files/run/t5717.scala b/test/files/run/t5717.scala
index a0997f5a49..a0997f5a49 100755..100644
--- a/test/files/run/t5717.scala
+++ b/test/files/run/t5717.scala
diff --git a/test/files/run/t6146b.check b/test/files/run/t6146b.check
index 0e0c216cd7..11149c50fd 100644
--- a/test/files/run/t6146b.check
+++ b/test/files/run/t6146b.check
@@ -4,11 +4,9 @@ It would fail on the following inputs: S2(), S3()
^
scala> :power
-** Power User mode enabled - BEEP WHIR GYVE **
-** :phase has been set to 'typer'. **
-** scala.tools.nsc._ has been imported **
-** global._, definitions._ also imported **
-** Try :help, :vals, power.<tab> **
+Power mode enabled. :phase is at typer.
+import scala.tools.nsc._, intp.global._, definitions._
+Try :help or completions for vals._ and power._
scala> val u = rootMirror.universe; import u._, language._
u: $r.intp.global.type = <global>
diff --git a/test/files/run/t6439.check b/test/files/run/t6439.check
index eee2da1b12..dd7ba9f81d 100644
--- a/test/files/run/t6439.check
+++ b/test/files/run/t6439.check
@@ -48,11 +48,9 @@ scala> type F = Int // no warn
defined type alias F
scala> :power
-** Power User mode enabled - BEEP WHIR GYVE **
-** :phase has been set to 'typer'. **
-** scala.tools.nsc._ has been imported **
-** global._, definitions._ also imported **
-** Try :help, :vals, power.<tab> **
+Power mode enabled. :phase is at typer.
+import scala.tools.nsc._, intp.global._, definitions._
+Try :help or completions for vals._ and power._
scala> object lookup {
import intp._
diff --git a/test/files/run/t7246.check b/test/files/run/t7246.check
index ce01362503..ce01362503 100755..100644
--- a/test/files/run/t7246.check
+++ b/test/files/run/t7246.check
diff --git a/test/files/run/t7246/Outer.java b/test/files/run/t7246/Outer.java
index 163276fb3b..163276fb3b 100755..100644
--- a/test/files/run/t7246/Outer.java
+++ b/test/files/run/t7246/Outer.java
diff --git a/test/files/run/t7246/Test.scala b/test/files/run/t7246/Test.scala
index 9f23ca8f3a..9f23ca8f3a 100755..100644
--- a/test/files/run/t7246/Test.scala
+++ b/test/files/run/t7246/Test.scala
diff --git a/test/files/run/t7246b.check b/test/files/run/t7246b.check
index 5073bd8617..5073bd8617 100755..100644
--- a/test/files/run/t7246b.check
+++ b/test/files/run/t7246b.check
diff --git a/test/files/run/t7246b/Base.scala b/test/files/run/t7246b/Base.scala
index 4e71d3313d..4e71d3313d 100755..100644
--- a/test/files/run/t7246b/Base.scala
+++ b/test/files/run/t7246b/Base.scala
diff --git a/test/files/run/t7246b/Outer.java b/test/files/run/t7246b/Outer.java
index 53a79316ef..53a79316ef 100755..100644
--- a/test/files/run/t7246b/Outer.java
+++ b/test/files/run/t7246b/Outer.java
diff --git a/test/files/run/t7246b/Test.scala b/test/files/run/t7246b/Test.scala
index f0982ea8d0..f0982ea8d0 100755..100644
--- a/test/files/run/t7246b/Test.scala
+++ b/test/files/run/t7246b/Test.scala
diff --git a/test/files/run/t7319.check b/test/files/run/t7319.check
index 31923e7119..4d8429e8f2 100644
--- a/test/files/run/t7319.check
+++ b/test/files/run/t7319.check
@@ -15,21 +15,21 @@ warning: there was one feature warning; re-run with -feature for details
convert: [F[X <: F[X]]](builder: F[_ <: F[_]])Int
scala> convert(Some[Int](0))
-<console>:15: error: no type parameters for method convert: (builder: F[_ <: F[_]])Int exist so that it can be applied to arguments (Some[Int])
+<console>:16: error: no type parameters for method convert: (builder: F[_ <: F[_]])Int exist so that it can be applied to arguments (Some[Int])
--- because ---
argument expression's type is not compatible with formal parameter type;
found : Some[Int]
required: ?F[_$1] forSome { type _$1 <: ?F[_$2] forSome { type _$2 } }
convert(Some[Int](0))
^
-<console>:15: error: type mismatch;
+<console>:16: error: type mismatch;
found : Some[Int]
required: F[_ <: F[_]]
convert(Some[Int](0))
^
scala> Range(1,2).toArray: Seq[_]
-<console>:14: error: polymorphic expression cannot be instantiated to expected type;
+<console>:15: error: polymorphic expression cannot be instantiated to expected type;
found : [B >: Int]Array[B]
required: Seq[_]
Range(1,2).toArray: Seq[_]
diff --git a/test/files/run/t7341.flags b/test/files/run/t7341.flags
index ae08446055..ae08446055 100755..100644
--- a/test/files/run/t7341.flags
+++ b/test/files/run/t7341.flags
diff --git a/test/files/run/t7341.scala b/test/files/run/t7341.scala
index ffea7f918b..ffea7f918b 100755..100644
--- a/test/files/run/t7341.scala
+++ b/test/files/run/t7341.scala
diff --git a/test/files/run/t7747-repl.check b/test/files/run/t7747-repl.check
index f19c39e7e1..d698ea668d 100644
--- a/test/files/run/t7747-repl.check
+++ b/test/files/run/t7747-repl.check
@@ -15,13 +15,13 @@ scala> val z = x * y
z: Int = 156
scala> 2 ; 3
-<console>:10: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
2 ;;
^
res0: Int = 3
scala> { 2 ; 3 }
-<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:12: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
{ 2 ; 3 }
^
res1: Int = 3
@@ -30,16 +30,16 @@ scala> 5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Mooo
1 +
2 +
3 } ; bippy+88+11
-<console>:10: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = {
^
-<console>:10: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = {
^
-<console>:10: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = {
^
-<console>:10: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
5 ; 10 ; case object Cow ; 20 ; class Moo { override def toString = "Moooooo" } ; 30 ; def bippy = {
^
defined object Cow
@@ -81,10 +81,10 @@ scala> ( (2 + 2 ) )
res10: Int = 4
scala> 5 ; ( (2 + 2 ) ) ; ((5))
-<console>:10: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
5 ; ( (2 + 2 ) ) ;;
^
-<console>:10: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
5 ; ( (2 + 2 ) ) ;;
^
res11: Int = 5
@@ -101,16 +101,16 @@ res14: String = 4423
scala>
scala> 55 ; ((2 + 2)) ; (1, 2, 3)
-<console>:10: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
55 ; ((2 + 2)) ;;
^
-<console>:10: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
55 ; ((2 + 2)) ;;
^
res15: (Int, Int, Int) = (1,2,3)
scala> 55 ; (x: Int) => x + 1 ; () => ((5))
-<console>:12: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:13: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
55 ; (x: Int) => x + 1 ;;
^
res16: () => Int = <function0>
@@ -121,7 +121,7 @@ scala> () => 5
res17: () => Int = <function0>
scala> 55 ; () => 5
-<console>:10: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
+<console>:11: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses
55 ;;
^
res18: () => Int = <function0>
@@ -209,13 +209,13 @@ Forgetting all expression results and named terms: $intp, BippyBungus, Bovine, C
Forgetting defined types: BippyBungus, Moo, Ruminant
scala> x1 + x2 + x3
-<console>:11: error: not found: value x1
+<console>:12: error: not found: value x1
x1 + x2 + x3
^
-<console>:11: error: not found: value x2
+<console>:12: error: not found: value x2
x1 + x2 + x3
^
-<console>:11: error: not found: value x3
+<console>:12: error: not found: value x3
x1 + x2 + x3
^
@@ -223,7 +223,7 @@ scala> val x1 = 4
x1: Int = 4
scala> new BippyBungus
-<console>:11: error: not found: type BippyBungus
+<console>:12: error: not found: type BippyBungus
new BippyBungus
^
@@ -295,11 +295,9 @@ scala> b(a)
res4: String = Found Sum
scala> :power
-** Power User mode enabled - BEEP WHIR GYVE **
-** :phase has been set to 'typer'. **
-** scala.tools.nsc._ has been imported **
-** global._, definitions._ also imported **
-** Try :help, :vals, power.<tab> **
+Power mode enabled. :phase is at typer.
+import scala.tools.nsc._, intp.global._, definitions._
+Try :help or completions for vals._ and power._
scala> intp.lastRequest
res5: $r.intp.Request = Request(line=def $ires3 = intp.global, 1 trees)
diff --git a/test/files/run/t8047.scala b/test/files/run/t8047.scala
index f5660541e8..9ec8c1dc56 100644
--- a/test/files/run/t8047.scala
+++ b/test/files/run/t8047.scala
@@ -1,7 +1,7 @@
object Test extends App {
import scala.reflect.runtime.universe._
//
- // x's owner is outer Test scope. Previosly the quasiquote expansion
+ // x's owner is outer Test scope. Previously the quasiquote expansion
// looked like:
//
// object Test {
diff --git a/test/files/run/t8346.check b/test/files/run/t8346.check
deleted file mode 100644
index 1ba5c31abe..0000000000
--- a/test/files/run/t8346.check
+++ /dev/null
@@ -1,6 +0,0 @@
-BitSet: List(invariant, invariant, invariant, invariant)
-HashSet: List(covariant (true), covariant (true), covariant (true), covariant (true))
-ListSet: List(covariant (true), covariant (true), covariant (true), covariant (true))
-SortedSet: List(invariant, invariant, invariant, invariant)
-TreeSet: List(invariant, invariant, invariant, invariant)
-ValueSet: invariant
diff --git a/test/files/run/t8346.scala b/test/files/run/t8346.scala
deleted file mode 100644
index 5f3df84174..0000000000
--- a/test/files/run/t8346.scala
+++ /dev/null
@@ -1,34 +0,0 @@
-object Test extends App {
- import reflect.ClassTag
-
- object SomeEnum extends Enumeration {
- val one, two, three, four = Value
- }
-
- def sctor[A <: Set[Int]](f: Int => A)(implicit A: ClassTag[A])
- : (String, Int => Set[Int]) =
- (A.runtimeClass.getSimpleName, f)
-
- val inits: Seq[(String, Int => Set[Int])] = {
- import collection.immutable.{Seq => _, _}
- Seq(sctor(BitSet(_)),
- sctor(HashSet(_)),
- sctor(ListSet(_)),
- sctor(SortedSet(_)),
- sctor(TreeSet(_)))
- }
-
- def sVarInfo[A](sa: Set[A]): String = {
- val saa = sa.toSet[Any]
- if (sa eq saa) s"""covariant (${(saa + "hi") contains "hi"})"""
- else "invariant"
- }
-
- inits foreach {case (name, singleton) =>
- print(s"${name}: ")
- val one = singleton(1)
- println(Seq(2,3,4).scanLeft(one)(_ + _) map sVarInfo toList)
- }
-
- println(s"ValueSet: ${sVarInfo(SomeEnum.values)}")
-}
diff --git a/test/files/run/t9170.scala b/test/files/run/t9170.scala
index d6cf516615..f39467bc25 100644
--- a/test/files/run/t9170.scala
+++ b/test/files/run/t9170.scala
@@ -8,17 +8,17 @@ object Test extends SessionTest {
def session =
"""
scala> object Y { def f[A](a: => A) = 1 ; def f[A](a: => Either[Exception, A]) = 2 }
-<console>:10: error: double definition:
-def f[A](a: => A): Int at line 10 and
-def f[A](a: => Either[Exception,A]): Int at line 10
+<console>:11: error: double definition:
+def f[A](a: => A): Int at line 11 and
+def f[A](a: => Either[Exception,A]): Int at line 11
have same type after erasure: (a: Function0)Int
object Y { def f[A](a: => A) = 1 ; def f[A](a: => Either[Exception, A]) = 2 }
^
scala> object Y { def f[A](a: => A) = 1 ; def f[A](a: => Either[Exception, A]) = 2 }
-<console>:10: error: double definition:
-def f[A](a: => A): Int at line 10 and
-def f[A](a: => Either[Exception,A]): Int at line 10
+<console>:11: error: double definition:
+def f[A](a: => A): Int at line 11 and
+def f[A](a: => Either[Exception,A]): Int at line 11
have same type after erasure: (a: Function0)Int
object Y { def f[A](a: => A) = 1 ; def f[A](a: => Either[Exception, A]) = 2 }
^
@@ -27,9 +27,9 @@ scala> object Y {
| def f[A](a: => A) = 1
| def f[A](a: => Either[Exception, A]) = 2
| }
-<console>:12: error: double definition:
-def f[A](a: => A): Int at line 11 and
-def f[A](a: => Either[Exception,A]): Int at line 12
+<console>:13: error: double definition:
+def f[A](a: => A): Int at line 12 and
+def f[A](a: => Either[Exception,A]): Int at line 13
have same type after erasure: (a: Function0)Int
def f[A](a: => Either[Exception, A]) = 2
^
@@ -44,9 +44,9 @@ object Y {
// Exiting paste mode, now interpreting.
-<console>:12: error: double definition:
-def f[A](a: => A): Int at line 11 and
-def f[A](a: => Either[Exception,A]): Int at line 12
+<console>:13: error: double definition:
+def f[A](a: => A): Int at line 12 and
+def f[A](a: => Either[Exception,A]): Int at line 13
have same type after erasure: (a: Function0)Int
def f[A](a: => Either[Exception, A]) = 2
^
diff --git a/test/files/run/t9206.scala b/test/files/run/t9206.scala
index 872c980fe4..406798104e 100644
--- a/test/files/run/t9206.scala
+++ b/test/files/run/t9206.scala
@@ -7,14 +7,14 @@ object Test extends SessionTest {
def session =
s"""|
|scala> val i: Int = "foo"
- |<console>:10: error: type mismatch;
+ |<console>:11: error: type mismatch;
| found : String("foo")
| required: Int
| val i: Int = "foo"
| ^
|
|scala> { val j = 42 ; val i: Int = "foo" + j }
- |<console>:11: error: type mismatch;
+ |<console>:12: error: type mismatch;
| found : String
| required: Int
| { val j = 42 ; val i: Int = "foo" + j }
diff --git a/test/files/run/t9375.check b/test/files/run/t9375.check
new file mode 100644
index 0000000000..87551dccd1
--- /dev/null
+++ b/test/files/run/t9375.check
@@ -0,0 +1,60 @@
+ konstruktor: class A
+ konstruktor: class A$O$12$
+ konstruktor: class A$$anon$1
+ konstruktor: class A$A
+ konstruktor: class A$C
+ konstruktor: class C
+ konstruktor: class T$O$15$
+ konstruktor: class T$$anon$2
+ konstruktor: class T$A
+ konstruktor: class T$C
+ konstruktor: class A$N$
+ konstruktor: class T$N$
+serializing outer objects should not initialize any nested objects
+now initializing nested objects
+ konstruktor: class A$O$
+ konstruktor: class A$Op$
+ konstruktor: class A$N$O$
+ konstruktor: class A$N$Op$
+ konstruktor: class A$A$O$
+ konstruktor: class A$A$Op$
+ konstruktor: class A$T$O$
+ konstruktor: class A$T$Op$
+ konstruktor: class A$O$11$
+ konstruktor: class A$$anonfun$1$O$13$
+ konstruktor: class A$$anon$1$O$
+ konstruktor: class A$$anon$1$Op$
+ konstruktor: class T$O$
+ konstruktor: class T$Op$
+ konstruktor: class T$N$O$
+ konstruktor: class T$N$Op$
+ konstruktor: class T$A$O$
+ konstruktor: class T$A$Op$
+ konstruktor: class T$T$O$
+ konstruktor: class T$T$Op$
+ konstruktor: class T$O$14$
+ konstruktor: class T$$anonfun$2$O$16$
+ konstruktor: class T$$anon$2$O$
+ konstruktor: class T$$anon$2$Op$
+no object konstruktors called when serializing / deserializing objects (starting at the outer or the object itself)
+deserializing outer objects with non-initialized inners again
+accessing modules triggers initialization
+ konstruktor: class A$O$
+ konstruktor: class A$Op$
+ konstruktor: class A$N$O$
+ konstruktor: class A$N$Op$
+deserializing creates a new object graph, including new scala 'object' instances, no matter where serialization starts
+init static module M and field v
+ konstruktor: class M$
+ konstruktor: class M$O$18$
+serDeser does not initialize nested static modules
+init M.O
+ konstruktor: class M$O$
+serDeser nested static module
+objects declared in field decls are not static modules, so they deserialize to new instances
+init lazy val M.w
+objects declared in lazy val are not static modules either
+ konstruktor: class M$O$19$
+object declared in a function: new instance created on each invocation
+ konstruktor: class M$$anonfun$3$O$20$
+ konstruktor: class M$$anonfun$3$O$20$
diff --git a/test/files/run/t9375.scala b/test/files/run/t9375.scala
new file mode 100644
index 0000000000..6ff4a425f8
--- /dev/null
+++ b/test/files/run/t9375.scala
@@ -0,0 +1,279 @@
+/*
+ * filter: inliner warning
+ */
+import java.io._
+
+object SerDes {
+ def serialize(obj: AnyRef): Array[Byte] = {
+ val buffer = new ByteArrayOutputStream
+ val out = new ObjectOutputStream(buffer)
+ out.writeObject(obj)
+ buffer.toByteArray
+ }
+
+ def deserialize(a: Array[Byte]): AnyRef = {
+ val in = new ObjectInputStream(new ByteArrayInputStream(a))
+ in.readObject
+ }
+
+ def serializeDeserialize[T <: AnyRef](obj: T) = deserialize(serialize(obj)).asInstanceOf[T]
+}
+
+import SerDes._
+
+// tests to make sure that de-serializing an object does not run its constructor
+
+trait S extends Serializable {
+ println(" konstruktor: " + this.getClass)
+}
+
+trait SE extends S {
+ def outer: Object
+}
+
+class A extends S {
+ object O extends SE { def outer = A.this }
+ private[this] object Op extends SE { def outer = A.this }
+ def P: SE = Op
+
+ object N extends S {
+ object O extends SE { def outer = N }
+ private[this] object Op extends SE { def outer = N }
+ def P: SE = Op
+ }
+
+ class A extends S {
+ object O extends SE { def outer = A.this }
+ private[this] object Op extends SE { def outer = A.this }
+ def P: SE = Op
+ }
+
+ trait T extends S {
+ object O extends SE { def outer = T.this }
+ private[this] object Op extends SE { def outer = T.this }
+ def P: SE = Op
+ }
+ class C extends T
+
+ def u: SE = {
+ object O extends SE { def outer = A.this }
+ O
+ }
+
+ val v: SE = {
+ object O extends SE { def outer = A.this }
+ O
+ }
+
+ val f: () => SE = () => {
+ object O extends SE { def outer = A.this }
+ O
+ }
+
+ trait GetObj { def O: SE; def P: SE }
+ val a: GetObj = new GetObj with S {
+ def anonThis = this
+ object O extends SE { def outer = anonThis }
+ private[this] object Op extends SE { def outer = anonThis }
+ def P: SE = Op
+ }
+}
+
+trait T extends S {
+ object O extends SE { def outer = T.this }
+ private[this] object Op extends SE { def outer = T.this }
+ def P: SE = Op
+
+ object N extends S {
+ object O extends SE { def outer = N }
+ private[this] object Op extends SE { def outer = N }
+ def P: SE = Op
+ }
+
+ class A extends S {
+ object O extends SE { def outer = A.this }
+ private[this] object Op extends SE { def outer = A.this }
+ def P: SE = Op
+ }
+
+ trait T extends S {
+ object O extends SE { def outer = T.this }
+ private[this] object Op extends SE { def outer = T.this }
+ def P: SE = Op
+ }
+ class C extends T
+
+ def u: SE = {
+ object O extends SE { def outer = T.this }
+ O
+ }
+
+ val v: SE = {
+ object O extends SE { def outer = T.this }
+ O
+ }
+
+ val f: () => SE = () => {
+ object O extends SE { def outer = T.this }
+ O
+ }
+
+ trait GetObj { def O: SE; def P: SE }
+ val a: GetObj = new GetObj with S {
+ def anonThis = this
+ object O extends SE { def outer = anonThis }
+ private[this] object Op extends SE { def outer = anonThis }
+ def P: SE = Op
+ }
+}
+
+class C extends T
+
+object DeserializeModuleNoConstructor {
+ def t(): Unit = {
+ val a = new A
+ val aa = new a.A
+ val ac = new a.C
+
+ val c = new C
+ val ca = new c.A
+ val cc = new c.C
+
+ val outers: List[Object] = List(
+ a, a.N, aa, ac, a.a,
+ c, c.N, ca, cc, c.a
+ )
+
+ println("serializing outer objects should not initialize any nested objects")
+
+ val serANotInit = serialize(a)
+ outers foreach serializeDeserialize
+
+ println("now initializing nested objects")
+
+ val os: List[(SE, Object)] = List(
+ a.O -> a,
+ a.P -> a,
+ a.N.O -> a.N,
+ a.N.P -> a.N,
+ aa.O -> aa,
+ aa.P -> aa,
+ ac.O -> ac,
+ ac.P -> ac,
+ a.u -> a,
+ a.v -> a,
+ a.f() -> a,
+ a.a.O -> a.a,
+ a.a.P -> a.a,
+
+ c.O -> c,
+ c.P -> c,
+ c.N.O -> c.N,
+ c.N.P -> c.N,
+ ca.O -> ca,
+ ca.P -> ca,
+ cc.O -> cc,
+ cc.P -> cc,
+ c.u -> c,
+ c.v -> c,
+ c.f() -> c,
+ c.a.O -> c.a,
+ c.a.P -> c.a
+ )
+
+ println("no object konstruktors called when serializing / deserializing objects (starting at the outer or the object itself)")
+
+ for ((obj, outer) <- os) {
+ assert(obj.outer eq outer, s"${obj.outer} of $obj -- $outer")
+ serializeDeserialize(obj)
+ serializeDeserialize(outer)
+ }
+
+ println("deserializing outer objects with non-initialized inners again")
+ val aNotInit = deserialize(serANotInit).asInstanceOf[A]
+
+ println("accessing modules triggers initialization")
+ aNotInit.O
+ aNotInit.P
+ aNotInit.N.O
+ aNotInit.N.P
+
+ println("deserializing creates a new object graph, including new scala 'object' instances, no matter where serialization starts")
+ val deserializedAs: List[A] = List(
+ serializeDeserialize(a),
+ serializeDeserialize(a.O).outer.asInstanceOf[A],
+ serializeDeserialize(a.P).outer.asInstanceOf[A],
+ serializeDeserialize(a.v).outer.asInstanceOf[A]
+ )
+ for (aSD <- deserializedAs) {
+ assert(aSD ne a)
+ assert(aSD.O ne a.O)
+ assert(aSD.P ne a.P)
+ assert(aSD.N ne a.N)
+ assert(aSD.N.O ne a.N.O)
+ assert(aSD.N.P ne a.N.P)
+ assert(aSD.v ne a.v)
+ assert(aSD.a.O ne a.a.O)
+ assert(aSD.a.P ne a.a.P)
+ }
+ }
+}
+
+// tests for serializing / deserializing static modules
+
+object M extends S {
+ object O extends S
+
+ def u: S = {
+ object O extends S
+ O
+ }
+
+ val v: S = {
+ object O extends S
+ O
+ }
+
+ lazy val w: S = {
+ object O extends S
+ O
+ }
+
+ val f: () => S = () => {
+ object O extends S
+ O
+ }
+}
+
+object SerializingStaticModules {
+ def t(): Unit = {
+ println("init static module M and field v")
+ M
+
+ println("serDeser does not initialize nested static modules")
+ assert(serializeDeserialize(M) eq M)
+
+ println("init M.O")
+ M.O
+
+ println("serDeser nested static module")
+ assert(serializeDeserialize(M.O) eq M.O)
+
+ println("objects declared in field decls are not static modules, so they deserialize to new instances")
+ assert(serializeDeserialize(M.v) ne M.v)
+
+ println("init lazy val M.w")
+
+ println("objects declared in lazy val are not static modules either")
+ assert(serializeDeserialize(M.w) ne M.w)
+
+ println("object declared in a function: new instance created on each invocation")
+ assert(M.f() ne M.f())
+ }
+}
+
+
+object Test extends App {
+ DeserializeModuleNoConstructor.t()
+ SerializingStaticModules.t()
+}
diff --git a/test/files/run/t9388-bin-compat.scala b/test/files/run/t9388-bin-compat.scala
new file mode 100644
index 0000000000..a03646612f
--- /dev/null
+++ b/test/files/run/t9388-bin-compat.scala
@@ -0,0 +1,16 @@
+class C {
+ private object N extends Serializable { override def toString = "N" }
+ def foo = N.toString
+}
+object Test {
+ def main(args: Array[String]): Unit = {
+ val c = Class.forName("C")
+ assert(c.getDeclaredFields().toList.map(_.toString) ==
+ List("private volatile C$N$ C.C$$N$module")) // field is name-mangled (C$$N$module instead of just N$module)
+ assert(c.getDeclaredMethods().toList.map(_.toString).sorted ==
+ List("private C$N$ C.C$$N$lzycompute()",
+ "public C$N$ C.C$$N()",
+ "public java.lang.String C.foo()")) // accessor is public, name-mangled
+ assert((new C).foo == "N")
+ }
+}
diff --git a/test/files/run/t9425.scala b/test/files/run/t9425.scala
new file mode 100644
index 0000000000..f251cc8579
--- /dev/null
+++ b/test/files/run/t9425.scala
@@ -0,0 +1,8 @@
+class C { case class Foo private (x: Int); Foo.apply(0) }
+
+object Test {
+ def test(c: C) = {import c.Foo; Foo.apply(0)}
+ def main(args: Array[String]): Unit = {
+ test(new C)
+ }
+}
diff --git a/test/files/run/toolbox_expand_macro.check b/test/files/run/toolbox_expand_macro.check
new file mode 100644
index 0000000000..d81cc0710e
--- /dev/null
+++ b/test/files/run/toolbox_expand_macro.check
@@ -0,0 +1 @@
+42
diff --git a/test/files/run/toolbox_expand_macro.scala b/test/files/run/toolbox_expand_macro.scala
new file mode 100644
index 0000000000..a52e449168
--- /dev/null
+++ b/test/files/run/toolbox_expand_macro.scala
@@ -0,0 +1,23 @@
+import scala.reflect.runtime.universe._
+import scala.reflect.runtime.{universe => ru}
+import scala.reflect.runtime.{currentMirror => cm}
+import scala.tools.reflect.{ToolBox}
+
+object Test extends App {
+ val toolBox = cm.mkToolBox()
+ val x = 21
+ val runtimeMacro =
+ q"""object RuntimeMacro {
+ import scala.reflect.macros.whitebox.Context
+ import scala.language.experimental.macros
+
+ def add(y: Int): Int = macro addImpl
+ def addImpl(c: Context)(y: c.Expr[Int]): c.Expr[Int] = {
+ import c.universe._
+ val x = $x
+ c.Expr[Int](q"$$x + $$y")
+ }
+ }"""
+ val s = toolBox.define(runtimeMacro)
+ println(toolBox.eval(q"$s.add(21)"))
+}
diff --git a/test/files/run/tpeCache-tyconCache.check b/test/files/run/tpeCache-tyconCache.check
index ac13d32f91..b26f1ab8a1 100644
--- a/test/files/run/tpeCache-tyconCache.check
+++ b/test/files/run/tpeCache-tyconCache.check
@@ -1,10 +1,8 @@
scala> :power
-** Power User mode enabled - BEEP WHIR GYVE **
-** :phase has been set to 'typer'. **
-** scala.tools.nsc._ has been imported **
-** global._, definitions._ also imported **
-** Try :help, :vals, power.<tab> **
+Power mode enabled. :phase is at typer.
+import scala.tools.nsc._, intp.global._, definitions._
+Try :help or completions for vals._ and power._
scala>
diff --git a/test/files/run/viewtest.scala b/test/files/run/viewtest.scala
index 581958e9a6..581958e9a6 100755..100644
--- a/test/files/run/viewtest.scala
+++ b/test/files/run/viewtest.scala
diff --git a/test/files/run/weakconform.scala b/test/files/run/weakconform.scala
index 30a12b9298..30a12b9298 100755..100644
--- a/test/files/run/weakconform.scala
+++ b/test/files/run/weakconform.scala
diff --git a/test/files/run/xMigration.check b/test/files/run/xMigration.check
index 79ce544493..cd860bf394 100644
--- a/test/files/run/xMigration.check
+++ b/test/files/run/xMigration.check
@@ -10,7 +10,7 @@ res1: Iterable[String] = MapLike(eis)
scala> :setting -Xmigration:any
scala> Map(1 -> "eis").values // warn
-<console>:11: warning: method values in trait MapLike has changed semantics in version 2.8.0:
+<console>:12: warning: method values in trait MapLike has changed semantics in version 2.8.0:
`values` returns `Iterable[B]` rather than `Iterator[B]`.
Map(1 -> "eis").values // warn
^
@@ -24,7 +24,7 @@ res3: Iterable[String] = MapLike(eis)
scala> :setting -Xmigration:2.7
scala> Map(1 -> "eis").values // warn
-<console>:11: warning: method values in trait MapLike has changed semantics in version 2.8.0:
+<console>:12: warning: method values in trait MapLike has changed semantics in version 2.8.0:
`values` returns `Iterable[B]` rather than `Iterator[B]`.
Map(1 -> "eis").values // warn
^
@@ -38,7 +38,7 @@ res5: Iterable[String] = MapLike(eis)
scala> :setting -Xmigration // same as :any
scala> Map(1 -> "eis").values // warn
-<console>:11: warning: method values in trait MapLike has changed semantics in version 2.8.0:
+<console>:12: warning: method values in trait MapLike has changed semantics in version 2.8.0:
`values` returns `Iterable[B]` rather than `Iterator[B]`.
Map(1 -> "eis").values // warn
^
diff --git a/test/files/scalacheck/range.scala b/test/files/scalacheck/range.scala
index 493083a51f..ac24b52f8d 100644
--- a/test/files/scalacheck/range.scala
+++ b/test/files/scalacheck/range.scala
@@ -134,7 +134,22 @@ abstract class RangeTest(kind: String) extends Properties("Range "+kind) {
val expected = r.length match {
case 0 => 0
case 1 => r.head
- case _ => ((r.head + r.last).toLong * r.length / 2).toInt
+ case x if x < 1000 =>
+ // Explicit sum, to guard against having the same mistake in both the
+ // range implementation and test implementation of sum formula.
+ // (Yes, this happened before.)
+ var i = r.head
+ var s = 0L
+ var n = x
+ while (n > 0) {
+ s += i
+ i += r.step
+ n -= 1
+ }
+ s.toInt
+ case _ =>
+ // Make sure head + last doesn't overflow!
+ ((r.head.toLong + r.last) * r.length / 2).toInt
}
// println("size: " + r.length)
// println("expected: " + expected)
diff --git a/test/junit/scala/collection/immutable/PagedSeqTest.scala b/test/junit/scala/collection/immutable/PagedSeqTest.scala
index 2b576a3655..74f8825307 100644
--- a/test/junit/scala/collection/immutable/PagedSeqTest.scala
+++ b/test/junit/scala/collection/immutable/PagedSeqTest.scala
@@ -13,6 +13,12 @@ class PagedSeqTest {
assertEquals(Seq('a'), PagedSeq.fromStrings(List.fill(5000)("a")).slice(4096, 4097))
}
+ // should not NPE, and should be empty
+ @Test
+ def test_SI9480(): Unit = {
+ assertEquals(Seq(), PagedSeq.fromStrings(List("a")).slice(1))
+ }
+
// Slices shouldn't read outside where they belong
@Test
def test_SI6519 {
diff --git a/test/junit/scala/collection/immutable/RangeConsistencyTest.scala b/test/junit/scala/collection/immutable/RangeConsistencyTest.scala
index 135796979d..760498c162 100644
--- a/test/junit/scala/collection/immutable/RangeConsistencyTest.scala
+++ b/test/junit/scala/collection/immutable/RangeConsistencyTest.scala
@@ -148,4 +148,28 @@ class RangeConsistencyTest {
val bdRange = bd(-10.0) until bd(0.0) by bd(4.5)
assert( bdRange sameElements List(bd(-10.0), bd(-5.5), bd(-1.0)) )
}
+
+ @Test
+ def test_SI9388() {
+ val possiblyNotDefaultNumeric = new scala.math.Numeric[Int] {
+ def fromInt(x: Int) = x
+ def minus(x: Int, y: Int): Int = x - y
+ def negate(x: Int): Int = -x
+ def plus(x: Int, y: Int): Int = x + y
+ def times(x: Int, y: Int): Int = x*y
+ def toDouble(x: Int): Double = x.toDouble
+ def toFloat(x: Int): Float = x.toFloat
+ def toInt(x: Int): Int = x
+ def toLong(x: Int): Long = x.toLong
+ def compare(x: Int, y: Int) = x compare y
+ }
+ val r = (Int.MinValue to Int.MaxValue by (1<<23))
+ val nr = NumericRange(Int.MinValue, Int.MaxValue, 1 << 23)
+ assert({ var i = 0; r.foreach(_ => i += 1); i } == 512)
+ assert({ var i = 0; nr.foreach(_ => i += 1); i } == 512)
+ assert(r.sum == Int.MinValue)
+ assert(nr.sum == Int.MinValue)
+ assert(r.sum(possiblyNotDefaultNumeric) == Int.MinValue)
+ assert(nr.sum(possiblyNotDefaultNumeric) == Int.MinValue)
+ }
}
diff --git a/test/junit/scala/collection/immutable/SetTests.scala b/test/junit/scala/collection/immutable/SetTests.scala
new file mode 100644
index 0000000000..28c7864359
--- /dev/null
+++ b/test/junit/scala/collection/immutable/SetTests.scala
@@ -0,0 +1,81 @@
+package scala.collection.immutable
+
+import org.junit.Assert._
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
+
+@RunWith(classOf[JUnit4])
+class SetTests {
+ @Test
+ def test_SI8346_toSet_soundness(): Unit = {
+ val any2stringadd = "Disabled string conversions so as not to get confused!"
+
+ def any[A](set: Set[A]): Set[Any] = {
+ val anyset = set.toSet[Any]
+ assert((anyset + "fish") contains "fish")
+ anyset
+ }
+
+ // Make sure default immutable Set does not rebuild itself on widening with toSet
+ // Need to cover 0, 1, 2, 3, 4 elements as special cases
+ var si = Set.empty[Int]
+ assert(si eq si.toSet[Any])
+ for (i <- 1 to 5) {
+ val s1 = Set(Array.range(1, i+1): _*)
+ val s2 = si + i
+ val s1a = any(s1)
+ val s2a = any(s2)
+ assert(s1 eq s1a)
+ assert(s2 eq s2a)
+ si = s2
+ }
+
+ // Make sure BitSet correctly rebuilds itself on widening with toSet
+ // Need to cover empty, values 0-63, values 0-127 as special cases
+ val bitsets = Seq(BitSet.empty, BitSet(23), BitSet(23, 99), BitSet(23, 99, 141))
+ bitsets.foreach{ b =>
+ val ba = any(b)
+ assert(b ne ba)
+ assertEquals(b, ba)
+ }
+
+ // Make sure HashSet (and by extension, its implementing class HashTrieSet)
+ // does not rebuild itself on widening by toSet
+ val hashset = HashSet(1, 3, 5, 7)
+ val hashseta = any(hashset)
+ assert(hashset eq hashseta)
+
+ // Make sure ListSet does not rebuild itself on widening by toSet
+ // (Covers Node also, since it subclasses ListSet)
+ val listset = ListSet(1, 3, 5, 7)
+ val listseta = any(listset)
+ assert(listset eq listseta)
+
+ // Make sure SortedSets correctly rebuild themselves on widening with toSet
+ // Covers TreeSet and keySet of SortedMap also
+ val sortedsets = Seq(
+ SortedSet.empty[Int], SortedSet(5), SortedSet(1,2,3,5,4),
+ SortedMap(1 -> "cod", 2 -> "herring").keySet
+ )
+ sortedsets.foreach{ set =>
+ val seta = any(set)
+ assert(set ne seta)
+ assertEquals(set, seta)
+ }
+
+ // Make sure ValueSets correctly rebuild themselves on widening with toSet
+ object WeekDay extends Enumeration {
+ type WeekDay = Value
+ val Mon, Tue, Wed, Thu, Fri, Sat, Sun = Value
+ }
+ val valuesa = any(WeekDay.values)
+ assert(WeekDay.values ne valuesa)
+ assertEquals(WeekDay.values, valuesa)
+
+ // Make sure regular Map keySets do not rebuild themselves on widening with toSet
+ val mapset = Map(1 -> "cod", 2 -> "herring").keySet
+ val mapseta = any(mapset)
+ assert(mapset eq mapseta)
+ }
+}
diff --git a/test/junit/scala/tools/nsc/backend/jvm/analysis/ProdConsAnalyzerTest.scala b/test/junit/scala/tools/nsc/backend/jvm/analysis/ProdConsAnalyzerTest.scala
index a5b3faced8..941a167114 100644
--- a/test/junit/scala/tools/nsc/backend/jvm/analysis/ProdConsAnalyzerTest.scala
+++ b/test/junit/scala/tools/nsc/backend/jvm/analysis/ProdConsAnalyzerTest.scala
@@ -204,7 +204,7 @@ class ProdConsAnalyzerTest extends ClearAfterClass {
def iincProdCons(): Unit = {
import Opcodes._
val m = genMethod(descriptor = "(I)I")(
- Incr(IINC, 1, 1), // producer and cosumer of local variable 1
+ Incr(IINC, 1, 1), // producer and consumer of local variable 1
VarOp(ILOAD, 1),
Op(IRETURN)
)
diff --git a/test/junit/scala/tools/nsc/interpreter/CompletionTest.scala b/test/junit/scala/tools/nsc/interpreter/CompletionTest.scala
new file mode 100644
index 0000000000..78ebb7cf9c
--- /dev/null
+++ b/test/junit/scala/tools/nsc/interpreter/CompletionTest.scala
@@ -0,0 +1,180 @@
+package scala.tools.nsc.interpreter
+
+import java.io.{StringWriter, PrintWriter}
+
+import org.junit.Assert.assertEquals
+import org.junit.Test
+
+import scala.tools.nsc.Settings
+
+class CompletionTest {
+ val EmptyString = "" // def string results include the empty string so that JLine won't insert "def ..." at the cursor
+
+ def newIMain(): IMain = {
+ val settings = new Settings()
+ settings.Xnojline.value = true
+ settings.usejavacp.value = true
+
+ val writer = new StringWriter
+ val out = new PrintWriter(writer)
+ new IMain(settings, out)
+ }
+ @Test
+ def t4438_arrayCompletion(): Unit = {
+ val intp = newIMain()
+ val completer = new PresentationCompilerCompleter(intp)
+ assert(completer.complete("Array(1, 2, 3) rev").candidates.contains("reverseMap"))
+ }
+
+ @Test
+ def completions(): Unit = {
+ val intp = newIMain()
+ val completer = new PresentationCompilerCompleter(intp)
+ checkExact(completer, "object O { def x_y_z = 1 }; import O._; x_y")("x_y_z")
+ checkExact(completer, "object O { private def x_y_z = 1 }; import O._; x_y")()
+ checkExact(completer, "object O { private def x_y_z = 1; x_y", "}")("x_y_z")
+ checkExact(completer, "object x_y_z; import x_y")("x_y_z")
+
+ checkExact(completer, "object x_y_z { def a_b_c }; import x_y_z.a_b")("a_b_c")
+
+ checkExact(completer, "object X { private[this] def definition = 0; def")("definition")
+
+ // stable terms are offered in type completion as they might be used as a prefix
+ checkExact(completer, """object O { def x_y_z = 0; val x_z_y = ""; type T = x_""")("x_z_y")
+ checkExact(completer, """def method { def x_y_z = 0; val x_z_y = ""; type T = x_""")("x_z_y")
+
+ // We exclude inherited members of the synthetic interpreter wrapper classes
+ checkExact(completer, """asInstanceO""")()
+ checkExact(completer, """class C { asInstanceO""")("asInstanceOf")
+
+ // Output is sorted
+ assertEquals(List("prefix_aaa", "prefix_nnn", "prefix_zzz"), completer.complete( """class C { def prefix_nnn = 0; def prefix_zzz = 0; def prefix_aaa = 0; prefix_""").candidates)
+ }
+
+ @Test
+ def annotations(): Unit = {
+ val intp = newIMain()
+ val completer = new PresentationCompilerCompleter(intp)
+ checkExact(completer, "def foo[@specialize", " A]")("specialized")
+ checkExact(completer, "def foo[@specialize")("specialized")
+ checkExact(completer, """@deprecatedN""", """ class Foo""")("deprecatedName")
+ checkExact(completer, """@deprecateN""")("deprecatedName")
+ checkExact(completer, """{@deprecateN""")("deprecatedName")
+ }
+
+ @Test
+ def incompleteStringInterpolation(): Unit = {
+ val intp = newIMain()
+ val completer = new PresentationCompilerCompleter(intp)
+ checkExact(completer, """val x_y_z = 1; s"${x_""", "}\"")("x_y_z")
+ checkExact(completer, """val x_y_z = 1; s"${x_""", "\"")("x_y_z")
+ }
+
+ @Test
+ def symbolically(): Unit = {
+ val intp = newIMain()
+ val completer = new PresentationCompilerCompleter(intp)
+ checkExact(completer, """class C { def +++(a: Any) = 0; def ---(a: Any) = 0; this.++""")("+++")
+ }
+
+ @Test
+ def camelCompletions(): Unit = {
+ val intp = newIMain()
+ val completer = new PresentationCompilerCompleter(intp)
+ checkExact(completer, "object O { def theCatSatOnTheMat = 1 }; import O._; tCSO")("theCatSatOnTheMat")
+ checkExact(completer, "object O { def getBlerganator = 1 }; import O._; blerga")("getBlerganator")
+ checkExact(completer, "object O { def xxxxYyyyyZzzz = 1; def xxxxYyZeee = 1 }; import O._; xYZ")("", "xxxxYyyyyZzzz", "xxxxYyZeee")
+ checkExact(completer, "object O { def xxxxYyyyyZzzz = 1; def xxxxYyyyyZeee = 1 }; import O._; xYZ")("xxxxYyyyyZzzz", "xxxxYyyyyZeee")
+ checkExact(completer, "object O { class AbstractMetaFactoryFactory }; new O.AMFF")("AbstractMetaFactoryFactory")
+ }
+
+ @Test
+ def lenientCamelCompletions(): Unit = {
+ val intp = newIMain()
+ val completer = new PresentationCompilerCompleter(intp)
+ checkExact(completer, "object O { def theCatSatOnTheMat = 1 }; import O._; tcso")("theCatSatOnTheMat")
+ checkExact(completer, "object O { def theCatSatOnTheMat = 1 }; import O._; sotm")("theCatSatOnTheMat")
+ checkExact(completer, "object O { def theCatSatOnTheMat = 1 }; import O._; TCSOTM")()
+ }
+
+ @Test
+ def previousLineCompletions(): Unit = {
+ val intp = newIMain()
+ intp.interpret("class C { val x_y_z = 42 }")
+ intp.interpret("object O { type T = Int }")
+
+ val completer = new PresentationCompilerCompleter(intp)
+
+ checkExact(completer, "new C().x_y")("x_y_z")
+ checkExact(completer, "(1 : O.T).toCha")("toChar")
+
+ intp.interpret("case class X_y_z()")
+ val completer1 = new PresentationCompilerCompleter(intp)
+ checkExact(completer1, "new X_y_")("X_y_z")
+ checkExact(completer1, "X_y_")("X_y_z")
+ checkExact(completer1, "X_y_z.app")("apply")
+ }
+
+ @Test
+ def previousResultInvocation(): Unit = {
+ val intp = newIMain()
+ intp.interpret("1 + 1")
+
+ val completer = new PresentationCompilerCompleter(intp)
+
+ checkExact(completer, ".toCha")("toChar")
+ }
+
+ @Test
+ def defString(): Unit = {
+ val intp = newIMain()
+ val completer = new PresentationCompilerCompleter(intp)
+
+ // Double Tab on a fully typed selection shows the def string
+ checkExact(completer, "(p: {def a_b_c: Int}) => p.a_b_c")()
+ checkExact(completer, "(p: {def a_b_c: Int}) => p.a_b_c")(EmptyString, "def a_b_c: Int")
+
+ // likewise for an ident
+ checkExact(completer, "(p: {def x_y_z: Int}) => {import p._; x_y_z")()
+ checkExact(completer, "(p: {def x_y_z: Int}) => {import p._; x_y_z")(EmptyString, "def x_y_z: Int")
+
+ // If the first completion only gives one alternative
+ checkExact(completer, "(p: {def x_y_z: Int; def x_y_z(a: String): Int }) => p.x_y")("x_y_z")
+ // ... it is automatically inserted into the buffer. Hitting <TAB> again is triggers the help
+ checkExact(completer, "(p: {def x_y_z: Int; def x_y_z(a: String): Int }) => p.x_y_z")(EmptyString, "def x_y_z(a: String): Int", "def x_y_z: Int")
+
+ checkExact(completer, "(p: {def x_y_z: Int; def x_z_y(a: String): Int }) => p.x_")("x_y_z", "x_z_y")
+ // By contrast, in this case the user had to type "y_z" manually, so no def string printing just yet
+ checkExact(completer, "(p: {def x_y_z: Int; def x_z_y(a: String): Int }) => p.x_y_z")()
+ // Another <TAB>, Okay, time to print.
+ checkExact(completer, "(p: {def x_y_z: Int; def x_z_y(a: String): Int }) => p.x_y_z")(EmptyString, "def x_y_z: Int")
+
+ // The def string reconstructs the source-level modifiers (rather than showing the desugarings of vals),
+ // and performs as-seen-from with respect to the prefix
+ checkExact(completer, "trait T[A]{ lazy val x_y_z: A }; class C extends T[Int] { x_y_z")()
+ checkExact(completer, "trait T[A]{ lazy val x_y_z: A }; class C extends T[Int] { x_y_z")(EmptyString, "lazy val x_y_z: Int")
+
+ checkExact(completer, "trait T[A] { def foo: A }; (t: T[Int]) => t.foo")()
+ checkExact(completer, "trait T[A] { def foo: A }; (t: T[Int]) => t.foo")(EmptyString, "def foo: Int")
+ }
+
+ @Test
+ def treePrint(): Unit = {
+ val intp = newIMain()
+ val completer = new PresentationCompilerCompleter(intp)
+ checkExact(completer, " 1.toHexString //print")(EmptyString, "scala.Predef.intWrapper(1).toHexString // : String")
+ }
+
+ @Test
+ def firstCompletionWithNoPrefixHidesUniversalMethodsAndExtensionMethods(): Unit = {
+ val intp = newIMain()
+ val completer = new PresentationCompilerCompleter(intp)
+ checkExact(completer, "class C(val a: Int, val b: Int) { this.")("a", "b")
+ assert(Set("asInstanceOf", "==").diff(completer.complete("class C(val a: Int, val b: Int) { this.").candidates.toSet).isEmpty)
+ checkExact(completer, "case class D(a: Int, b: Int) { this.a")("a", "asInstanceOf")
+ }
+
+ def checkExact(completer: PresentationCompilerCompleter, before: String, after: String = "")(expected: String*): Unit = {
+ assertEquals(expected.toSet, completer.complete(before, after).candidates.toSet)
+ }
+}
diff --git a/test/partest b/test/partest
index f396459c6d..8b827f276f 100755
--- a/test/partest
+++ b/test/partest
@@ -112,7 +112,6 @@ if $cygwin; then
JAVAC_CMD=`cygpath --$format "$JAVAC_CMD"`
fi
SCALA_HOME=`cygpath --$format "$SCALA_HOME"`
- PARTEST_CLASSPATH=`cygpath --path --$format "$PARTEST_CLASSPATH"`
fi
# last arg wins, so if JAVA_OPTS already contains -Xmx or -Xms the
diff --git a/test/partest.bat b/test/partest.bat
deleted file mode 100755
index 1806e80888..0000000000
--- a/test/partest.bat
+++ /dev/null
@@ -1,104 +0,0 @@
-@echo off
-
-rem ##########################################################################
-rem # Scala code runner 2.9.1.final
-rem ##########################################################################
-rem # (c) 2002-2013 LAMP/EPFL
-rem #
-rem # This is free software; see the distribution for copying conditions.
-rem # There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
-rem # PARTICULAR PURPOSE.
-rem ##########################################################################
-
-rem We adopt the following conventions:
-rem - System/user environment variables start with a letter
-rem - Local batch variables start with an underscore ('_')
-
-if "%OS%"=="Windows_NT" (
- @setlocal
- call :set_home
- set _ARGS=%*
-) else (
- set _SCALA_HOME="%SCALA_HOME%"
- rem The following line tests SCALA_HOME instead of _SCALA_HOME, because
- rem the above change to _SCALA_HOME is not visible within this block.
- if "%SCALA_HOME%"=="" goto error1
- call :set_args
-)
-
-rem We use the value of the JAVACMD environment variable if defined
-set _JAVACMD=%JAVACMD%
-if "%_JAVACMD%"=="" set _JAVACMD=java
-
-rem We use the value of the JAVACCMD environment variable if defined
-set _JAVACCMD=%JAVACCMD%
-if "%_JAVACCMD%"=="" set _JAVACCMD=javac
-
-rem We use the value of the JAVA_OPTS environment variable if defined
-set _JAVA_OPTS=%JAVA_OPTS%
-if "%_JAVA_OPTS%"=="" set _JAVA_OPTS=-Xmx1024M -Xms64M
-
-rem We use the value of the SCALAC_OPTS environment variable if defined
-set _SCALAC_OPTS=%SCALAC_OPTS%
-if "%_SCALAC_OPTS%"=="" set _SCALAC_OPTS=-deprecation
-
-set _EXTENSION_CLASSPATH=
-if "%_EXTENSION_CLASSPATH%"=="" (
- if exist "%_SCALA_HOME%\lib\scala-partest.jar" (
- for %%f in ("%_SCALA_HOME%\lib\*") do call :add_cpath "%%f"
- if "%OS%"=="Windows_NT" (
- for /d %%f in ("%_SCALA_HOME%\lib\*") do call :add_cpath "%%f"
- )
- ) else if exist "%_SCALA_HOME%\build\pack\lib\scala-partest.jar" (
- for %%f in ("%_SCALA_HOME%\build\pack\lib\*") do call :add_cpath "%%f"
- if "%OS%"=="Windows_NT" (
- for /d %%f in ("%_SCALA_HOME%\build\pack\lib\*") do call :add_cpath "%%f"
- )
- )
-)
-
-set _PROPS=-Dscala.home="%_SCALA_HOME%" -Dpartest.javacmd="%_JAVACMD%" -Dpartest.java_options="%_JAVA_OPTS%" -Dpartest.scalac_options="%_SCALAC_OPTS%" -Dpartest.javac_cmd="%_JAVACCMD%"
-
-rem echo %_JAVACMD% %_JAVA_OPTS% %_PROPS% -cp "%_EXTENSION_CLASSPATH%" scala.tools.partest.nest.NestRunner %_ARGS%
-%_JAVACMD% %_JAVA_OPTS% %_PROPS% -cp "%_EXTENSION_CLASSPATH%" scala.tools.partest.nest.NestRunner %_ARGS%
-goto end
-
-rem ##########################################################################
-rem # subroutines
-
-:add_cpath
- if "%_EXTENSION_CLASSPATH%"=="" (
- set _EXTENSION_CLASSPATH=%~1
- ) else (
- set _EXTENSION_CLASSPATH=%_EXTENSION_CLASSPATH%;%~1
- )
-goto :eof
-
-rem Variable "%~dps0" works on WinXP SP2 or newer
-rem (see http://support.microsoft.com/?kbid=833431)
-rem set _SCALA_HOME=%~dps0..
-:set_home
- set _BIN_DIR=
- for %%i in (%~sf0) do set _BIN_DIR=%_BIN_DIR%%%~dpsi
- set _SCALA_HOME=%_BIN_DIR%..
-goto :eof
-
-:set_args
- set _ARGS=
- :loop
- rem Argument %1 may contain quotes so we use parentheses here
- if (%1)==() goto :eof
- set _ARGS=%_ARGS% %1
- shift
- goto loop
-
-rem ##########################################################################
-rem # errors
-
-:error1
-echo ERROR: environment variable SCALA_HOME is undefined. It should point to your installation directory.
-goto end
-
-:end
-if "%OS%"=="Windows_NT" @endlocal
-exit /b %errorlevel%
diff --git a/test/pending/run/t3609.scala b/test/pending/run/t3609.scala
index eb25afd667..eb25afd667 100755..100644
--- a/test/pending/run/t3609.scala
+++ b/test/pending/run/t3609.scala
diff --git a/test/scaladoc/run/SI-191.check b/test/scaladoc/run/SI-191.check
index 3925a0d464..3925a0d464 100755..100644
--- a/test/scaladoc/run/SI-191.check
+++ b/test/scaladoc/run/SI-191.check
diff --git a/test/scaladoc/run/SI-191.scala b/test/scaladoc/run/SI-191.scala
index 29b1e7dd29..29b1e7dd29 100755..100644
--- a/test/scaladoc/run/SI-191.scala
+++ b/test/scaladoc/run/SI-191.scala
diff --git a/test/scaladoc/run/SI-7367.check b/test/scaladoc/run/SI-7367.check
index 3925a0d464..3925a0d464 100755..100644
--- a/test/scaladoc/run/SI-7367.check
+++ b/test/scaladoc/run/SI-7367.check
diff --git a/test/scaladoc/run/SI-7367.scala b/test/scaladoc/run/SI-7367.scala
index 6e5a317932..6e5a317932 100755..100644
--- a/test/scaladoc/run/SI-7367.scala
+++ b/test/scaladoc/run/SI-7367.scala
diff --git a/test/scaladoc/run/SI-8479.scala b/test/scaladoc/run/SI-8479.scala
index 3c91395025..3c91395025 100755..100644
--- a/test/scaladoc/run/SI-8479.scala
+++ b/test/scaladoc/run/SI-8479.scala
diff --git a/test/script-tests/README b/test/script-tests/README
index 7b3291c407..7b3291c407 100755..100644
--- a/test/script-tests/README
+++ b/test/script-tests/README