summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
Diffstat (limited to 'test/files')
-rw-r--r--test/files/jvm/serialization-new.check24
-rw-r--r--test/files/jvm/serialization-new.scala24
-rw-r--r--test/files/jvm/serialization.check24
-rw-r--r--test/files/jvm/serialization.scala24
-rw-r--r--test/files/lib/javac-artifacts.jar.desired.sha11
-rw-r--r--test/files/neg/applydynamic_sip.check50
-rw-r--r--test/files/neg/applydynamic_sip.flags1
-rw-r--r--test/files/neg/applydynamic_sip.scala25
-rw-r--r--test/files/neg/no-implicit-to-anyref.check28
-rw-r--r--test/files/neg/no-implicit-to-anyref.scala29
-rw-r--r--test/files/neg/reify_ann2b.scala2
-rw-r--r--test/files/neg/reify_metalevel_breach_+0_refers_to_1.scala2
-rw-r--r--test/files/neg/reify_metalevel_breach_-1_refers_to_0_a.scala2
-rw-r--r--test/files/neg/reify_metalevel_breach_-1_refers_to_0_b.scala2
-rw-r--r--test/files/neg/reify_metalevel_breach_-1_refers_to_1.scala2
-rw-r--r--test/files/neg/reify_nested_inner_refers_to_local.scala2
-rw-r--r--test/files/neg/static-annot.check22
-rw-r--r--test/files/neg/static-annot.scala53
-rw-r--r--test/files/neg/t2296a.check5
-rw-r--r--test/files/neg/t2296a/J.java (renamed from test/files/run/t2296a/J.java)0
-rw-r--r--test/files/neg/t2296a/S.scala (renamed from test/files/run/t2296a/S.scala)0
-rw-r--r--test/files/neg/t2296b.check5
-rw-r--r--test/files/neg/t2296b/J_1.java (renamed from test/files/run/t2296b/J_1.java)0
-rw-r--r--test/files/neg/t2296b/S_2.scala (renamed from test/files/run/t2296b/S_2.scala)0
-rw-r--r--test/files/neg/t4581/static-declaration_1.scala14
-rw-r--r--test/files/neg/t4581/static_2.java15
-rw-r--r--test/files/neg/t5692a.check4
-rw-r--r--test/files/neg/t5692a.flags1
-rw-r--r--test/files/neg/t5692a/Macros_1.scala6
-rw-r--r--test/files/neg/t5692a/Test_2.scala3
-rw-r--r--test/files/neg/t5692b.check4
-rw-r--r--test/files/neg/t5692b.flags1
-rw-r--r--test/files/neg/t5692b/Macros_1.scala6
-rw-r--r--test/files/neg/t5692b/Test_2.scala3
-rw-r--r--test/files/neg/t6336.check4
-rw-r--r--test/files/neg/t6336.scala11
-rw-r--r--test/files/pos/t4579.scala16
-rw-r--r--test/files/pos/t6245/Base.java5
-rw-r--r--test/files/pos/t6245/Foo.scala9
-rw-r--r--test/files/pos/t6245/Vis.java3
-rw-r--r--test/files/pos/t6294.scala14
-rw-r--r--test/files/run/applydynamic_sip.check7
-rw-r--r--test/files/run/applydynamic_sip.scala10
-rw-r--r--test/files/run/collections.check8
-rw-r--r--test/files/run/collections.scala2
-rw-r--r--test/files/run/colltest.check1
-rw-r--r--test/files/run/colltest.scala3
-rw-r--r--test/files/run/colltest1.check2
-rw-r--r--test/files/run/colltest1.scala2
-rw-r--r--test/files/run/empty-array.check3
-rw-r--r--test/files/run/empty-array.scala8
-rw-r--r--test/files/run/macro-abort-fresh/Test_2.scala2
-rw-r--r--test/files/run/macro-def-infer-return-type-b/Test_2.scala2
-rw-r--r--test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Macros_Test_2.scala2
-rw-r--r--test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Test_2.scala2
-rw-r--r--test/files/run/macro-invalidret-nontypeable/Test_2.scala2
-rw-r--r--test/files/run/macro-invalidusage-badret/Test_2.scala2
-rw-r--r--test/files/run/macro-invalidusage-partialapplication-with-tparams/Test_2.scala2
-rw-r--r--test/files/run/macro-invalidusage-partialapplication/Test_2.scala2
-rw-r--r--test/files/run/macro-reflective-ma-normal-mdmi/Test_2.scala2
-rw-r--r--test/files/run/macro-reflective-mamd-normal-mi/Macros_Test_2.scala2
-rw-r--r--test/files/run/macro-reify-freevars/Test_2.scala2
-rw-r--r--test/files/run/macro-reify-splice-outside-reify/Impls_Macros_1.scala2
-rw-r--r--test/files/run/macro-reify-splice-outside-reify/Test_2.scala2
-rw-r--r--test/files/run/macro-reify-tagless-a/Test_2.scala2
-rw-r--r--test/files/run/reflection-implicit.check2
-rw-r--r--test/files/run/reflection-implicit.scala15
-rw-r--r--test/files/run/reflection-java-annotations.check1
-rw-r--r--test/files/run/reflection-java-annotations.scala7
-rw-r--r--test/files/run/reflection-java-crtp.check1
-rw-r--r--test/files/run/reflection-java-crtp.scala8
-rw-r--r--test/files/run/reify_ann1a.scala2
-rw-r--r--test/files/run/reify_ann1b.scala2
-rw-r--r--test/files/run/reify_ann2a.scala2
-rw-r--r--test/files/run/reify_ann3.scala2
-rw-r--r--test/files/run/reify_ann4.scala2
-rw-r--r--test/files/run/reify_ann5.scala2
-rw-r--r--test/files/run/reify_classfileann_a.scala2
-rw-r--r--test/files/run/reify_classfileann_b.scala2
-rw-r--r--test/files/run/reify_closure1.scala2
-rw-r--r--test/files/run/reify_closure2a.scala2
-rw-r--r--test/files/run/reify_closure3a.scala2
-rw-r--r--test/files/run/reify_closure4a.scala2
-rw-r--r--test/files/run/reify_closure5a.scala2
-rw-r--r--test/files/run/reify_closure6.scala2
-rw-r--r--test/files/run/reify_closure7.scala2
-rw-r--r--test/files/run/reify_closure8a.scala2
-rw-r--r--test/files/run/reify_closure8b.scala2
-rw-r--r--test/files/run/reify_closures10.scala2
-rw-r--r--test/files/run/reify_copypaste1.scala6
-rw-r--r--test/files/run/reify_getter.scala2
-rw-r--r--test/files/run/reify_metalevel_breach_+0_refers_to_1.scala2
-rw-r--r--test/files/run/reify_metalevel_breach_-1_refers_to_0_a.scala2
-rw-r--r--test/files/run/reify_metalevel_breach_-1_refers_to_0_b.scala2
-rw-r--r--test/files/run/reify_metalevel_breach_-1_refers_to_1.scala2
-rw-r--r--test/files/run/reify_nested_inner_refers_to_global.scala2
-rw-r--r--test/files/run/reify_nested_inner_refers_to_local.scala2
-rw-r--r--test/files/run/reify_nested_outer_refers_to_global.scala2
-rw-r--r--test/files/run/reify_nested_outer_refers_to_local.scala2
-rw-r--r--test/files/run/reify_newimpl_45.scala2
-rw-r--r--test/files/run/reify_printf.scala2
-rw-r--r--test/files/run/reify_typerefs_1a.scala2
-rw-r--r--test/files/run/reify_typerefs_1b.scala2
-rw-r--r--test/files/run/reify_typerefs_2a.scala2
-rw-r--r--test/files/run/reify_typerefs_2b.scala2
-rw-r--r--test/files/run/reify_typerefs_3a.scala2
-rw-r--r--test/files/run/reify_typerefs_3b.scala2
-rw-r--r--test/files/run/static-annot-repl.check38
-rw-r--r--test/files/run/static-annot-repl.scala22
-rw-r--r--test/files/run/static-annot/field.scala252
-rw-r--r--test/files/run/t2296a.check2
-rw-r--r--test/files/run/t2296b.check2
-rw-r--r--test/files/run/t5229_2.scala2
-rw-r--r--test/files/run/t5230.scala2
-rw-r--r--test/files/run/t5266_1.scala2
-rw-r--r--test/files/run/t5266_2.scala2
-rw-r--r--test/files/run/t5334_1.scala2
-rw-r--r--test/files/run/t5334_2.scala2
-rw-r--r--test/files/run/t5770.check10
-rw-r--r--test/files/run/t5770.scala25
-rw-r--r--test/files/run/t5942.check (renamed from test/files/neg/t4581.check)0
-rw-r--r--test/files/run/t5942.scala10
-rw-r--r--test/files/run/t6199-toolbox.scala2
-rw-r--r--test/files/run/t6236.check2
-rw-r--r--test/files/run/t6236/file_1.scala9
-rw-r--r--test/files/run/t6236/file_2.scala10
-rw-r--r--test/files/run/t6287.check3
-rw-r--r--test/files/run/t6287.scala11
-rw-r--r--test/files/run/t6329_repl.check13
-rw-r--r--test/files/run/t6329_repl.scala8
-rw-r--r--test/files/run/t6329_repl_bug.check13
-rw-r--r--test/files/run/t6329_repl_bug.pending10
-rw-r--r--test/files/run/t6329_vanilla.check2
-rw-r--r--test/files/run/t6329_vanilla.scala4
-rw-r--r--test/files/run/t6329_vanilla_bug.check2
-rw-r--r--test/files/run/t6329_vanilla_bug.pending7
-rw-r--r--test/files/run/t6353.check1
-rw-r--r--test/files/run/t6353.scala12
-rw-r--r--test/files/run/toolbox_console_reporter.scala2
-rw-r--r--test/files/run/toolbox_default_reporter_is_silent.scala2
-rw-r--r--test/files/run/toolbox_silent_reporter.scala2
-rw-r--r--test/files/scalacheck/redblacktree.scala42
142 files changed, 621 insertions, 539 deletions
diff --git a/test/files/jvm/serialization-new.check b/test/files/jvm/serialization-new.check
index fa51c6a879..f886cfe29c 100644
--- a/test/files/jvm/serialization-new.check
+++ b/test/files/jvm/serialization-new.check
@@ -168,6 +168,30 @@ x = History()
y = History()
x equals y: true, y equals x: true
+x = Map(Linked -> 1, Hash -> 2, Map -> 3)
+y = Map(Linked -> 1, Hash -> 2, Map -> 3)
+x equals y: true, y equals x: true
+
+x = ArrayBuffer((Linked,1), (Hash,2), (Map,3))
+y = ArrayBuffer((Linked,1), (Hash,2), (Map,3))
+x equals y: true, y equals x: true
+
+x = ArrayBuffer((Linked,1), (Hash,2), (Map,3))
+y = List((Linked,1), (Hash,2), (Map,3))
+x equals y: true, y equals x: true
+
+x = Set(layers, buffers, title)
+y = Set(layers, buffers, title)
+x equals y: true, y equals x: true
+
+x = ArrayBuffer(layers, buffers, title)
+y = ArrayBuffer(layers, buffers, title)
+x equals y: true, y equals x: true
+
+x = ArrayBuffer(layers, buffers, title)
+y = List(layers, buffers, title)
+x equals y: true, y equals x: true
+
x = ListBuffer(white, black)
y = ListBuffer(white, black)
x equals y: true, y equals x: true
diff --git a/test/files/jvm/serialization-new.scala b/test/files/jvm/serialization-new.scala
index 91eb52928f..1522fc8e27 100644
--- a/test/files/jvm/serialization-new.scala
+++ b/test/files/jvm/serialization-new.scala
@@ -285,8 +285,8 @@ object Test3_mutable {
import scala.reflect.ClassTag
import scala.collection.mutable.{
ArrayBuffer, ArrayBuilder, ArraySeq, ArrayStack, BitSet, DoubleLinkedList,
- HashMap, HashSet, History, LinkedList, ListBuffer, Publisher, Queue,
- Stack, StringBuilder, WrappedArray, TreeSet}
+ HashMap, HashSet, History, LinkedHashMap, LinkedHashSet, LinkedList, ListBuffer,
+ Publisher, Queue, Stack, StringBuilder, WrappedArray, TreeSet}
import scala.collection.concurrent.TrieMap
// in alphabetic order
@@ -346,6 +346,26 @@ object Test3_mutable {
val h1 = new History[String, Int]
val _h1: History[String, Int] = read(write(h1))
check(h1, _h1)
+
+ // LinkedHashMap
+ { val lhm1 = new LinkedHashMap[String, Int]
+ val list = List(("Linked", 1), ("Hash", 2), ("Map", 3))
+ lhm1 ++= list.iterator
+ val _lhm1: LinkedHashMap[String, Int] = read(write(lhm1))
+ check(lhm1, _lhm1)
+ check(lhm1.toSeq, _lhm1.toSeq) // check elements order
+ check(lhm1.toSeq, list) // check elements order
+ }
+
+ // LinkedHashSet
+ { val lhs1 = new LinkedHashSet[String]
+ val list = List("layers", "buffers", "title")
+ lhs1 ++= list.iterator
+ val _lhs1: LinkedHashSet[String] = read(write(lhs1))
+ check(lhs1, _lhs1)
+ check(lhs1.toSeq, _lhs1.toSeq) // check elements order
+ check(lhs1.toSeq, list) // check elements order
+ }
/*
// LinkedList
val ll1 = new LinkedList[Int](2, null)
diff --git a/test/files/jvm/serialization.check b/test/files/jvm/serialization.check
index fa51c6a879..f886cfe29c 100644
--- a/test/files/jvm/serialization.check
+++ b/test/files/jvm/serialization.check
@@ -168,6 +168,30 @@ x = History()
y = History()
x equals y: true, y equals x: true
+x = Map(Linked -> 1, Hash -> 2, Map -> 3)
+y = Map(Linked -> 1, Hash -> 2, Map -> 3)
+x equals y: true, y equals x: true
+
+x = ArrayBuffer((Linked,1), (Hash,2), (Map,3))
+y = ArrayBuffer((Linked,1), (Hash,2), (Map,3))
+x equals y: true, y equals x: true
+
+x = ArrayBuffer((Linked,1), (Hash,2), (Map,3))
+y = List((Linked,1), (Hash,2), (Map,3))
+x equals y: true, y equals x: true
+
+x = Set(layers, buffers, title)
+y = Set(layers, buffers, title)
+x equals y: true, y equals x: true
+
+x = ArrayBuffer(layers, buffers, title)
+y = ArrayBuffer(layers, buffers, title)
+x equals y: true, y equals x: true
+
+x = ArrayBuffer(layers, buffers, title)
+y = List(layers, buffers, title)
+x equals y: true, y equals x: true
+
x = ListBuffer(white, black)
y = ListBuffer(white, black)
x equals y: true, y equals x: true
diff --git a/test/files/jvm/serialization.scala b/test/files/jvm/serialization.scala
index 9c2f2acdbf..34b64938b4 100644
--- a/test/files/jvm/serialization.scala
+++ b/test/files/jvm/serialization.scala
@@ -285,8 +285,8 @@ object Test3_mutable {
import scala.reflect.ClassManifest
import scala.collection.mutable.{
ArrayBuffer, ArrayBuilder, ArraySeq, ArrayStack, BitSet, DoubleLinkedList,
- HashMap, HashSet, History, LinkedList, ListBuffer, Publisher, Queue,
- Stack, StringBuilder, WrappedArray, TreeSet}
+ HashMap, HashSet, History, LinkedHashMap, LinkedHashSet, LinkedList, ListBuffer,
+ Publisher, Queue, Stack, StringBuilder, WrappedArray, TreeSet}
import scala.collection.concurrent.TrieMap
// in alphabetic order
@@ -346,6 +346,26 @@ object Test3_mutable {
val h1 = new History[String, Int]
val _h1: History[String, Int] = read(write(h1))
check(h1, _h1)
+
+ // LinkedHashMap
+ { val lhm1 = new LinkedHashMap[String, Int]
+ val list = List(("Linked", 1), ("Hash", 2), ("Map", 3))
+ lhm1 ++= list.iterator
+ val _lhm1: LinkedHashMap[String, Int] = read(write(lhm1))
+ check(lhm1, _lhm1)
+ check(lhm1.toSeq, _lhm1.toSeq) // check elements order
+ check(lhm1.toSeq, list) // check elements order
+ }
+
+ // LinkedHashSet
+ { val lhs1 = new LinkedHashSet[String]
+ val list = List("layers", "buffers", "title")
+ lhs1 ++= list.iterator
+ val _lhs1: LinkedHashSet[String] = read(write(lhs1))
+ check(lhs1, _lhs1)
+ check(lhs1.toSeq, _lhs1.toSeq) // check elements order
+ check(lhs1.toSeq, list) // check elements order
+ }
/*
// LinkedList
val ll1 = new LinkedList[Int](2, null)
diff --git a/test/files/lib/javac-artifacts.jar.desired.sha1 b/test/files/lib/javac-artifacts.jar.desired.sha1
new file mode 100644
index 0000000000..8dbbc1d451
--- /dev/null
+++ b/test/files/lib/javac-artifacts.jar.desired.sha1
@@ -0,0 +1 @@
+c5788c5e518eb267445c5a995fd98b2210f90a58 ?javac-artifacts.jar
diff --git a/test/files/neg/applydynamic_sip.check b/test/files/neg/applydynamic_sip.check
index 8845f68a52..dcf97b29fc 100644
--- a/test/files/neg/applydynamic_sip.check
+++ b/test/files/neg/applydynamic_sip.check
@@ -7,4 +7,52 @@ applydynamic_sip.scala:8: error: applyDynamicNamed does not support passing a va
applydynamic_sip.scala:9: error: applyDynamicNamed does not support passing a vararg parameter
qual.sel(arg, arg2 = "a2", a2: _*)
^
-three errors found
+applydynamic_sip.scala:18: error: type mismatch;
+ found : String("sel")
+ required: Int
+error after rewriting to Test.this.bad1.selectDynamic("sel")
+possible cause: maybe a wrong Dynamic method signature?
+ bad1.sel
+ ^
+applydynamic_sip.scala:19: error: type mismatch;
+ found : String("sel")
+ required: Int
+error after rewriting to Test.this.bad1.applyDynamic("sel")
+possible cause: maybe a wrong Dynamic method signature?
+ bad1.sel(1)
+ ^
+applydynamic_sip.scala:20: error: type mismatch;
+ found : String("sel")
+ required: Int
+error after rewriting to Test.this.bad1.applyDynamicNamed("sel")
+possible cause: maybe a wrong Dynamic method signature?
+ bad1.sel(a = 1)
+ ^
+applydynamic_sip.scala:21: error: type mismatch;
+ found : String("sel")
+ required: Int
+error after rewriting to Test.this.bad1.updateDynamic("sel")
+possible cause: maybe a wrong Dynamic method signature?
+ bad1.sel = 1
+ ^
+applydynamic_sip.scala:29: error: Int does not take parameters
+error after rewriting to Test.this.bad2.selectDynamic("sel")
+possible cause: maybe a wrong Dynamic method signature?
+ bad2.sel
+ ^
+applydynamic_sip.scala:30: error: Int does not take parameters
+error after rewriting to Test.this.bad2.applyDynamic("sel")
+possible cause: maybe a wrong Dynamic method signature?
+ bad2.sel(1)
+ ^
+applydynamic_sip.scala:31: error: Int does not take parameters
+error after rewriting to Test.this.bad2.applyDynamicNamed("sel")
+possible cause: maybe a wrong Dynamic method signature?
+ bad2.sel(a = 1)
+ ^
+applydynamic_sip.scala:32: error: Int does not take parameters
+error after rewriting to Test.this.bad2.updateDynamic("sel")
+possible cause: maybe a wrong Dynamic method signature?
+ bad2.sel = 1
+ ^
+11 errors found
diff --git a/test/files/neg/applydynamic_sip.flags b/test/files/neg/applydynamic_sip.flags
new file mode 100644
index 0000000000..1141f97507
--- /dev/null
+++ b/test/files/neg/applydynamic_sip.flags
@@ -0,0 +1 @@
+-language:dynamics
diff --git a/test/files/neg/applydynamic_sip.scala b/test/files/neg/applydynamic_sip.scala
index 362461577b..ee4432ebe6 100644
--- a/test/files/neg/applydynamic_sip.scala
+++ b/test/files/neg/applydynamic_sip.scala
@@ -7,4 +7,27 @@ object Test extends App {
qual.sel(a, a2: _*)
qual.sel(arg = a, a2: _*)
qual.sel(arg, arg2 = "a2", a2: _*)
-} \ No newline at end of file
+
+ val bad1 = new Dynamic {
+ def selectDynamic(n: Int) = n
+ def applyDynamic(n: Int) = n
+ def applyDynamicNamed(n: Int) = n
+ def updateDynamic(n: Int) = n
+
+ }
+ bad1.sel
+ bad1.sel(1)
+ bad1.sel(a = 1)
+ bad1.sel = 1
+
+ val bad2 = new Dynamic {
+ def selectDynamic = 1
+ def applyDynamic = 1
+ def applyDynamicNamed = 1
+ def updateDynamic = 1
+ }
+ bad2.sel
+ bad2.sel(1)
+ bad2.sel(a = 1)
+ bad2.sel = 1
+}
diff --git a/test/files/neg/no-implicit-to-anyref.check b/test/files/neg/no-implicit-to-anyref.check
new file mode 100644
index 0000000000..d94b57a30a
--- /dev/null
+++ b/test/files/neg/no-implicit-to-anyref.check
@@ -0,0 +1,28 @@
+no-implicit-to-anyref.scala:11: error: type mismatch;
+ found : Int(1)
+ required: AnyRef
+Note: an implicit exists from scala.Int => java.lang.Integer, but
+methods inherited from Object are rendered ambiguous. This is to avoid
+a blanket implicit which would convert any scala.Int to any AnyRef.
+You may wish to use a type ascription: `x: java.lang.Integer`.
+ 1: AnyRef
+ ^
+no-implicit-to-anyref.scala:17: error: type mismatch;
+ found : Any
+ required: AnyRef
+ (null: Any): AnyRef
+ ^
+no-implicit-to-anyref.scala:21: error: type mismatch;
+ found : AnyVal
+ required: AnyRef
+ (0: AnyVal): AnyRef
+ ^
+no-implicit-to-anyref.scala:27: error: type mismatch;
+ found : Test.AV
+ required: AnyRef
+Note that AV extends Any, not AnyRef.
+Such types can participate in value classes, but instances
+cannot appear in singleton types or in reference comparisons.
+ new AV(0): AnyRef
+ ^
+four errors found
diff --git a/test/files/neg/no-implicit-to-anyref.scala b/test/files/neg/no-implicit-to-anyref.scala
new file mode 100644
index 0000000000..3e3d373e38
--- /dev/null
+++ b/test/files/neg/no-implicit-to-anyref.scala
@@ -0,0 +1,29 @@
+// Checks that the state of standard implicits in Predef._ and scala._
+// doesn't allow us to unambiguously and implicitly convert AnyVal
+// and subtypes to AnyRef.
+//
+// In the days before value classes, this was precariously held be
+// the competing implicits Any => StringAdd and Any => StringFormat.
+// Since then, these have both become value classes, but seeing as
+// this happened simultaneously, we're still okay.
+object Test {
+ locally {
+ 1: AnyRef
+ }
+
+ locally {
+ // before this test case was added and ContextErrors was tweaked, this
+ // emitted: "Note that Any extends Any, not AnyRef."
+ (null: Any): AnyRef
+ }
+
+ locally {
+ (0: AnyVal): AnyRef
+ }
+
+ class AV(val a: Int) extends AnyVal
+
+ locally {
+ new AV(0): AnyRef
+ }
+}
diff --git a/test/files/neg/reify_ann2b.scala b/test/files/neg/reify_ann2b.scala
index 2076af34c8..72d8c611cb 100644
--- a/test/files/neg/reify_ann2b.scala
+++ b/test/files/neg/reify_ann2b.scala
@@ -24,5 +24,5 @@ object Test extends App {
println(ttree.toString)
// test 3: import and compile
- toolbox.runExpr(tree)
+ toolbox.eval(tree)
} \ No newline at end of file
diff --git a/test/files/neg/reify_metalevel_breach_+0_refers_to_1.scala b/test/files/neg/reify_metalevel_breach_+0_refers_to_1.scala
index 9499960480..e4d1edffc4 100644
--- a/test/files/neg/reify_metalevel_breach_+0_refers_to_1.scala
+++ b/test/files/neg/reify_metalevel_breach_+0_refers_to_1.scala
@@ -11,6 +11,6 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/neg/reify_metalevel_breach_-1_refers_to_0_a.scala b/test/files/neg/reify_metalevel_breach_-1_refers_to_0_a.scala
index e6aaeb9426..7397441586 100644
--- a/test/files/neg/reify_metalevel_breach_-1_refers_to_0_a.scala
+++ b/test/files/neg/reify_metalevel_breach_-1_refers_to_0_a.scala
@@ -9,6 +9,6 @@ object Test extends App {
val code = reify{outer.splice.splice}
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/neg/reify_metalevel_breach_-1_refers_to_0_b.scala b/test/files/neg/reify_metalevel_breach_-1_refers_to_0_b.scala
index 16dcae8683..4f27a44f0c 100644
--- a/test/files/neg/reify_metalevel_breach_-1_refers_to_0_b.scala
+++ b/test/files/neg/reify_metalevel_breach_-1_refers_to_0_b.scala
@@ -13,6 +13,6 @@ object Test extends App {
}
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/neg/reify_metalevel_breach_-1_refers_to_1.scala b/test/files/neg/reify_metalevel_breach_-1_refers_to_1.scala
index 9600489f35..2f637301aa 100644
--- a/test/files/neg/reify_metalevel_breach_-1_refers_to_1.scala
+++ b/test/files/neg/reify_metalevel_breach_-1_refers_to_1.scala
@@ -11,6 +11,6 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/neg/reify_nested_inner_refers_to_local.scala b/test/files/neg/reify_nested_inner_refers_to_local.scala
index fcbc1f7865..75ed1bf330 100644
--- a/test/files/neg/reify_nested_inner_refers_to_local.scala
+++ b/test/files/neg/reify_nested_inner_refers_to_local.scala
@@ -10,6 +10,6 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/neg/static-annot.check b/test/files/neg/static-annot.check
deleted file mode 100644
index c98e7d9658..0000000000
--- a/test/files/neg/static-annot.check
+++ /dev/null
@@ -1,22 +0,0 @@
-static-annot.scala:8: error: Only members of top-level objects and their nested objects can be annotated with @static.
- @static val bar = 1
- ^
-static-annot.scala:27: error: @static annotated field bar has the same name as a member of class Conflicting
- @static val bar = 1
- ^
-static-annot.scala:37: error: The @static annotation is only allowed on public members.
- @static private val bar = 1
- ^
-static-annot.scala:38: error: The @static annotation is only allowed on public members.
- @static private val baz = 2
- ^
-static-annot.scala:39: error: The @static annotation is not allowed on lazy members.
- @static lazy val bam = 3
- ^
-static-annot.scala:52: error: The @static annotation is not allowed on method definitions.
- @static def x = 42
- ^
-static-annot.scala:14: error: Only members of top-level objects and their nested objects can be annotated with @static.
- @static val blah = 2
- ^
-7 errors found
diff --git a/test/files/neg/static-annot.scala b/test/files/neg/static-annot.scala
deleted file mode 100644
index c0b5ed30d8..0000000000
--- a/test/files/neg/static-annot.scala
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-import annotation.static
-
-
-
-class StaticInClass {
- @static val bar = 1
-}
-
-
-class NestedObjectInClass {
- object Nested {
- @static val blah = 2
- }
-}
-
-
-object NestedObjectInObject {
- object Nested {
- @static val succeed = 3
- }
-}
-
-
-object Conflicting {
- @static val bar = 1
-}
-
-
-class Conflicting {
- val bar = 45
-}
-
-
-object PrivateProtectedLazy {
- @static private val bar = 1
- @static private val baz = 2
- @static lazy val bam = 3
-}
-
-
-class PrivateProtectedLazy {
- println(PrivateProtectedLazy.bar)
- println(PrivateProtectedLazy.baz)
- println(PrivateProtectedLazy.bam)
-}
-
-
-class StaticDef {
- // this should not crash the compiler
- @static def x = 42
-}
diff --git a/test/files/neg/t2296a.check b/test/files/neg/t2296a.check
new file mode 100644
index 0000000000..863b861046
--- /dev/null
+++ b/test/files/neg/t2296a.check
@@ -0,0 +1,5 @@
+S.scala:6: error: Implementation restriction: trait S accesses protected method foo inside a concrete trait method.
+Add an accessor in a class extending class J as a workaround.
+ foo()
+ ^
+one error found
diff --git a/test/files/run/t2296a/J.java b/test/files/neg/t2296a/J.java
index 78ff3e9804..78ff3e9804 100644
--- a/test/files/run/t2296a/J.java
+++ b/test/files/neg/t2296a/J.java
diff --git a/test/files/run/t2296a/S.scala b/test/files/neg/t2296a/S.scala
index 532d038a42..532d038a42 100644
--- a/test/files/run/t2296a/S.scala
+++ b/test/files/neg/t2296a/S.scala
diff --git a/test/files/neg/t2296b.check b/test/files/neg/t2296b.check
new file mode 100644
index 0000000000..07cc54d573
--- /dev/null
+++ b/test/files/neg/t2296b.check
@@ -0,0 +1,5 @@
+S_2.scala:6: error: Implementation restriction: trait S accesses protected method foo inside a concrete trait method.
+Add an accessor in a class extending class J_1 as a workaround.
+ foo()
+ ^
+one error found
diff --git a/test/files/run/t2296b/J_1.java b/test/files/neg/t2296b/J_1.java
index 4c91d47073..4c91d47073 100644
--- a/test/files/run/t2296b/J_1.java
+++ b/test/files/neg/t2296b/J_1.java
diff --git a/test/files/run/t2296b/S_2.scala b/test/files/neg/t2296b/S_2.scala
index 6cdb0cfaba..6cdb0cfaba 100644
--- a/test/files/run/t2296b/S_2.scala
+++ b/test/files/neg/t2296b/S_2.scala
diff --git a/test/files/neg/t4581/static-declaration_1.scala b/test/files/neg/t4581/static-declaration_1.scala
deleted file mode 100644
index f9a66b29c1..0000000000
--- a/test/files/neg/t4581/static-declaration_1.scala
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-object Constants {
- import scala.annotation.static
- @static val Const: Int = 0 // should generate a static final field
- @static final val FinalConst: Int = 0 // ditto
- @static var MutableField: Int = 0 // should not be final
-}
-
-
-
diff --git a/test/files/neg/t4581/static_2.java b/test/files/neg/t4581/static_2.java
deleted file mode 100644
index 2fd5bf1d82..0000000000
--- a/test/files/neg/t4581/static_2.java
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-public class static_2 {
- public static void main(String[] args) {
- Constants.Const = 17;
- Constants.FinalConst = 99;
- Constants.MutableField = 199;
- }
-}
-
-
-
-
diff --git a/test/files/neg/t5692a.check b/test/files/neg/t5692a.check
new file mode 100644
index 0000000000..527cb35fba
--- /dev/null
+++ b/test/files/neg/t5692a.check
@@ -0,0 +1,4 @@
+Test_2.scala:2: error: type parameter not specified
+ def x = Macros.foo
+ ^
+one error found
diff --git a/test/files/neg/t5692a.flags b/test/files/neg/t5692a.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/t5692a.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/t5692a/Macros_1.scala b/test/files/neg/t5692a/Macros_1.scala
new file mode 100644
index 0000000000..06b5a3de36
--- /dev/null
+++ b/test/files/neg/t5692a/Macros_1.scala
@@ -0,0 +1,6 @@
+import scala.reflect.macros.Context
+
+object Macros {
+ def impl[T](c: Context) = c.literalUnit
+ def foo[T] = macro impl[T]
+} \ No newline at end of file
diff --git a/test/files/neg/t5692a/Test_2.scala b/test/files/neg/t5692a/Test_2.scala
new file mode 100644
index 0000000000..08d510cc6f
--- /dev/null
+++ b/test/files/neg/t5692a/Test_2.scala
@@ -0,0 +1,3 @@
+class Test {
+ def x = Macros.foo
+} \ No newline at end of file
diff --git a/test/files/neg/t5692b.check b/test/files/neg/t5692b.check
new file mode 100644
index 0000000000..8f6b2624cf
--- /dev/null
+++ b/test/files/neg/t5692b.check
@@ -0,0 +1,4 @@
+Test_2.scala:2: error: type parameters not specified
+ def x = Macros.foo
+ ^
+one error found
diff --git a/test/files/neg/t5692b.flags b/test/files/neg/t5692b.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/neg/t5692b.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/neg/t5692b/Macros_1.scala b/test/files/neg/t5692b/Macros_1.scala
new file mode 100644
index 0000000000..b28d19f903
--- /dev/null
+++ b/test/files/neg/t5692b/Macros_1.scala
@@ -0,0 +1,6 @@
+import scala.reflect.macros.Context
+
+object Macros {
+ def impl[T, U](c: Context) = c.literalUnit
+ def foo[T, U] = macro impl[T, U]
+} \ No newline at end of file
diff --git a/test/files/neg/t5692b/Test_2.scala b/test/files/neg/t5692b/Test_2.scala
new file mode 100644
index 0000000000..08d510cc6f
--- /dev/null
+++ b/test/files/neg/t5692b/Test_2.scala
@@ -0,0 +1,3 @@
+class Test {
+ def x = Macros.foo
+} \ No newline at end of file
diff --git a/test/files/neg/t6336.check b/test/files/neg/t6336.check
new file mode 100644
index 0000000000..f6b35ad232
--- /dev/null
+++ b/test/files/neg/t6336.check
@@ -0,0 +1,4 @@
+t6336.scala:3: error: Parameter type in structural refinement may not refer to a user-defined value class
+ val a = new { def y[T](x: X[T]) = x.i }
+ ^
+one error found
diff --git a/test/files/neg/t6336.scala b/test/files/neg/t6336.scala
new file mode 100644
index 0000000000..a9844ff94f
--- /dev/null
+++ b/test/files/neg/t6336.scala
@@ -0,0 +1,11 @@
+object D {
+ def main(args: Array[String]) {
+ val a = new { def y[T](x: X[T]) = x.i }
+ val x = new X(3)
+ val t = a.y(x)
+ println(t)
+ }
+}
+
+class X[T](val i: Int) extends AnyVal
+
diff --git a/test/files/pos/t4579.scala b/test/files/pos/t4579.scala
index 2404b19da1..8951ec011f 100644
--- a/test/files/pos/t4579.scala
+++ b/test/files/pos/t4579.scala
@@ -12,11 +12,11 @@ class LispTokenizer(s: String) extends Iterator[String] {
while (i < s.length() && s.charAt(i) <= ' ') i += 1
i < s.length()
}
- def next: String =
+ def next: String =
if (hasNext) {
val start = i
if (isDelimiter(s charAt i)) i += 1
- else
+ else
do i = i + 1
while (!isDelimiter(s charAt i))
s.substring(start, i)
@@ -235,7 +235,7 @@ object LispCaseClasses extends Lisp {
def string2lisp(s: String): Data = {
val it = new LispTokenizer(s);
- def parseExpr(token: String): Data = {
+ def parse(token: String): Data = {
if (token == "(") parseList
else if (token == ")") sys.error("unbalanced parentheses")
else if ('0' <= token.charAt(0) && token.charAt(0) <= '9')
@@ -246,9 +246,9 @@ object LispCaseClasses extends Lisp {
}
def parseList: Data = {
val token = it.next;
- if (token == ")") NIL() else CONS(parseExpr(token), parseList)
+ if (token == ")") NIL() else CONS(parse(token), parseList)
}
- parseExpr(it.next)
+ parse(it.next)
}
def lisp2string(d: Data): String = d.toString();
@@ -426,7 +426,7 @@ object LispAny extends Lisp {
def string2lisp(s: String): Data = {
val it = new LispTokenizer(s);
- def parseExpr(token: String): Data = {
+ def parse(token: String): Data = {
if (token == "(") parseList
else if (token == ")") sys.error("unbalanced parentheses")
//else if (Character.isDigit(token.charAt(0)))
@@ -438,9 +438,9 @@ object LispAny extends Lisp {
}
def parseList: List[Data] = {
val token = it.next;
- if (token == ")") Nil else parseExpr(token) :: parseList
+ if (token == ")") Nil else parse(token) :: parseList
}
- parseExpr(it.next)
+ parse(it.next)
}
}
diff --git a/test/files/pos/t6245/Base.java b/test/files/pos/t6245/Base.java
new file mode 100644
index 0000000000..651ea08bf2
--- /dev/null
+++ b/test/files/pos/t6245/Base.java
@@ -0,0 +1,5 @@
+package t1;
+
+public class Base {
+ protected Vis inner;
+}
diff --git a/test/files/pos/t6245/Foo.scala b/test/files/pos/t6245/Foo.scala
new file mode 100644
index 0000000000..f5f997fbff
--- /dev/null
+++ b/test/files/pos/t6245/Foo.scala
@@ -0,0 +1,9 @@
+import t1.Vis
+
+abstract class Foo extends t1.Base {
+ trait Nested {
+ def crash() {
+ inner
+ }
+ }
+}
diff --git a/test/files/pos/t6245/Vis.java b/test/files/pos/t6245/Vis.java
new file mode 100644
index 0000000000..4267f4e40b
--- /dev/null
+++ b/test/files/pos/t6245/Vis.java
@@ -0,0 +1,3 @@
+package t1;
+
+public class Vis { }
diff --git a/test/files/pos/t6294.scala b/test/files/pos/t6294.scala
deleted file mode 100644
index c6d39a9cc8..0000000000
--- a/test/files/pos/t6294.scala
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-object A {
- @annotation.static final val x = 123
-}
-
-
-object B {
- println(A.x)
-}
-
-
-
diff --git a/test/files/run/applydynamic_sip.check b/test/files/run/applydynamic_sip.check
index d94db4417e..6d04dc4524 100644
--- a/test/files/run/applydynamic_sip.check
+++ b/test/files/run/applydynamic_sip.check
@@ -20,3 +20,10 @@ qual.selectDynamic(sel)
qual.selectDynamic(sel)
.apply
.update(1, 1)
+qual.applyDynamic(apply)(a)
+qual.applyDynamic(apply)(a)
+qual.applyDynamic(apply)(a)
+qual.applyDynamic(apply)(a)
+qual.applyDynamicNamed(apply)((arg,a))
+qual.applyDynamicNamed(apply)((,a), (arg2,a2))
+qual.applyDynamic(update)(a, a2)
diff --git a/test/files/run/applydynamic_sip.scala b/test/files/run/applydynamic_sip.scala
index 57cb4349f7..cf918a82ed 100644
--- a/test/files/run/applydynamic_sip.scala
+++ b/test/files/run/applydynamic_sip.scala
@@ -55,4 +55,12 @@ object Test extends App {
qual.sel() = expr // parser turns this into qual.sel.update(expr)
qual.sel.apply(1)
qual.sel.apply(1) = 1
-} \ No newline at end of file
+
+ qual.apply(a)
+ qual.apply[String](a)
+ qual(a)
+ qual[String](a)
+ qual[T](arg = a)
+ qual(a, arg2 = "a2")
+ qual(a) = a2
+}
diff --git a/test/files/run/collections.check b/test/files/run/collections.check
index b87a5998c5..c24150b24d 100644
--- a/test/files/run/collections.check
+++ b/test/files/run/collections.check
@@ -2,6 +2,10 @@
test1: 14005
test2: 25005003, iters = 5000
test3: 25005003
+***** mutable.LinkedHashSet:
+test1: 14005
+test2: 25005003, iters = 5000
+test3: 25005003
***** immutable.Set:
test1: 14005
test2: 25005003, iters = 5000
@@ -18,6 +22,10 @@ test3: 25005003
test1: 14005
test2: 25005003, iters = 5000
test3: 25005003
+***** mutable.LinkedHashMap:
+test1: 14005
+test2: 25005003, iters = 5000
+test3: 25005003
***** immutable.Map:
test1: 14005
test2: 25005003, iters = 5000
diff --git a/test/files/run/collections.scala b/test/files/run/collections.scala
index 60f0765e6a..69c40fae80 100644
--- a/test/files/run/collections.scala
+++ b/test/files/run/collections.scala
@@ -106,10 +106,12 @@ object Test extends App {
}
test("mutable.HashSet", new mutable.HashSet[Int], 5000)
+ test("mutable.LinkedHashSet", new mutable.LinkedHashSet[Int], 5000)
test("immutable.Set", immutable.Set[Int](), 5000)
test("immutable.ListSet", new immutable.ListSet[Int], 5000)
test("immutable.TreeSet", new immutable.TreeSet[Int], 5000)
test("mutable.HashMap", new mutable.HashMap[Int, Int], 5000)
+ test("mutable.LinkedHashMap", new mutable.LinkedHashMap[Int, Int], 5000)
test("immutable.Map", immutable.Map[Int, Int](), 5000)
test("immutable.TreeMap", new immutable.TreeMap[Int, Int], 5000)
test("immutable.ListMap", new immutable.ListMap[Int, Int], 3000)
diff --git a/test/files/run/colltest.check b/test/files/run/colltest.check
index 1ad81a1350..e5bb013ed7 100644
--- a/test/files/run/colltest.check
+++ b/test/files/run/colltest.check
@@ -5,3 +5,4 @@ false
true
false
succeeded for 10 iterations.
+succeeded for 10 iterations.
diff --git a/test/files/run/colltest.scala b/test/files/run/colltest.scala
index ecd234bdd1..703e94a3c7 100644
--- a/test/files/run/colltest.scala
+++ b/test/files/run/colltest.scala
@@ -61,5 +61,6 @@ object Test extends App {
}
t3954
- new TestSet(HashSet.empty, new scala.collection.mutable.LinkedHashSet)
+ new TestSet(HashSet.empty, new LinkedHashSet)
+ new TestSet(new ImmutableSetAdaptor(collection.immutable.Set.empty[Int]), new LinkedHashSet)
}
diff --git a/test/files/run/colltest1.check b/test/files/run/colltest1.check
index 7377174281..5ec6286d9e 100644
--- a/test/files/run/colltest1.check
+++ b/test/files/run/colltest1.check
@@ -107,3 +107,5 @@ List((A,A), (B,B), (C,C), (D,D), (E,E), (F,F), (G,G), (H,H), (I,I), (J,J), (K,K)
List((A,A), (B,B), (C,C), (D,D), (E,E), (F,F), (G,G), (H,H), (I,I), (J,J), (K,K), (L,L), (M,M), (N,N), (O,O), (P,P), (Q,Q), (R,R), (S,S), (T,T), (U,U), (V,V), (W,W), (X,X), (Y,Y), (Z,Z))
List((A,A), (B,B), (C,C), (D,D), (E,E), (F,F), (G,G), (H,H), (I,I), (J,J), (K,K), (L,L), (M,M), (N,N), (O,O), (P,P), (Q,Q), (R,R), (S,S), (T,T), (U,U), (V,V), (W,W), (X,X), (Y,Y), (Z,Z))
List((A,A), (B,B), (C,C), (D,D), (E,E), (F,F), (G,G), (H,H), (I,I), (J,J), (K,K), (L,L), (M,M), (N,N), (O,O), (P,P), (Q,Q), (R,R), (S,S), (T,T), (U,U), (V,V), (W,W), (X,X), (Y,Y), (Z,Z))
+List((A,A), (B,B), (C,C), (D,D), (E,E), (F,F), (G,G), (H,H), (I,I), (J,J), (K,K), (L,L), (M,M), (N,N), (O,O), (P,P), (Q,Q), (R,R), (S,S), (T,T), (U,U), (V,V), (W,W), (X,X), (Y,Y), (Z,Z))
+List((A,A), (B,B), (C,C), (D,D), (E,E), (F,F), (G,G), (H,H), (I,I), (J,J), (K,K), (L,L), (M,M), (N,N), (O,O), (P,P), (Q,Q), (R,R), (S,S), (T,T), (U,U), (V,V), (W,W), (X,X), (Y,Y), (Z,Z))
diff --git a/test/files/run/colltest1.scala b/test/files/run/colltest1.scala
index 1cbd932222..54adeb7cda 100644
--- a/test/files/run/colltest1.scala
+++ b/test/files/run/colltest1.scala
@@ -226,6 +226,7 @@ object Test extends App {
setTest(mutable.Set())
setTest(immutable.Set())
setTest(mutable.HashSet())
+ setTest(mutable.LinkedHashSet())
setTest(immutable.HashSet())
mapTest(Map())
@@ -233,5 +234,6 @@ object Test extends App {
mapTest(immutable.Map())
mapTest(immutable.TreeMap())
mutableMapTest(mutable.HashMap())
+ mutableMapTest(mutable.LinkedHashMap())
mapTest(immutable.HashMap())
}
diff --git a/test/files/run/empty-array.check b/test/files/run/empty-array.check
new file mode 100644
index 0000000000..bb0b1cf658
--- /dev/null
+++ b/test/files/run/empty-array.check
@@ -0,0 +1,3 @@
+0
+0
+0
diff --git a/test/files/run/empty-array.scala b/test/files/run/empty-array.scala
new file mode 100644
index 0000000000..6e37dca37d
--- /dev/null
+++ b/test/files/run/empty-array.scala
@@ -0,0 +1,8 @@
+object Test {
+ def main(args: Array[String]): Unit = {
+ println(Array.emptyByteArray.length)
+ println(Array.emptyDoubleArray.length)
+ println(Array.emptyBooleanArray.length)
+ // okay okay okay
+ }
+}
diff --git a/test/files/run/macro-abort-fresh/Test_2.scala b/test/files/run/macro-abort-fresh/Test_2.scala
index c6caa2b585..15c498efb0 100644
--- a/test/files/run/macro-abort-fresh/Test_2.scala
+++ b/test/files/run/macro-abort-fresh/Test_2.scala
@@ -3,6 +3,6 @@ object Test extends App {
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
val tree = Select(Ident("Macros"), newTermName("foo"))
- try cm.mkToolBox().runExpr(tree)
+ try cm.mkToolBox().eval(tree)
catch { case ex: Throwable => println(ex.getMessage) }
} \ No newline at end of file
diff --git a/test/files/run/macro-def-infer-return-type-b/Test_2.scala b/test/files/run/macro-def-infer-return-type-b/Test_2.scala
index 0f84859545..ef2920a432 100644
--- a/test/files/run/macro-def-infer-return-type-b/Test_2.scala
+++ b/test/files/run/macro-def-infer-return-type-b/Test_2.scala
@@ -3,6 +3,6 @@ object Test extends App {
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
val tree = Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant(42))))
- try cm.mkToolBox().runExpr(tree)
+ try cm.mkToolBox().eval(tree)
catch { case ex: Throwable => println(ex.getMessage) }
}
diff --git a/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Macros_Test_2.scala b/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Macros_Test_2.scala
index c0319fcd6c..16d2c1e6ac 100644
--- a/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Macros_Test_2.scala
+++ b/test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Macros_Test_2.scala
@@ -7,6 +7,6 @@ object Test extends App {
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
val tree = Apply(Select(Ident("Macros"), newTermName("foo")), List(Typed(Apply(Ident(definitions.ListModule), List(Literal(Constant(1)), Literal(Constant(2)))), Ident(tpnme.WILDCARD_STAR))))
- try cm.mkToolBox().runExpr(tree)
+ try cm.mkToolBox().eval(tree)
catch { case ex: Throwable => println(ex.getMessage) }
} \ No newline at end of file
diff --git a/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Test_2.scala b/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Test_2.scala
index c6caa2b585..15c498efb0 100644
--- a/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Test_2.scala
+++ b/test/files/run/macro-invalidret-doesnt-conform-to-def-rettype/Test_2.scala
@@ -3,6 +3,6 @@ object Test extends App {
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
val tree = Select(Ident("Macros"), newTermName("foo"))
- try cm.mkToolBox().runExpr(tree)
+ try cm.mkToolBox().eval(tree)
catch { case ex: Throwable => println(ex.getMessage) }
} \ No newline at end of file
diff --git a/test/files/run/macro-invalidret-nontypeable/Test_2.scala b/test/files/run/macro-invalidret-nontypeable/Test_2.scala
index c6caa2b585..15c498efb0 100644
--- a/test/files/run/macro-invalidret-nontypeable/Test_2.scala
+++ b/test/files/run/macro-invalidret-nontypeable/Test_2.scala
@@ -3,6 +3,6 @@ object Test extends App {
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
val tree = Select(Ident("Macros"), newTermName("foo"))
- try cm.mkToolBox().runExpr(tree)
+ try cm.mkToolBox().eval(tree)
catch { case ex: Throwable => println(ex.getMessage) }
} \ No newline at end of file
diff --git a/test/files/run/macro-invalidusage-badret/Test_2.scala b/test/files/run/macro-invalidusage-badret/Test_2.scala
index 8322e8a4e0..f3a76f3fff 100644
--- a/test/files/run/macro-invalidusage-badret/Test_2.scala
+++ b/test/files/run/macro-invalidusage-badret/Test_2.scala
@@ -3,6 +3,6 @@ object Test extends App {
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
val tree = Typed(Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant(42)))), Ident(newTypeName("String")))
- try cm.mkToolBox().runExpr(tree)
+ try cm.mkToolBox().eval(tree)
catch { case ex: Throwable => println(ex.getMessage) }
}
diff --git a/test/files/run/macro-invalidusage-partialapplication-with-tparams/Test_2.scala b/test/files/run/macro-invalidusage-partialapplication-with-tparams/Test_2.scala
index f51cc7e699..c91fd7d380 100644
--- a/test/files/run/macro-invalidusage-partialapplication-with-tparams/Test_2.scala
+++ b/test/files/run/macro-invalidusage-partialapplication-with-tparams/Test_2.scala
@@ -3,6 +3,6 @@ object Test extends App {
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
val tree = Select(Ident("Macros"), newTermName("foo"))
- try cm.mkToolBox().runExpr(tree)
+ try cm.mkToolBox().eval(tree)
catch { case ex: Throwable => println(ex.getMessage) }
}
diff --git a/test/files/run/macro-invalidusage-partialapplication/Test_2.scala b/test/files/run/macro-invalidusage-partialapplication/Test_2.scala
index 64020b2aa9..cbfee725e2 100644
--- a/test/files/run/macro-invalidusage-partialapplication/Test_2.scala
+++ b/test/files/run/macro-invalidusage-partialapplication/Test_2.scala
@@ -3,6 +3,6 @@ object Test extends App {
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
val tree = Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant(40))))
- try cm.mkToolBox().runExpr(tree)
+ try cm.mkToolBox().eval(tree)
catch { case ex: Throwable => println(ex.getMessage) }
}
diff --git a/test/files/run/macro-reflective-ma-normal-mdmi/Test_2.scala b/test/files/run/macro-reflective-ma-normal-mdmi/Test_2.scala
index 67666a632b..373c6a6fca 100644
--- a/test/files/run/macro-reflective-ma-normal-mdmi/Test_2.scala
+++ b/test/files/run/macro-reflective-ma-normal-mdmi/Test_2.scala
@@ -3,5 +3,5 @@ object Test extends App {
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
val tree = Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant(42))))
- println(cm.mkToolBox().runExpr(tree))
+ println(cm.mkToolBox().eval(tree))
}
diff --git a/test/files/run/macro-reflective-mamd-normal-mi/Macros_Test_2.scala b/test/files/run/macro-reflective-mamd-normal-mi/Macros_Test_2.scala
index 7a2c0a6fa9..089f30f389 100644
--- a/test/files/run/macro-reflective-mamd-normal-mi/Macros_Test_2.scala
+++ b/test/files/run/macro-reflective-mamd-normal-mi/Macros_Test_2.scala
@@ -16,5 +16,5 @@ object Test extends App {
val macroapp = Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant(42))))
val tree = Block(macrodef, module, macroapp)
val toolbox = cm.mkToolBox(options = "-language:experimental.macros")
- println(toolbox.runExpr(tree))
+ println(toolbox.eval(tree))
}
diff --git a/test/files/run/macro-reify-freevars/Test_2.scala b/test/files/run/macro-reify-freevars/Test_2.scala
index 603cf10d41..e24758cfb4 100644
--- a/test/files/run/macro-reify-freevars/Test_2.scala
+++ b/test/files/run/macro-reify-freevars/Test_2.scala
@@ -6,6 +6,6 @@ object Test extends App {
val x = ValDef(NoMods, newTermName("x"), Ident("Int"), EmptyTree)
val fn = Function(List(x), Apply(Select(Ident(newTermName("x")), newTermName("$plus")), List(Literal(Constant("5")))))
val tree = Apply(Select(q, newTermName("map")), List(fn))
- try cm.mkToolBox().runExpr(tree)
+ try cm.mkToolBox().eval(tree)
catch { case ex: Throwable => println(ex.getMessage) }
} \ No newline at end of file
diff --git a/test/files/run/macro-reify-splice-outside-reify/Impls_Macros_1.scala b/test/files/run/macro-reify-splice-outside-reify/Impls_Macros_1.scala
index f3e1c9ae95..b23a5c70e1 100644
--- a/test/files/run/macro-reify-splice-outside-reify/Impls_Macros_1.scala
+++ b/test/files/run/macro-reify-splice-outside-reify/Impls_Macros_1.scala
@@ -15,7 +15,7 @@ object Impls {
val importer = ru.mkImporter(c.universe).asInstanceOf[ru.Importer { val from: c.universe.type }]
val tree = c.resetAllAttrs(x.tree.duplicate)
val imported = importer.importTree(tree)
- toolBox.runExpr(imported).asInstanceOf[T]
+ toolBox.eval(imported).asInstanceOf[T]
}
}
diff --git a/test/files/run/macro-reify-splice-outside-reify/Test_2.scala b/test/files/run/macro-reify-splice-outside-reify/Test_2.scala
index 5bca7db668..8f96ea199d 100644
--- a/test/files/run/macro-reify-splice-outside-reify/Test_2.scala
+++ b/test/files/run/macro-reify-splice-outside-reify/Test_2.scala
@@ -3,6 +3,6 @@ object Test extends App {
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
val tree = Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant(42))))
- try println(cm.mkToolBox().runExpr(tree))
+ try println(cm.mkToolBox().eval(tree))
catch { case ex: Throwable => println(ex.getMessage) }
}
diff --git a/test/files/run/macro-reify-tagless-a/Test_2.scala b/test/files/run/macro-reify-tagless-a/Test_2.scala
index 7029e59ea1..1bb3945ece 100644
--- a/test/files/run/macro-reify-tagless-a/Test_2.scala
+++ b/test/files/run/macro-reify-tagless-a/Test_2.scala
@@ -9,6 +9,6 @@ object Test extends App {
val rhs = Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant("hello world"))))
val list = ValDef(NoMods, newTermName("list"), tpt, rhs)
val tree = Block(list, Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Ident(list.name))))
- try cm.mkToolBox().runExpr(tree)
+ try cm.mkToolBox().eval(tree)
catch { case ex: Throwable => println(ex.getMessage) }
}
diff --git a/test/files/run/reflection-implicit.check b/test/files/run/reflection-implicit.check
new file mode 100644
index 0000000000..bab1518c45
--- /dev/null
+++ b/test/files/run/reflection-implicit.check
@@ -0,0 +1,2 @@
+List(true, true, true, true)
+true
diff --git a/test/files/run/reflection-implicit.scala b/test/files/run/reflection-implicit.scala
new file mode 100644
index 0000000000..637ef24e14
--- /dev/null
+++ b/test/files/run/reflection-implicit.scala
@@ -0,0 +1,15 @@
+import scala.reflect.runtime.universe._
+
+class C {
+ implicit val v = new C
+ implicit def d(x: C)(implicit c: C): Int = ???
+ implicit class X(val x: Int)
+}
+
+object Test extends App {
+ val decls = typeOf[C].typeSymbol.typeSignature.declarations.sorted.toList.filter(sym => !sym.isTerm || (sym.isMethod && !sym.asMethod.isConstructor))
+ println(decls map (_.isImplicit))
+ val param = decls.find(_.name.toString == "d").get.asMethod.params.last.head
+ param.typeSignature
+ println(param.isImplicit)
+} \ No newline at end of file
diff --git a/test/files/run/reflection-java-annotations.check b/test/files/run/reflection-java-annotations.check
new file mode 100644
index 0000000000..53c53cfbcc
--- /dev/null
+++ b/test/files/run/reflection-java-annotations.check
@@ -0,0 +1 @@
+List(JavaComplexAnnotation(v1 = 1, v10 = "hello", v101 = [101, 101], v102 = [102, 102], v103 = ['g', 'g'], v104 = [104, 104], v105 = [105L, 105L], v106 = [106.0, 106.0], v107 = [107.0, 107.0], v108 = [false, true], v11 = classOf[JavaAnnottee], v110 = ["hello", "world"], v111 = [classOf[JavaSimpleAnnotation], classOf[JavaComplexAnnotation]], v112 = [FOO, BAR], v113 = [JavaSimpleAnnotation(v1 = 21, v10 = "world2", v11 = classOf[JavaComplexAnnotation], v12 = BAR, v2 = 22, v3 = '\027', v4 = 24, v5 = 25L, v6 = 26.0, v7 = 27.0, v8 = false)], v12 = FOO, v13 = JavaSimpleAnnotation(v1 = 11, v10 = "world1", v11 = classOf[JavaSimpleAnnotation], v12 = FOO, v2 = 12, v3 = '\r', v4 = 14, v5 = 15L, v6 = 16.0, v7 = 17.0, v8 = false), v2 = 2, v3 = '\03', v4 = 4, v5 = 5L, v6 = 6.0, v7 = 7.0, v8 = false))
diff --git a/test/files/run/reflection-java-annotations.scala b/test/files/run/reflection-java-annotations.scala
new file mode 100644
index 0000000000..0b16c0d103
--- /dev/null
+++ b/test/files/run/reflection-java-annotations.scala
@@ -0,0 +1,7 @@
+object Test extends App {
+ import scala.reflect.runtime.universe._
+ val sym = typeOf[JavaAnnottee].typeSymbol
+ sym.typeSignature
+ sym.getAnnotations foreach (_.javaArgs)
+ println(sym.getAnnotations)
+} \ No newline at end of file
diff --git a/test/files/run/reflection-java-crtp.check b/test/files/run/reflection-java-crtp.check
new file mode 100644
index 0000000000..3e5a77e93a
--- /dev/null
+++ b/test/files/run/reflection-java-crtp.check
@@ -0,0 +1 @@
+(type E,type E,true)
diff --git a/test/files/run/reflection-java-crtp.scala b/test/files/run/reflection-java-crtp.scala
new file mode 100644
index 0000000000..260d3540dc
--- /dev/null
+++ b/test/files/run/reflection-java-crtp.scala
@@ -0,0 +1,8 @@
+object Test extends App {
+ import scala.reflect.runtime.universe._
+ val enum = typeOf[JavaSimpleEnumeration].baseClasses(1).asClass
+ // make sure that the E's in Enum<E extends Enum<E>> are represented by the same symbol
+ val e1 = enum.typeParams(0).asType
+ val TypeBounds(_, TypeRef(_, _, List(TypeRef(_, e2: TypeSymbol, _)))) = e1.typeSignature
+ println(e1, e2, e1 eq e2)
+} \ No newline at end of file
diff --git a/test/files/run/reify_ann1a.scala b/test/files/run/reify_ann1a.scala
index 754baef6b7..88b4191195 100644
--- a/test/files/run/reify_ann1a.scala
+++ b/test/files/run/reify_ann1a.scala
@@ -25,5 +25,5 @@ object Test extends App {
println(ttree.toString)
// test 3: import and compile
- toolbox.runExpr(tree)
+ toolbox.eval(tree)
} \ No newline at end of file
diff --git a/test/files/run/reify_ann1b.scala b/test/files/run/reify_ann1b.scala
index eb00b4cb10..a8fb876023 100644
--- a/test/files/run/reify_ann1b.scala
+++ b/test/files/run/reify_ann1b.scala
@@ -25,5 +25,5 @@ object Test extends App {
println(ttree.toString)
// test 3: import and compile
- toolbox.runExpr(tree)
+ toolbox.eval(tree)
} \ No newline at end of file
diff --git a/test/files/run/reify_ann2a.scala b/test/files/run/reify_ann2a.scala
index 9f901d86bd..b7e5833584 100644
--- a/test/files/run/reify_ann2a.scala
+++ b/test/files/run/reify_ann2a.scala
@@ -25,5 +25,5 @@ object Test extends App {
println(ttree.toString)
// test 3: import and compile
- toolbox.runExpr(tree)
+ toolbox.eval(tree)
} \ No newline at end of file
diff --git a/test/files/run/reify_ann3.scala b/test/files/run/reify_ann3.scala
index cbf1e10063..662d58aaf3 100644
--- a/test/files/run/reify_ann3.scala
+++ b/test/files/run/reify_ann3.scala
@@ -19,5 +19,5 @@ object Test extends App {
println(ttree.toString)
// test 3: import and compile
- toolbox.runExpr(tree)
+ toolbox.eval(tree)
} \ No newline at end of file
diff --git a/test/files/run/reify_ann4.scala b/test/files/run/reify_ann4.scala
index 58c8c2c521..a85e5e3625 100644
--- a/test/files/run/reify_ann4.scala
+++ b/test/files/run/reify_ann4.scala
@@ -23,5 +23,5 @@ object Test extends App {
println(ttree.toString)
// test 3: import and compile
- toolbox.runExpr(tree)
+ toolbox.eval(tree)
} \ No newline at end of file
diff --git a/test/files/run/reify_ann5.scala b/test/files/run/reify_ann5.scala
index 801db07960..877360180c 100644
--- a/test/files/run/reify_ann5.scala
+++ b/test/files/run/reify_ann5.scala
@@ -20,5 +20,5 @@ object Test extends App {
println(ttree.toString)
// test 3: import and compile
- toolbox.runExpr(tree)
+ toolbox.eval(tree)
} \ No newline at end of file
diff --git a/test/files/run/reify_classfileann_a.scala b/test/files/run/reify_classfileann_a.scala
index 0abb7b8154..1d51688e78 100644
--- a/test/files/run/reify_classfileann_a.scala
+++ b/test/files/run/reify_classfileann_a.scala
@@ -18,5 +18,5 @@ object Test extends App {
println(ttree.toString)
// test 3: import and compile
- toolbox.runExpr(tree)
+ toolbox.eval(tree)
} \ No newline at end of file
diff --git a/test/files/run/reify_classfileann_b.scala b/test/files/run/reify_classfileann_b.scala
index 5ceb652a8b..ef19e9240b 100644
--- a/test/files/run/reify_classfileann_b.scala
+++ b/test/files/run/reify_classfileann_b.scala
@@ -22,5 +22,5 @@ object Test extends App {
println(ttree.toString)
// test 3: import and compile
- toolbox.runExpr(tree)
+ toolbox.eval(tree)
} \ No newline at end of file
diff --git a/test/files/run/reify_closure1.scala b/test/files/run/reify_closure1.scala
index ce68975acc..af24a4b1e4 100644
--- a/test/files/run/reify_closure1.scala
+++ b/test/files/run/reify_closure1.scala
@@ -10,7 +10,7 @@ object Test extends App {
}}
val toolbox = cm.mkToolBox()
- val dyn = toolbox.runExpr(fun.tree)
+ val dyn = toolbox.eval(fun.tree)
dyn.asInstanceOf[Int => Int]
}
diff --git a/test/files/run/reify_closure2a.scala b/test/files/run/reify_closure2a.scala
index cb53e7ffa8..7a2cdb5e17 100644
--- a/test/files/run/reify_closure2a.scala
+++ b/test/files/run/reify_closure2a.scala
@@ -10,7 +10,7 @@ object Test extends App {
}}
val toolbox = cm.mkToolBox()
- val dyn = toolbox.runExpr(fun.tree)
+ val dyn = toolbox.eval(fun.tree)
dyn.asInstanceOf[Int => Int]
}
diff --git a/test/files/run/reify_closure3a.scala b/test/files/run/reify_closure3a.scala
index cf8c161afa..cb17c89501 100644
--- a/test/files/run/reify_closure3a.scala
+++ b/test/files/run/reify_closure3a.scala
@@ -12,7 +12,7 @@ object Test extends App {
}}
val toolbox = cm.mkToolBox()
- val dyn = toolbox.runExpr(fun.tree)
+ val dyn = toolbox.eval(fun.tree)
dyn.asInstanceOf[Int => Int]
}
diff --git a/test/files/run/reify_closure4a.scala b/test/files/run/reify_closure4a.scala
index 1521295f16..23436e0763 100644
--- a/test/files/run/reify_closure4a.scala
+++ b/test/files/run/reify_closure4a.scala
@@ -12,7 +12,7 @@ object Test extends App {
}}
val toolbox = cm.mkToolBox()
- val dyn = toolbox.runExpr(fun.tree)
+ val dyn = toolbox.eval(fun.tree)
dyn.asInstanceOf[Int => Int]
}
diff --git a/test/files/run/reify_closure5a.scala b/test/files/run/reify_closure5a.scala
index 84c2c08727..6b5089a4e5 100644
--- a/test/files/run/reify_closure5a.scala
+++ b/test/files/run/reify_closure5a.scala
@@ -10,7 +10,7 @@ object Test extends App {
}}
val toolbox = cm.mkToolBox()
- val dyn = toolbox.runExpr(fun.tree)
+ val dyn = toolbox.eval(fun.tree)
dyn.asInstanceOf[Int => Int]
}
diff --git a/test/files/run/reify_closure6.scala b/test/files/run/reify_closure6.scala
index d007e80899..cba035132d 100644
--- a/test/files/run/reify_closure6.scala
+++ b/test/files/run/reify_closure6.scala
@@ -17,7 +17,7 @@ object Test extends App {
}}
val toolbox = cm.mkToolBox()
- val dyn = toolbox.runExpr(fun.tree)
+ val dyn = toolbox.eval(fun.tree)
dyn.asInstanceOf[Int => Int]
}
diff --git a/test/files/run/reify_closure7.scala b/test/files/run/reify_closure7.scala
index 3d4956a724..2a7ce25e88 100644
--- a/test/files/run/reify_closure7.scala
+++ b/test/files/run/reify_closure7.scala
@@ -19,7 +19,7 @@ object Test extends App {
if (clo == null) {
val toolbox = cm.mkToolBox()
- val dyn = toolbox.runExpr(fun.tree)
+ val dyn = toolbox.eval(fun.tree)
clo = dyn.asInstanceOf[Int => Int]
}
diff --git a/test/files/run/reify_closure8a.scala b/test/files/run/reify_closure8a.scala
index 8db3d38241..f303a7511c 100644
--- a/test/files/run/reify_closure8a.scala
+++ b/test/files/run/reify_closure8a.scala
@@ -9,7 +9,7 @@ object Test extends App {
}
val toolbox = cm.mkToolBox()
- val dyn = toolbox.runExpr(new Foo(10).fun.tree)
+ val dyn = toolbox.eval(new Foo(10).fun.tree)
val foo = dyn.asInstanceOf[Int]
println(foo)
} \ No newline at end of file
diff --git a/test/files/run/reify_closure8b.scala b/test/files/run/reify_closure8b.scala
index 9cdc0e997f..c693cb490e 100644
--- a/test/files/run/reify_closure8b.scala
+++ b/test/files/run/reify_closure8b.scala
@@ -11,7 +11,7 @@ object Test extends App {
}
try {
- val dyn = cm.mkToolBox().runExpr(new Foo(10).fun.tree)
+ val dyn = cm.mkToolBox().eval(new Foo(10).fun.tree)
val foo = dyn.asInstanceOf[Int]
println(foo)
} catch {
diff --git a/test/files/run/reify_closures10.scala b/test/files/run/reify_closures10.scala
index 2d9b833851..a2740c8362 100644
--- a/test/files/run/reify_closures10.scala
+++ b/test/files/run/reify_closures10.scala
@@ -9,5 +9,5 @@ object Test extends App {
val code = reify{println(x + y); x + y}
val toolbox = cm.mkToolBox()
- println(toolbox.runExpr(code.tree))
+ println(toolbox.eval(code.tree))
} \ No newline at end of file
diff --git a/test/files/run/reify_copypaste1.scala b/test/files/run/reify_copypaste1.scala
index 7eaa4fa7b5..c597b7af19 100644
--- a/test/files/run/reify_copypaste1.scala
+++ b/test/files/run/reify_copypaste1.scala
@@ -11,9 +11,9 @@ object Test extends App {
val toolBox = currentMirror.mkToolBox(options = "-Yreify-copypaste")
val reify = Select(Select(Select(Select(Ident(ScalaPackage), newTermName("reflect")), newTermName("runtime")), newTermName("universe")), newTermName("reify"))
val reifee = Block(List(ValDef(Modifiers(LAZY), newTermName("x"), TypeTree(), Apply(Ident(ListModule), List(Literal(Constant(1)), Literal(Constant(2)))))), Ident(newTermName("x")))
- toolBox.runExpr(Apply(reify, List(reifee)))
- val Block(List(tpeCopypaste), exprCopypaste @ ModuleDef(_, _, Template(_, _, (_ :: stats) :+ expr))) = toolBox.parseExpr(output.toString())
+ toolBox.eval(Apply(reify, List(reifee)))
+ val Block(List(tpeCopypaste), exprCopypaste @ ModuleDef(_, _, Template(_, _, (_ :: stats) :+ expr))) = toolBox.parse(output.toString())
output.reset()
- toolBox.runExpr(Block(stats, expr))
+ toolBox.eval(Block(stats, expr))
stdout.println(output.toString)
} \ No newline at end of file
diff --git a/test/files/run/reify_getter.scala b/test/files/run/reify_getter.scala
index 26767603a0..cb04ddffde 100644
--- a/test/files/run/reify_getter.scala
+++ b/test/files/run/reify_getter.scala
@@ -13,6 +13,6 @@ object Test extends App {
}
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/reify_metalevel_breach_+0_refers_to_1.scala b/test/files/run/reify_metalevel_breach_+0_refers_to_1.scala
index 8ea92c511b..76f935ecd2 100644
--- a/test/files/run/reify_metalevel_breach_+0_refers_to_1.scala
+++ b/test/files/run/reify_metalevel_breach_+0_refers_to_1.scala
@@ -13,6 +13,6 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/reify_metalevel_breach_-1_refers_to_0_a.scala b/test/files/run/reify_metalevel_breach_-1_refers_to_0_a.scala
index 7ff4f84de0..e7c5cb71c1 100644
--- a/test/files/run/reify_metalevel_breach_-1_refers_to_0_a.scala
+++ b/test/files/run/reify_metalevel_breach_-1_refers_to_0_a.scala
@@ -11,6 +11,6 @@ object Test extends App {
val code = reify{outer.eval.eval}
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/reify_metalevel_breach_-1_refers_to_0_b.scala b/test/files/run/reify_metalevel_breach_-1_refers_to_0_b.scala
index 7f1f9d8478..770fcccd15 100644
--- a/test/files/run/reify_metalevel_breach_-1_refers_to_0_b.scala
+++ b/test/files/run/reify_metalevel_breach_-1_refers_to_0_b.scala
@@ -16,6 +16,6 @@ object Test extends App {
}
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/reify_metalevel_breach_-1_refers_to_1.scala b/test/files/run/reify_metalevel_breach_-1_refers_to_1.scala
index 65e0931b6e..32e7e9003b 100644
--- a/test/files/run/reify_metalevel_breach_-1_refers_to_1.scala
+++ b/test/files/run/reify_metalevel_breach_-1_refers_to_1.scala
@@ -13,6 +13,6 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/reify_nested_inner_refers_to_global.scala b/test/files/run/reify_nested_inner_refers_to_global.scala
index f45c1daed9..877222f5bf 100644
--- a/test/files/run/reify_nested_inner_refers_to_global.scala
+++ b/test/files/run/reify_nested_inner_refers_to_global.scala
@@ -12,6 +12,6 @@ object Test extends App {
}
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/reify_nested_inner_refers_to_local.scala b/test/files/run/reify_nested_inner_refers_to_local.scala
index 4a3d8bb02b..703474e07e 100644
--- a/test/files/run/reify_nested_inner_refers_to_local.scala
+++ b/test/files/run/reify_nested_inner_refers_to_local.scala
@@ -12,6 +12,6 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/reify_nested_outer_refers_to_global.scala b/test/files/run/reify_nested_outer_refers_to_global.scala
index b628975e59..e40c569ce6 100644
--- a/test/files/run/reify_nested_outer_refers_to_global.scala
+++ b/test/files/run/reify_nested_outer_refers_to_global.scala
@@ -14,6 +14,6 @@ object Test extends App {
}
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/reify_nested_outer_refers_to_local.scala b/test/files/run/reify_nested_outer_refers_to_local.scala
index 80564fa9a2..12147c51da 100644
--- a/test/files/run/reify_nested_outer_refers_to_local.scala
+++ b/test/files/run/reify_nested_outer_refers_to_local.scala
@@ -14,6 +14,6 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/reify_newimpl_45.scala b/test/files/run/reify_newimpl_45.scala
index cbae0839b2..2a6c68d441 100644
--- a/test/files/run/reify_newimpl_45.scala
+++ b/test/files/run/reify_newimpl_45.scala
@@ -9,7 +9,7 @@ object Test extends App {
println(code.tree.freeTypes)
val T = code.tree.freeTypes(0)
val tree = code.tree.substituteSymbols(List(T), List(definitions.StringClass))
- cm.mkToolBox().runExpr(tree)
+ cm.mkToolBox().eval(tree)
}
new C[String]
diff --git a/test/files/run/reify_printf.scala b/test/files/run/reify_printf.scala
index 07e99781e3..272856b962 100644
--- a/test/files/run/reify_printf.scala
+++ b/test/files/run/reify_printf.scala
@@ -14,7 +14,7 @@ object Test extends App {
val toolbox = cm.mkToolBox()
val tree = tree_printf(reify("hello %s").tree, reify("world").tree)
- val evaluated = toolbox.runExpr(tree)
+ val evaluated = toolbox.eval(tree)
assert(output.toString() == "hello world", output.toString() +" == hello world")
/*
diff --git a/test/files/run/reify_typerefs_1a.scala b/test/files/run/reify_typerefs_1a.scala
index 53033e210c..2e961f171d 100644
--- a/test/files/run/reify_typerefs_1a.scala
+++ b/test/files/run/reify_typerefs_1a.scala
@@ -13,6 +13,6 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/reify_typerefs_1b.scala b/test/files/run/reify_typerefs_1b.scala
index 12604454ed..88bb864820 100644
--- a/test/files/run/reify_typerefs_1b.scala
+++ b/test/files/run/reify_typerefs_1b.scala
@@ -13,6 +13,6 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/reify_typerefs_2a.scala b/test/files/run/reify_typerefs_2a.scala
index ffc3dfc942..3a1db1d80f 100644
--- a/test/files/run/reify_typerefs_2a.scala
+++ b/test/files/run/reify_typerefs_2a.scala
@@ -15,6 +15,6 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/reify_typerefs_2b.scala b/test/files/run/reify_typerefs_2b.scala
index f5d1633d79..50082aa8d2 100644
--- a/test/files/run/reify_typerefs_2b.scala
+++ b/test/files/run/reify_typerefs_2b.scala
@@ -15,6 +15,6 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/reify_typerefs_3a.scala b/test/files/run/reify_typerefs_3a.scala
index 67b2c2d8aa..682d6f01ac 100644
--- a/test/files/run/reify_typerefs_3a.scala
+++ b/test/files/run/reify_typerefs_3a.scala
@@ -15,6 +15,6 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/reify_typerefs_3b.scala b/test/files/run/reify_typerefs_3b.scala
index 41a0a667e2..c85072f55f 100644
--- a/test/files/run/reify_typerefs_3b.scala
+++ b/test/files/run/reify_typerefs_3b.scala
@@ -15,6 +15,6 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/static-annot-repl.check b/test/files/run/static-annot-repl.check
deleted file mode 100644
index 3a1532b823..0000000000
--- a/test/files/run/static-annot-repl.check
+++ /dev/null
@@ -1,38 +0,0 @@
-Type in expressions to have them evaluated.
-Type :help for more information.
-
-scala>
-
-scala> import annotation.static
-import annotation.static
-
-scala> @static var x1 = 42
-x1: Int = 42
-
-scala> @static val x2 = 43
-x2: Int = 43
-
-scala> @static def x3 = 44
-<console>:8: error: The @static annotation is not allowed on method definitions.
- @static def x3 = 44
- ^
-
-scala> x1
-res0: Int = 42
-
-scala> x2
-res1: Int = 43
-
-scala> x3
-<console>:9: error: not found: value x3
- x3
- ^
-
-scala> class Test {
- @static def x = 42
-}
-<console>:9: error: The @static annotation is not allowed on method definitions.
- @static def x = 42
- ^
-
-scala> \ No newline at end of file
diff --git a/test/files/run/static-annot-repl.scala b/test/files/run/static-annot-repl.scala
deleted file mode 100644
index 1d2e9b2d7e..0000000000
--- a/test/files/run/static-annot-repl.scala
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-import scala.tools.partest.ReplTest
-
-
-
-object Test extends ReplTest {
- def code = """
-import annotation.static
-@static var x1 = 42
-@static val x2 = 43
-@static def x3 = 44
-x1
-x2
-x3
-class Test {
- @static def x = 42
-}
-"""
-
-}
diff --git a/test/files/run/static-annot/field.scala b/test/files/run/static-annot/field.scala
deleted file mode 100644
index 8408a51800..0000000000
--- a/test/files/run/static-annot/field.scala
+++ /dev/null
@@ -1,252 +0,0 @@
-
-
-
-import java.lang.reflect.Modifier
-import annotation.static
-import reflect._
-
-
-
-/* TEST 1 */
-
-/* A @static-annotated field in the companion object should yield
- * a static field in its companion class.
- */
-object Foo {
- @static val bar = 17
-}
-
-
-class Foo
-
-
-trait Check {
- def checkStatic(cls: Class[_]) {
- cls.getDeclaredFields.find(_.getName == "bar") match {
- case Some(f) =>
- assert(Modifier.isStatic(f.getModifiers), "no static modifier")
- case None =>
- assert(false, "no static field bar in class")
- }
- }
-
- def test(): Unit
-}
-
-
-object Test1 extends Check {
- def test() {
- checkStatic(classOf[Foo])
- assert(Foo.bar == 17, "Companion object field should be 17.")
- }
-}
-
-
-/* TEST 2 */
-
-class Foo2
-
-
-/** The order of declaring the class and its companion is inverted now. */
-object Foo2 {
- @static val bar = 199
-}
-
-
-object Test2 extends Check {
- def test() {
- checkStatic(Class.forName("Foo3"))
- assert(Foo3.bar == 1984, "Companion object field should be 1984.")
- }
-}
-
-
-/* TEST 3 */
-
-/** The case where there is no explicit companion class */
-object Foo3 {
- @static val bar = 1984
-}
-
-
-object Test3 extends Check {
- def test() {
- checkStatic(Class.forName("Foo3"))
- assert(Foo3.bar == 1984, "Companion object field should be 1984.")
- }
-}
-
-
-/* TEST 4 */
-
-/** We want to be able to generate atomic reference field updaters on the companion object
- * so that they are created only once per class declaration, but we want them to actually
- * be initialize __in the static initializer of the class itself__.
- * This is extremely important, because otherwise the creation of the ARFU fails, since it uses
- * trickery to detect the caller and compare it to the owner of the field being modified.
- * Previously, this used to be circumvented through the use of Java base classes. A pain.
- */
-class ArfuTarget {
- @volatile var strfield = ArfuTarget.STR
-
- def CAS(ov: String, nv: String): Boolean = {
- ArfuTarget.arfu.compareAndSet(this, ov, nv)
- }
-}
-
-
-object ArfuTarget {
- @static val arfu = java.util.concurrent.atomic.AtomicReferenceFieldUpdater.newUpdater(classOf[ArfuTarget], classOf[String], "strfield")
- val STR = "Some string"
-}
-
-
-object Test4 extends Check {
- def checkArfu() {
- val at = new ArfuTarget
- assert(at.strfield == ArfuTarget.STR)
- at.CAS(ArfuTarget.STR, null)
- assert(at.strfield == null)
- }
-
- def test() {
- checkArfu()
- }
-}
-
-
-/* TEST 5 */
-
-/** Although our main use-case is to use final static fields, we should be able to use non-final too.
- * Here we set the static field of the class by using the setters in the companion object.
- * It is legal to do so using the reference to `Foo` directly (in which case the callsites
- * are rewritten to access the static field directly), or through an interface `Var` (in
- * which case the getter and the setter for `field` access the static field in `Var`).
- */
-trait Var {
- var field: Int
-}
-
-object VarHolder extends Var {
- @static var field = 1
-}
-
-
-object Test5 extends Check {
- def test() {
- assert(VarHolder.field == 1)
- VarHolder.field = 2
- assert(VarHolder.field == 2)
- val vh: Var = VarHolder
- vh.field = 3
- assert(vh.field == 3)
- }
-}
-
-
-/* TEST 6 */
-
-/** Here we test flattening the static ctor body and changing the owners of local definitions. */
-object Foo6 {
- var companionField = 101
- @static val staticField = {
- val intermediate = companionField + 1
- intermediate * 2
- }
-}
-
-
-object Test6 extends Check {
- def test() {
- assert(Foo6.staticField == 204)
- }
-}
-
-
-
-/* TEST 7 */
-
-/** Here we test objects nested in top-level objects */
-object Foo7 {
- object AndHisFriend {
- @static val bar = "string"
- }
- class AndHisFriend
-
- object AndHisLonelyFriend {
- @static val bar = "another"
- }
-}
-
-
-object Test7 extends Check {
- def test() {
- checkStatic(classOf[Foo7.AndHisFriend])
- assert(Foo7.AndHisFriend.bar == "string")
-
- checkStatic(Class.forName("Foo7$AndHisLonelyFriend"))
- assert(Foo7.AndHisLonelyFriend.bar == "another")
- }
-}
-
-
-
-/* TEST 8 */
-
-object Foo8 {
- @static val field = 7
-
- val function: () => Int = () => {
- field + 1
- }
-
- val anon = new Runnable {
- def run() {
- assert(field == 7, "runnable asserting field is 7")
- }
- }
-
- @static var mutable = 10
-
- val mutation: () => Unit = () => {
- mutable += 1
- }
-}
-
-object Test8 {
- def test() {
- assert(Foo8.function() == 8, "function must return 8")
- Foo8.anon.run()
- assert(Foo8.mutable == 10, "mutable is 10")
- Foo8.mutation()
- assert(Foo8.mutable == 11, "mutable is 11")
- Foo8.mutation()
- assert(Foo8.mutable == 12, "mutable is 12")
- }
-}
-
-
-
-
-/* main */
-
-object Test {
-
- def main(args: Array[String]) {
- Test1.test()
- Test2.test()
- Test3.test()
- Test4.test()
- Test5.test()
- Test6.test()
- Test7.test()
- Test8.test()
- }
-
-}
-
-
-
-
-
-
diff --git a/test/files/run/t2296a.check b/test/files/run/t2296a.check
deleted file mode 100644
index f75aec9d81..0000000000
--- a/test/files/run/t2296a.check
+++ /dev/null
@@ -1,2 +0,0 @@
-J.foo()
-J.foo()
diff --git a/test/files/run/t2296b.check b/test/files/run/t2296b.check
deleted file mode 100644
index f75aec9d81..0000000000
--- a/test/files/run/t2296b.check
+++ /dev/null
@@ -1,2 +0,0 @@
-J.foo()
-J.foo()
diff --git a/test/files/run/t5229_2.scala b/test/files/run/t5229_2.scala
index 75d7204911..f059b09772 100644
--- a/test/files/run/t5229_2.scala
+++ b/test/files/run/t5229_2.scala
@@ -13,6 +13,6 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/t5230.scala b/test/files/run/t5230.scala
index 5cd67766b4..f6a7817c0b 100644
--- a/test/files/run/t5230.scala
+++ b/test/files/run/t5230.scala
@@ -13,6 +13,6 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/t5266_1.scala b/test/files/run/t5266_1.scala
index ee7ea6d335..7bf73ac988 100644
--- a/test/files/run/t5266_1.scala
+++ b/test/files/run/t5266_1.scala
@@ -10,6 +10,6 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/t5266_2.scala b/test/files/run/t5266_2.scala
index ca16f656ee..9b33910d00 100644
--- a/test/files/run/t5266_2.scala
+++ b/test/files/run/t5266_2.scala
@@ -11,6 +11,6 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- val evaluated = toolbox.runExpr(code.tree)
+ val evaluated = toolbox.eval(code.tree)
println("evaluated = " + evaluated)
} \ No newline at end of file
diff --git a/test/files/run/t5334_1.scala b/test/files/run/t5334_1.scala
index 2b6418990a..3aeb7e4437 100644
--- a/test/files/run/t5334_1.scala
+++ b/test/files/run/t5334_1.scala
@@ -11,5 +11,5 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- println(toolbox.runExpr(code.tree))
+ println(toolbox.eval(code.tree))
} \ No newline at end of file
diff --git a/test/files/run/t5334_2.scala b/test/files/run/t5334_2.scala
index 815f78f951..64ee1e0acd 100644
--- a/test/files/run/t5334_2.scala
+++ b/test/files/run/t5334_2.scala
@@ -11,5 +11,5 @@ object Test extends App {
};
val toolbox = cm.mkToolBox()
- println(toolbox.runExpr(code.tree))
+ println(toolbox.eval(code.tree))
} \ No newline at end of file
diff --git a/test/files/run/t5770.check b/test/files/run/t5770.check
new file mode 100644
index 0000000000..eeb1d55321
--- /dev/null
+++ b/test/files/run/t5770.check
@@ -0,0 +1,10 @@
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
diff --git a/test/files/run/t5770.scala b/test/files/run/t5770.scala
new file mode 100644
index 0000000000..b6c9236844
--- /dev/null
+++ b/test/files/run/t5770.scala
@@ -0,0 +1,25 @@
+import scala.reflect.runtime.universe._
+import scala.reflect.runtime.{currentMirror => cm}
+import scala.tools.reflect._
+
+object Test extends App {
+ var i = 0
+ val action = reify { i += 1; println(i) }.tree
+
+ val tb1 = cm.mkToolBox()
+ tb1.eval(action)
+ tb1.eval(action)
+ tb1.eval(action)
+ tb1.frontEnd.reset()
+ tb1.eval(action)
+ tb1.eval(action)
+
+ val tb2 = cm.mkToolBox()
+ tb2.eval(action)
+ tb2.frontEnd.reset()
+ tb2.eval(action)
+ tb2.eval(action)
+ tb2.frontEnd.reset()
+ tb2.eval(action)
+ tb2.eval(action)
+}
diff --git a/test/files/neg/t4581.check b/test/files/run/t5942.check
index e69de29bb2..e69de29bb2 100644
--- a/test/files/neg/t4581.check
+++ b/test/files/run/t5942.check
diff --git a/test/files/run/t5942.scala b/test/files/run/t5942.scala
new file mode 100644
index 0000000000..44a8be93f6
--- /dev/null
+++ b/test/files/run/t5942.scala
@@ -0,0 +1,10 @@
+import scala.reflect.runtime.universe._
+import scala.reflect.runtime.{currentMirror => cm}
+import scala.tools.reflect._
+
+object Test extends App {
+ val tb = cm.mkToolBox()
+ tb.parse("def x = {}")
+ try { tb.parse("def x = {") } catch { case _ => }
+ tb.parse("def x = {}")
+}
diff --git a/test/files/run/t6199-toolbox.scala b/test/files/run/t6199-toolbox.scala
index 14670f8e21..89015f5878 100644
--- a/test/files/run/t6199-toolbox.scala
+++ b/test/files/run/t6199-toolbox.scala
@@ -4,5 +4,5 @@ import scala.tools.reflect.ToolBox
object Test extends App {
val tb = cm.mkToolBox()
- println(tb.runExpr(Literal(Constant(()))))
+ println(tb.eval(Literal(Constant(()))))
} \ No newline at end of file
diff --git a/test/files/run/t6236.check b/test/files/run/t6236.check
deleted file mode 100644
index a0a2e88d0a..0000000000
--- a/test/files/run/t6236.check
+++ /dev/null
@@ -1,2 +0,0 @@
-353
-353 \ No newline at end of file
diff --git a/test/files/run/t6236/file_1.scala b/test/files/run/t6236/file_1.scala
deleted file mode 100644
index 92d22799fc..0000000000
--- a/test/files/run/t6236/file_1.scala
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-package p {
- object y {
- object x {
- @scala.annotation.static val foo: Int = 353
- }
- }
-}
diff --git a/test/files/run/t6236/file_2.scala b/test/files/run/t6236/file_2.scala
deleted file mode 100644
index 51823004ca..0000000000
--- a/test/files/run/t6236/file_2.scala
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-object Test {
- def main(args: Array[String]): Unit = {
- println(p.y.x.foo)
- println(p.y.x.foo)
- }
-}
-
diff --git a/test/files/run/t6287.check b/test/files/run/t6287.check
new file mode 100644
index 0000000000..2a783704a2
--- /dev/null
+++ b/test/files/run/t6287.check
@@ -0,0 +1,3 @@
+Vector(2, 3, 4)
+Vector(2, 3, 4)
+Vector(2, 3, 4)
diff --git a/test/files/run/t6287.scala b/test/files/run/t6287.scala
new file mode 100644
index 0000000000..0c75d1081b
--- /dev/null
+++ b/test/files/run/t6287.scala
@@ -0,0 +1,11 @@
+import scala.reflect.runtime.universe._
+import scala.reflect.runtime.{currentMirror => cm}
+import scala.tools.reflect._
+
+object Test extends App {
+ val tb = cm.mkToolBox()
+ val t1 = tb.parse("1 to 3 map (_+1)")
+ println(tb.eval(t1))
+ println(tb.eval(t1))
+ println(tb.eval(t1))
+} \ No newline at end of file
diff --git a/test/files/run/t6329_repl.check b/test/files/run/t6329_repl.check
new file mode 100644
index 0000000000..d4804fae37
--- /dev/null
+++ b/test/files/run/t6329_repl.check
@@ -0,0 +1,13 @@
+Type in expressions to have them evaluated.
+Type :help for more information.
+
+scala>
+
+scala> classManifest[List[_]]
+warning: there were 1 deprecation warnings; re-run with -deprecation for details
+res0: scala.reflect.ClassTag[List[_]] = scala.collection.immutable.List[Any]
+
+scala> scala.reflect.classTag[List[_]]
+res1: scala.reflect.ClassTag[List[_]] = scala.collection.immutable.List
+
+scala>
diff --git a/test/files/run/t6329_repl.scala b/test/files/run/t6329_repl.scala
new file mode 100644
index 0000000000..add6d64962
--- /dev/null
+++ b/test/files/run/t6329_repl.scala
@@ -0,0 +1,8 @@
+import scala.tools.partest.ReplTest
+
+object Test extends ReplTest {
+ def code = """
+ |classManifest[List[_]]
+ |scala.reflect.classTag[List[_]]
+ |""".stripMargin
+}
diff --git a/test/files/run/t6329_repl_bug.check b/test/files/run/t6329_repl_bug.check
new file mode 100644
index 0000000000..d4804fae37
--- /dev/null
+++ b/test/files/run/t6329_repl_bug.check
@@ -0,0 +1,13 @@
+Type in expressions to have them evaluated.
+Type :help for more information.
+
+scala>
+
+scala> classManifest[List[_]]
+warning: there were 1 deprecation warnings; re-run with -deprecation for details
+res0: scala.reflect.ClassTag[List[_]] = scala.collection.immutable.List[Any]
+
+scala> scala.reflect.classTag[List[_]]
+res1: scala.reflect.ClassTag[List[_]] = scala.collection.immutable.List
+
+scala>
diff --git a/test/files/run/t6329_repl_bug.pending b/test/files/run/t6329_repl_bug.pending
new file mode 100644
index 0000000000..9997d1771e
--- /dev/null
+++ b/test/files/run/t6329_repl_bug.pending
@@ -0,0 +1,10 @@
+import scala.tools.partest.ReplTest
+
+object Test extends ReplTest {
+ def code = """
+ |import scala.reflect.runtime.universe._
+ |import scala.reflect.runtime._
+ |classManifest[List[_]]
+ |scala.reflect.classTag[List[_]]
+ |""".stripMargin
+}
diff --git a/test/files/run/t6329_vanilla.check b/test/files/run/t6329_vanilla.check
new file mode 100644
index 0000000000..7e7c3d11df
--- /dev/null
+++ b/test/files/run/t6329_vanilla.check
@@ -0,0 +1,2 @@
+scala.collection.immutable.List[Any]
+scala.collection.immutable.List
diff --git a/test/files/run/t6329_vanilla.scala b/test/files/run/t6329_vanilla.scala
new file mode 100644
index 0000000000..a31cd5c72e
--- /dev/null
+++ b/test/files/run/t6329_vanilla.scala
@@ -0,0 +1,4 @@
+object Test extends App {
+ println(classManifest[List[_]])
+ println(scala.reflect.classTag[List[_]])
+} \ No newline at end of file
diff --git a/test/files/run/t6329_vanilla_bug.check b/test/files/run/t6329_vanilla_bug.check
new file mode 100644
index 0000000000..7e7c3d11df
--- /dev/null
+++ b/test/files/run/t6329_vanilla_bug.check
@@ -0,0 +1,2 @@
+scala.collection.immutable.List[Any]
+scala.collection.immutable.List
diff --git a/test/files/run/t6329_vanilla_bug.pending b/test/files/run/t6329_vanilla_bug.pending
new file mode 100644
index 0000000000..404f90bf6e
--- /dev/null
+++ b/test/files/run/t6329_vanilla_bug.pending
@@ -0,0 +1,7 @@
+import scala.reflect.runtime.universe._
+import scala.reflect.runtime._
+
+object Test extends App {
+ println(classManifest[List[_]])
+ println(scala.reflect.classTag[List[_]])
+} \ No newline at end of file
diff --git a/test/files/run/t6353.check b/test/files/run/t6353.check
new file mode 100644
index 0000000000..5676bed245
--- /dev/null
+++ b/test/files/run/t6353.check
@@ -0,0 +1 @@
+applyDynamic(apply)(9)
diff --git a/test/files/run/t6353.scala b/test/files/run/t6353.scala
new file mode 100644
index 0000000000..112241a3c4
--- /dev/null
+++ b/test/files/run/t6353.scala
@@ -0,0 +1,12 @@
+import language.dynamics
+
+object Test extends App {
+ val x = new X(3)
+ val y = x(9)
+ class X(i: Int) extends Dynamic {
+ def applyDynamic(name: String)(in: Int): Int = {
+ println(s"applyDynamic($name)($in)")
+ i + in
+ }
+ }
+}
diff --git a/test/files/run/toolbox_console_reporter.scala b/test/files/run/toolbox_console_reporter.scala
index c5b788550e..a57dea38a8 100644
--- a/test/files/run/toolbox_console_reporter.scala
+++ b/test/files/run/toolbox_console_reporter.scala
@@ -5,7 +5,7 @@ object Test extends App {
// todo. and isn't affected by Console.setOut employed by partest to intercept output
//val toolbox = mkToolBox(frontEnd = mkConsoleFrontEnd(), options = "-deprecation")
- //toolbox.runExpr(reify{
+ //toolbox.eval(reify{
// object Utils {
// @deprecated("test", "2.10.0")
// def foo { println("hello") }
diff --git a/test/files/run/toolbox_default_reporter_is_silent.scala b/test/files/run/toolbox_default_reporter_is_silent.scala
index 5f3269b6fa..4bd7a646b0 100644
--- a/test/files/run/toolbox_default_reporter_is_silent.scala
+++ b/test/files/run/toolbox_default_reporter_is_silent.scala
@@ -5,7 +5,7 @@ import scala.tools.reflect.ToolBox
object Test extends App {
val toolbox = cm.mkToolBox()
- toolbox.runExpr(reify{
+ toolbox.eval(reify{
object Utils {
@deprecated("test", "2.10.0")
def foo { println("hello") }
diff --git a/test/files/run/toolbox_silent_reporter.scala b/test/files/run/toolbox_silent_reporter.scala
index 915734e6ad..15f559d605 100644
--- a/test/files/run/toolbox_silent_reporter.scala
+++ b/test/files/run/toolbox_silent_reporter.scala
@@ -5,7 +5,7 @@ import scala.tools.reflect.ToolBox
object Test extends App {
val toolbox = cm.mkToolBox(options = "-deprecation")
- toolbox.runExpr(reify{
+ toolbox.eval(reify{
object Utils {
@deprecated("test", "2.10.0")
def foo { println("hello") }
diff --git a/test/files/scalacheck/redblacktree.scala b/test/files/scalacheck/redblacktree.scala
index e2609fa200..bc7f92aa1b 100644
--- a/test/files/scalacheck/redblacktree.scala
+++ b/test/files/scalacheck/redblacktree.scala
@@ -205,6 +205,45 @@ package scala.collection.immutable.redblacktree {
filteredTree == keysIterator(newTree).toList
}
}
+
+ object TestDrop extends RedBlackTreeTest with RedBlackTreeInvariants {
+ import RB._
+
+ override type ModifyParm = Int
+ override def genParm(tree: Tree[String, Int]): Gen[ModifyParm] = choose(0, iterator(tree).size)
+ override def modify(tree: Tree[String, Int], parm: ModifyParm): Tree[String, Int] = drop(tree, parm)
+
+ property("drop") = forAll(genInput) { case (tree, parm, newTree) =>
+ iterator(tree).drop(parm).toList == iterator(newTree).toList
+ }
+ }
+
+ object TestTake extends RedBlackTreeTest with RedBlackTreeInvariants {
+ import RB._
+
+ override type ModifyParm = Int
+ override def genParm(tree: Tree[String, Int]): Gen[ModifyParm] = choose(0, iterator(tree).size)
+ override def modify(tree: Tree[String, Int], parm: ModifyParm): Tree[String, Int] = take(tree, parm)
+
+ property("take") = forAll(genInput) { case (tree, parm, newTree) =>
+ iterator(tree).take(parm).toList == iterator(newTree).toList
+ }
+ }
+
+ object TestSlice extends RedBlackTreeTest with RedBlackTreeInvariants {
+ import RB._
+
+ override type ModifyParm = (Int, Int)
+ override def genParm(tree: Tree[String, Int]): Gen[ModifyParm] = for {
+ from <- choose(0, iterator(tree).size)
+ to <- choose(from, iterator(tree).size)
+ } yield (from, to)
+ override def modify(tree: Tree[String, Int], parm: ModifyParm): Tree[String, Int] = slice(tree, parm._1, parm._2)
+
+ property("slice") = forAll(genInput) { case (tree, parm, newTree) =>
+ iterator(tree).slice(parm._1, parm._2).toList == iterator(newTree).toList
+ }
+ }
}
object Test extends Properties("RedBlackTree") {
@@ -213,4 +252,7 @@ object Test extends Properties("RedBlackTree") {
include(TestModify)
include(TestDelete)
include(TestRange)
+ include(TestDrop)
+ include(TestTake)
+ include(TestSlice)
}