summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/files/jvm/serialization.scala15
-rw-r--r--test/files/lib/javac-artifacts.jar.desired.sha12
-rw-r--r--test/files/neg/anyval-anyref-parent.check2
-rw-r--r--test/files/neg/case-collision.check10
-rw-r--r--test/files/neg/case-collision.flags1
-rw-r--r--test/files/neg/case-collision.scala11
-rw-r--r--test/files/neg/cyclics-import.check11
-rw-r--r--test/files/neg/macro-invalidsig-implicit-params/Impls_Macros_1.scala4
-rw-r--r--test/files/neg/names-defaults-neg.check2
-rw-r--r--test/files/neg/protected-constructors.check5
-rw-r--r--test/files/neg/t1672b.check16
-rw-r--r--test/files/neg/t1672b.scala52
-rw-r--r--test/files/neg/t2148.check2
-rw-r--r--test/files/neg/t3222.check14
-rw-r--r--test/files/neg/t3614.check4
-rw-r--r--test/files/neg/t4044.check7
-rw-r--r--test/files/neg/t409.check4
-rw-r--r--test/files/neg/t5361.check4
-rw-r--r--test/files/neg/t5361.scala3
-rw-r--r--test/files/neg/t5390.check4
-rw-r--r--test/files/neg/t5390.scala10
-rw-r--r--test/files/neg/t5390b.check4
-rw-r--r--test/files/neg/t5390b.scala10
-rw-r--r--test/files/neg/t5390c.check4
-rw-r--r--test/files/neg/t5390c.scala10
-rw-r--r--test/files/neg/t5390d.check4
-rw-r--r--test/files/neg/t5390d.scala10
-rw-r--r--test/files/neg/t5529.check5
-rw-r--r--test/files/neg/t5696.check2
-rw-r--r--test/files/neg/t6260.check4
-rw-r--r--test/files/neg/t6535.check6
-rw-r--r--test/files/neg/t6535.scala15
-rw-r--r--test/files/neg/t6558.check10
-rw-r--r--test/files/neg/t6558.scala12
-rw-r--r--test/files/neg/t6558b.check7
-rw-r--r--test/files/neg/t6558b.scala15
-rw-r--r--test/files/neg/t6667.check13
-rw-r--r--test/files/neg/t6667.scala10
-rw-r--r--test/files/neg/t6667b.check13
-rw-r--r--test/files/neg/t6667b.scala25
-rw-r--r--test/files/neg/t667.check4
-rw-r--r--test/files/neg/t6758.check28
-rw-r--r--test/files/neg/t6758.scala43
-rw-r--r--test/files/neg/t877.check4
-rw-r--r--test/files/pos/annotated-treecopy.check0
-rw-r--r--test/files/pos/annotated-treecopy.flags1
-rw-r--r--test/files/pos/annotated-treecopy/Impls_Macros_1.scala53
-rw-r--r--test/files/pos/annotated-treecopy/Test_2.scala5
-rw-r--r--test/files/pos/attachments-typed-ident.check0
-rw-r--r--test/files/pos/attachments-typed-ident.flags1
-rw-r--r--test/files/pos/attachments-typed-ident/Impls_1.scala17
-rw-r--r--test/files/pos/attachments-typed-ident/Macros_Test_2.scala4
-rw-r--r--test/files/pos/strip-tvars-for-lubbasetypes.scala25
-rw-r--r--test/files/pos/t1672.scala10
-rw-r--r--test/files/pos/t5390.scala11
-rw-r--r--test/files/pos/t5726.scala17
-rw-r--r--test/files/pos/t5877.scala14
-rw-r--r--test/files/pos/t5877b.scala13
-rw-r--r--test/files/pos/t6547.flags1
-rw-r--r--test/files/pos/t6547.scala6
-rw-r--r--test/files/pos/t6551.scala2
-rw-r--r--test/files/pos/t6712.scala5
-rw-r--r--test/files/pos/t6722.scala11
-rwxr-xr-xtest/files/presentation/doc.check48
-rwxr-xr-xtest/files/presentation/doc.scala71
-rwxr-xr-xtest/files/presentation/doc/src/Test.scala1
-rw-r--r--test/files/presentation/memory-leaks/MemoryLeaksTest.scala5
-rw-r--r--test/files/run/idempotency-case-classes.check52
-rw-r--r--test/files/run/idempotency-case-classes.scala22
-rw-r--r--test/files/run/idempotency-extractors.check5
-rw-r--r--test/files/run/idempotency-extractors.scala22
-rw-r--r--test/files/run/idempotency-labels.check15
-rw-r--r--test/files/run/idempotency-labels.scala22
-rw-r--r--test/files/run/idempotency-lazy-vals.check23
-rw-r--r--test/files/run/idempotency-lazy-vals.scala27
-rw-r--r--test/files/run/idempotency-partial-functions.check2
-rw-r--r--test/files/run/idempotency-partial-functions.scala25
-rw-r--r--test/files/run/idempotency-this.check4
-rw-r--r--test/files/run/idempotency-this.scala22
-rw-r--r--test/files/run/inline-ex-handlers.check21
-rw-r--r--test/files/run/macro-abort-fresh/Test_2.scala2
-rw-r--r--test/files/run/macro-declared-in-class-class/Impls_1.scala2
-rw-r--r--test/files/run/macro-declared-in-class-object/Impls_1.scala2
-rw-r--r--test/files/run/macro-declared-in-class/Impls_1.scala2
-rw-r--r--test/files/run/macro-declared-in-implicit-class/Impls_Macros_1.scala2
-rw-r--r--test/files/run/macro-declared-in-method/Impls_1.scala2
-rw-r--r--test/files/run/macro-declared-in-object-class/Impls_1.scala2
-rw-r--r--test/files/run/macro-declared-in-object-object/Impls_1.scala2
-rw-r--r--test/files/run/macro-declared-in-object/Impls_1.scala2
-rw-r--r--test/files/run/macro-declared-in-package-object/Impls_1.scala2
-rw-r--r--test/files/run/macro-declared-in-refinement/Impls_1.scala2
-rw-r--r--test/files/run/macro-declared-in-trait/Impls_1.scala2
-rw-r--r--test/files/run/macro-def-infer-return-type-b/Test_2.scala2
-rw-r--r--test/files/run/macro-expand-implicit-argument/Macros_1.scala8
-rw-r--r--test/files/run/macro-expand-varargs-explicit-over-nonvarargs-bad/Macros_Test_2.scala2
-rw-r--r--test/files/run/macro-impl-default-params/Impls_Macros_1.scala4
-rw-r--r--test/files/run/macro-impl-rename-context/Impls_Macros_1.scala4
-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/Impls_Macros_1.scala2
-rw-r--r--test/files/run/macro-invalidret-nontypeable/Test_2.scala4
-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.scala6
-rw-r--r--test/files/run/macro-reify-freevars/Test_2.scala4
-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.scala4
-rw-r--r--test/files/run/reify_renamed_term_basic.check1
-rw-r--r--test/files/run/reify_renamed_term_basic.scala20
-rw-r--r--test/files/run/reify_renamed_term_local_to_reifee.check1
-rw-r--r--test/files/run/reify_renamed_term_local_to_reifee.scala20
-rw-r--r--test/files/run/reify_renamed_term_overloaded_method.check1
-rw-r--r--test/files/run/reify_renamed_term_overloaded_method.scala17
-rw-r--r--test/files/run/reify_renamed_term_si5841.check1
-rw-r--r--test/files/run/reify_renamed_term_si5841.scala7
-rw-r--r--test/files/run/reify_renamed_type_basic.check1
-rw-r--r--test/files/run/reify_renamed_type_basic.scala16
-rw-r--r--test/files/run/reify_renamed_type_local_to_reifee.check1
-rw-r--r--test/files/run/reify_renamed_type_local_to_reifee.scala24
-rw-r--r--test/files/run/reify_renamed_type_spliceable.check1
-rw-r--r--test/files/run/reify_renamed_type_spliceable.scala21
-rw-r--r--test/files/run/t1672.scala28
-rw-r--r--test/files/run/t5064.check6
-rw-r--r--test/files/run/t5603.check4
-rw-r--r--test/files/run/t5733.check2
-rw-r--r--test/files/run/t5733.scala53
-rw-r--r--test/files/run/t5789.check14
-rw-r--r--test/files/run/t5789.scala14
-rw-r--r--test/files/run/t5894.scala17
-rw-r--r--test/files/run/t6288.check85
-rw-r--r--test/files/run/t6288.scala41
-rw-r--r--test/files/run/t6288b-jump-position.check80
-rw-r--r--test/files/run/t6288b-jump-position.scala22
-rw-r--r--test/files/run/t6320.check17
-rw-r--r--test/files/run/t6320.scala9
-rw-r--r--test/files/run/t6548.check2
-rw-r--r--test/files/run/t6548.scala12
-rw-r--r--test/files/run/t6549.check32
-rw-r--r--test/files/run/t6549.scala22
-rw-r--r--test/files/run/t6555.check22
-rw-r--r--test/files/run/t6555.scala15
-rw-r--r--test/files/run/t6614.check11
-rw-r--r--test/files/run/t6614.scala8
-rw-r--r--test/files/run/t6631.scala18
-rw-r--r--test/files/run/t6690.scala62
-rw-r--r--test/files/run/t6731.check40
-rw-r--r--test/files/run/t6731.scala143
-rw-r--r--test/files/run/toolbox_typecheck_implicitsdisabled.scala8
-rw-r--r--test/pending/run/macro-reify-tagless-b/Test_2.scala2
-rwxr-xr-xtest/scaladoc/run/SI-191-deprecated.scala3
-rwxr-xr-xtest/scaladoc/run/SI-191.scala3
-rw-r--r--test/scaladoc/run/SI-3314.scala3
-rw-r--r--test/scaladoc/run/SI-5235.scala3
-rw-r--r--test/scaladoc/run/links.scala7
-rw-r--r--test/scaladoc/run/t4922.check1
-rw-r--r--test/scaladoc/run/t4922.scala32
-rw-r--r--test/scaladoc/scalacheck/CommentFactoryTest.scala3
158 files changed, 1962 insertions, 114 deletions
diff --git a/test/files/jvm/serialization.scala b/test/files/jvm/serialization.scala
index 34b64938b4..f2c47aad77 100644
--- a/test/files/jvm/serialization.scala
+++ b/test/files/jvm/serialization.scala
@@ -604,6 +604,7 @@ object Test {
Test7
Test8
Test9_parallel
+ Test10_util
}
}
@@ -669,3 +670,17 @@ object Test9_parallel {
throw e
}
}
+
+//############################################################################
+// Test classes in package scala.util
+
+object Test10_util {
+ import scala.util.Random
+ def rep[A](n: Int)(f: => A) { if (n > 0) { f; rep(n-1)(f) } }
+
+ try {
+ val random = new Random(345)
+ val random2: Random = read(write(random))
+ rep(5) { assert(random.nextInt == random2.nextInt) }
+ }
+}
diff --git a/test/files/lib/javac-artifacts.jar.desired.sha1 b/test/files/lib/javac-artifacts.jar.desired.sha1
index 8dbbc1d451..a49c986386 100644
--- a/test/files/lib/javac-artifacts.jar.desired.sha1
+++ b/test/files/lib/javac-artifacts.jar.desired.sha1
@@ -1 +1 @@
-c5788c5e518eb267445c5a995fd98b2210f90a58 ?javac-artifacts.jar
+61931a51bb1a2d308d214b96d06e9a8808515dcf ?javac-artifacts.jar
diff --git a/test/files/neg/anyval-anyref-parent.check b/test/files/neg/anyval-anyref-parent.check
index fe20e5de81..8c2aa36583 100644
--- a/test/files/neg/anyval-anyref-parent.check
+++ b/test/files/neg/anyval-anyref-parent.check
@@ -3,7 +3,7 @@ trait Foo2 extends AnyVal // fail
^
anyval-anyref-parent.scala:5: error: Any does not have a constructor
class Bar1 extends Any // fail
- ^
+ ^
anyval-anyref-parent.scala:6: error: value class needs to have exactly one public val parameter
class Bar2(x: Int) extends AnyVal // fail
^
diff --git a/test/files/neg/case-collision.check b/test/files/neg/case-collision.check
new file mode 100644
index 0000000000..4edc6f1205
--- /dev/null
+++ b/test/files/neg/case-collision.check
@@ -0,0 +1,10 @@
+case-collision.scala:5: error: Class foo.BIPPY differs only in case from foo.Bippy. Such classes will overwrite one another on case-insensitive filesystems.
+class BIPPY
+ ^
+case-collision.scala:11: error: Class foo.HyRaX$ differs only in case from foo.Hyrax$. Such classes will overwrite one another on case-insensitive filesystems.
+object HyRaX
+ ^
+case-collision.scala:8: error: Class foo.DINGO$ differs only in case from foo.Dingo$. Such classes will overwrite one another on case-insensitive filesystems.
+object DINGO
+ ^
+three errors found
diff --git a/test/files/neg/case-collision.flags b/test/files/neg/case-collision.flags
new file mode 100644
index 0000000000..85d8eb2ba2
--- /dev/null
+++ b/test/files/neg/case-collision.flags
@@ -0,0 +1 @@
+-Xfatal-warnings
diff --git a/test/files/neg/case-collision.scala b/test/files/neg/case-collision.scala
new file mode 100644
index 0000000000..241169a77a
--- /dev/null
+++ b/test/files/neg/case-collision.scala
@@ -0,0 +1,11 @@
+package foo
+
+class Bippy
+
+class BIPPY
+
+object Dingo
+object DINGO
+
+case class Hyrax()
+object HyRaX
diff --git a/test/files/neg/cyclics-import.check b/test/files/neg/cyclics-import.check
index ef355fab0a..be09fca374 100644
--- a/test/files/neg/cyclics-import.check
+++ b/test/files/neg/cyclics-import.check
@@ -3,13 +3,4 @@ Note: this is often due in part to a class depending on a definition nested with
If applicable, you may wish to try moving some members into another object.
import User.UserStatus._
^
-cyclics-import.scala:12: error: not found: type Value
- type UserStatus = Value
- ^
-cyclics-import.scala:14: error: not found: value Value
- val Active = Value("1")
- ^
-cyclics-import.scala:15: error: not found: value Value
- val Disabled = Value("2")
- ^
-four errors found
+one error found
diff --git a/test/files/neg/macro-invalidsig-implicit-params/Impls_Macros_1.scala b/test/files/neg/macro-invalidsig-implicit-params/Impls_Macros_1.scala
index 845a168ff2..7a7293422e 100644
--- a/test/files/neg/macro-invalidsig-implicit-params/Impls_Macros_1.scala
+++ b/test/files/neg/macro-invalidsig-implicit-params/Impls_Macros_1.scala
@@ -5,10 +5,10 @@ object Impls {
def foo_targs[T, U: c.WeakTypeTag](c: Ctx)(implicit x: c.Expr[Int]) = {
import c.{prefix => prefix}
import c.universe._
- val body = Block(
+ val body = Block(List(
Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("invoking foo_targs...")))),
Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("type of prefix is: " + prefix.staticType)))),
- Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("U is: " + implicitly[c.WeakTypeTag[U]].tpe)))),
+ Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("U is: " + implicitly[c.WeakTypeTag[U]].tpe))))),
Literal(Constant(())))
c.Expr[Unit](body)
}
diff --git a/test/files/neg/names-defaults-neg.check b/test/files/neg/names-defaults-neg.check
index f3c45a6aa0..6f9dc7d127 100644
--- a/test/files/neg/names-defaults-neg.check
+++ b/test/files/neg/names-defaults-neg.check
@@ -100,7 +100,7 @@ Error occurred in an application involving default arguments.
^
names-defaults-neg.scala:86: error: module extending its companion class cannot use default constructor arguments
object C extends C()
- ^
+ ^
names-defaults-neg.scala:90: error: deprecated parameter name x has to be distinct from any other parameter name (deprecated or not).
def deprNam1(x: Int, @deprecatedName('x) y: String) = 0
^
diff --git a/test/files/neg/protected-constructors.check b/test/files/neg/protected-constructors.check
index f137158ed6..e295917050 100644
--- a/test/files/neg/protected-constructors.check
+++ b/test/files/neg/protected-constructors.check
@@ -19,7 +19,4 @@ protected-constructors.scala:15: error: class Foo3 in object Ding cannot be acce
object Ding in package dingus where target is defined
class Bar3 extends Ding.Foo3("abc")
^
-protected-constructors.scala:15: error: too many arguments for constructor Object: ()Object
- class Bar3 extends Ding.Foo3("abc")
- ^
-5 errors found
+four errors found
diff --git a/test/files/neg/t1672b.check b/test/files/neg/t1672b.check
new file mode 100644
index 0000000000..60ccf77174
--- /dev/null
+++ b/test/files/neg/t1672b.check
@@ -0,0 +1,16 @@
+t1672b.scala:3: error: could not optimize @tailrec annotated method bar: it contains a recursive call not in tail position
+ def bar : Nothing = {
+ ^
+t1672b.scala:14: error: could not optimize @tailrec annotated method baz: it contains a recursive call not in tail position
+ def baz : Nothing = {
+ ^
+t1672b.scala:29: error: could not optimize @tailrec annotated method boz: it contains a recursive call not in tail position
+ case _: Throwable => boz; ???
+ ^
+t1672b.scala:34: error: could not optimize @tailrec annotated method bez: it contains a recursive call not in tail position
+ def bez : Nothing = {
+ ^
+t1672b.scala:46: error: could not optimize @tailrec annotated method bar: it contains a recursive call not in tail position
+ else 1 + (try {
+ ^
+5 errors found
diff --git a/test/files/neg/t1672b.scala b/test/files/neg/t1672b.scala
new file mode 100644
index 0000000000..0ccdd03633
--- /dev/null
+++ b/test/files/neg/t1672b.scala
@@ -0,0 +1,52 @@
+object Test {
+ @annotation.tailrec
+ def bar : Nothing = {
+ try {
+ throw new RuntimeException
+ } catch {
+ case _: Throwable => bar
+ } finally {
+ bar
+ }
+ }
+
+ @annotation.tailrec
+ def baz : Nothing = {
+ try {
+ throw new RuntimeException
+ } catch {
+ case _: Throwable => baz
+ } finally {
+ ???
+ }
+ }
+
+ @annotation.tailrec
+ def boz : Nothing = {
+ try {
+ throw new RuntimeException
+ } catch {
+ case _: Throwable => boz; ???
+ }
+ }
+
+ @annotation.tailrec
+ def bez : Nothing = {
+ try {
+ bez
+ } finally {
+ ???
+ }
+ }
+
+ // the `liftedTree` local method will prevent a tail call here.
+ @annotation.tailrec
+ def bar(i : Int) : Int = {
+ if (i == 0) 0
+ else 1 + (try {
+ throw new RuntimeException
+ } catch {
+ case _: Throwable => bar(i - 1)
+ })
+ }
+}
diff --git a/test/files/neg/t2148.check b/test/files/neg/t2148.check
index 5113b48e51..27b5dce507 100644
--- a/test/files/neg/t2148.check
+++ b/test/files/neg/t2148.check
@@ -1,4 +1,4 @@
-t2148.scala:9: error: type A is not a stable prefix
+t2148.scala:9: error: A is not a legal prefix for a constructor
val b = new A with A#A1
^
one error found
diff --git a/test/files/neg/t3222.check b/test/files/neg/t3222.check
index e724024f45..6170827cc9 100644
--- a/test/files/neg/t3222.check
+++ b/test/files/neg/t3222.check
@@ -1,7 +1,13 @@
-t3222.scala:4: error: not found: type D
- def foo(@throws(classOf[D]) x: Int) {}
- ^
t3222.scala:1: error: not found: type B
@throws(classOf[B])
^
-two errors found
+t3222.scala:4: error: not found: type D
+ def foo(@throws(classOf[D]) x: Int) {}
+ ^
+t3222.scala:3: error: not found: type C
+ @throws(classOf[C])
+ ^
+t3222.scala:6: error: not found: type E
+ @throws(classOf[E])
+ ^
+four errors found
diff --git a/test/files/neg/t3614.check b/test/files/neg/t3614.check
index 0f9c83aa0d..81628ef37f 100644
--- a/test/files/neg/t3614.check
+++ b/test/files/neg/t3614.check
@@ -1,4 +1,4 @@
-t3614.scala:2: error: class type required but AnyRef{def a: Int} found
+t3614.scala:2: error: only declarations allowed here
def v = new ({ def a=0 })
- ^
+ ^
one error found
diff --git a/test/files/neg/t4044.check b/test/files/neg/t4044.check
index 41a04f69b9..0e1ea4f51d 100644
--- a/test/files/neg/t4044.check
+++ b/test/files/neg/t4044.check
@@ -1,11 +1,6 @@
t4044.scala:9: error: AnyRef takes no type parameters, expected: one
M[AnyRef] // error, (AnyRef :: *) not kind-conformant to (N :: * -> * -> *)
^
-t4044.scala:9: error: kinds of the type arguments (<error>) do not conform to the expected kinds of the type parameters (type N).
-<error>'s type parameters do not match type N's expected parameters:
-<none> has no type parameters, but type N has one
- M[AnyRef] // error, (AnyRef :: *) not kind-conformant to (N :: * -> * -> *)
- ^
t4044.scala:11: error: kinds of the type arguments (Test.A) do not conform to the expected kinds of the type parameters (type N).
Test.A's type parameters do not match type N's expected parameters:
type _ has no type parameters, but type O has one
@@ -16,4 +11,4 @@ Test.C's type parameters do not match type N's expected parameters:
type _ has one type parameter, but type _ has none
M[C] // error, (C :: (* -> * -> * -> *) not kind-conformant to (N :: * -> * -> *)
^
-four errors found
+three errors found
diff --git a/test/files/neg/t409.check b/test/files/neg/t409.check
index 433d64d25d..0edc0d03cd 100644
--- a/test/files/neg/t409.check
+++ b/test/files/neg/t409.check
@@ -1,4 +1,4 @@
-t409.scala:6: error: traits or objects may not have parameters
+t409.scala:6: error: class Case1 needs to be a trait to be mixed in
class Toto extends Expr with Case1(12);
- ^
+ ^
one error found
diff --git a/test/files/neg/t5361.check b/test/files/neg/t5361.check
new file mode 100644
index 0000000000..d7fee87ccd
--- /dev/null
+++ b/test/files/neg/t5361.check
@@ -0,0 +1,4 @@
+t5361.scala:2: error: only declarations allowed here
+ val x : { val self = this } = new { self => }
+ ^
+one error found
diff --git a/test/files/neg/t5361.scala b/test/files/neg/t5361.scala
new file mode 100644
index 0000000000..1705c09df3
--- /dev/null
+++ b/test/files/neg/t5361.scala
@@ -0,0 +1,3 @@
+class A {
+ val x : { val self = this } = new { self => }
+}
diff --git a/test/files/neg/t5390.check b/test/files/neg/t5390.check
new file mode 100644
index 0000000000..6a0129b898
--- /dev/null
+++ b/test/files/neg/t5390.check
@@ -0,0 +1,4 @@
+t5390.scala:7: error: forward reference extends over definition of value b
+ val b = a.B("")
+ ^
+one error found
diff --git a/test/files/neg/t5390.scala b/test/files/neg/t5390.scala
new file mode 100644
index 0000000000..dd628f8851
--- /dev/null
+++ b/test/files/neg/t5390.scala
@@ -0,0 +1,10 @@
+class A {
+ object B { def apply(s: String) = 0}
+}
+
+object X {
+ def foo {
+ val b = a.B("")
+ val a = new A
+ }
+} \ No newline at end of file
diff --git a/test/files/neg/t5390b.check b/test/files/neg/t5390b.check
new file mode 100644
index 0000000000..cbf8fafa6b
--- /dev/null
+++ b/test/files/neg/t5390b.check
@@ -0,0 +1,4 @@
+t5390b.scala:7: error: forward reference extends over definition of value b
+ val b = a.B("")
+ ^
+one error found
diff --git a/test/files/neg/t5390b.scala b/test/files/neg/t5390b.scala
new file mode 100644
index 0000000000..c3373b87d3
--- /dev/null
+++ b/test/files/neg/t5390b.scala
@@ -0,0 +1,10 @@
+class A {
+ case class B(s: String)
+}
+
+object X {
+ def foo {
+ val b = a.B("")
+ val a = new A
+ }
+} \ No newline at end of file
diff --git a/test/files/neg/t5390c.check b/test/files/neg/t5390c.check
new file mode 100644
index 0000000000..f8a794d690
--- /dev/null
+++ b/test/files/neg/t5390c.check
@@ -0,0 +1,4 @@
+t5390c.scala:7: error: forward reference extends over definition of value b
+ val b = new a.B("")
+ ^
+one error found
diff --git a/test/files/neg/t5390c.scala b/test/files/neg/t5390c.scala
new file mode 100644
index 0000000000..6b11576611
--- /dev/null
+++ b/test/files/neg/t5390c.scala
@@ -0,0 +1,10 @@
+class A {
+ case class B(s: String)
+}
+
+object X {
+ def foo {
+ val b = new a.B("")
+ val a = new A
+ }
+} \ No newline at end of file
diff --git a/test/files/neg/t5390d.check b/test/files/neg/t5390d.check
new file mode 100644
index 0000000000..daa29142e7
--- /dev/null
+++ b/test/files/neg/t5390d.check
@@ -0,0 +1,4 @@
+t5390d.scala:7: error: forward reference extends over definition of value b
+ val b = a.B.toString
+ ^
+one error found
diff --git a/test/files/neg/t5390d.scala b/test/files/neg/t5390d.scala
new file mode 100644
index 0000000000..7a2671b443
--- /dev/null
+++ b/test/files/neg/t5390d.scala
@@ -0,0 +1,10 @@
+class A {
+ case class B(s: String)
+}
+
+object X {
+ def foo {
+ val b = a.B.toString
+ val a = new A
+ }
+} \ No newline at end of file
diff --git a/test/files/neg/t5529.check b/test/files/neg/t5529.check
index 5d2175fa79..da3f84e1ec 100644
--- a/test/files/neg/t5529.check
+++ b/test/files/neg/t5529.check
@@ -4,7 +4,4 @@ t5529.scala:12: error: File is already defined as class File
t5529.scala:10: error: class type required but test.Test.File found
sealed class Dir extends File { }
^
-t5529.scala:10: error: test.Test.File does not have a constructor
- sealed class Dir extends File { }
- ^
-three errors found
+two errors found
diff --git a/test/files/neg/t5696.check b/test/files/neg/t5696.check
index 72b7781fc4..e0fb61b839 100644
--- a/test/files/neg/t5696.check
+++ b/test/files/neg/t5696.check
@@ -15,5 +15,5 @@ t5696.scala:38: error: too many argument lists for constructor invocation
^
t5696.scala:46: error: too many argument lists for constructor invocation
object x extends G(1)(2) {}
- ^
+ ^
6 errors found
diff --git a/test/files/neg/t6260.check b/test/files/neg/t6260.check
index 2b7f1a8bfb..46e9bd1dfc 100644
--- a/test/files/neg/t6260.check
+++ b/test/files/neg/t6260.check
@@ -1,10 +1,10 @@
-t6260.scala:3: error: bridge generated for member method apply: (x$1: Box[X])Box[Y] in anonymous class $anonfun
+t6260.scala:3: error: bridge generated for member method apply: (bx: Box[X])Box[Y] in anonymous class $anonfun
which overrides method apply: (v1: T1)R in trait Function1
clashes with definition of the member itself;
both have erased type (v1: Object)Object
((bx: Box[X]) => new Box(f(bx.x)))(this)
^
-t6260.scala:8: error: bridge generated for member method apply: (x$1: Box[X])Box[Y] in anonymous class $anonfun
+t6260.scala:8: error: bridge generated for member method apply: (bx: Box[X])Box[Y] in anonymous class $anonfun
which overrides method apply: (v1: T1)R in trait Function1
clashes with definition of the member itself;
both have erased type (v1: Object)Object
diff --git a/test/files/neg/t6535.check b/test/files/neg/t6535.check
new file mode 100644
index 0000000000..1225ea70db
--- /dev/null
+++ b/test/files/neg/t6535.check
@@ -0,0 +1,6 @@
+t6535.scala:2: error: encountered unrecoverable cycle resolving import.
+Note: this is often due in part to a class depending on a definition nested within its companion.
+If applicable, you may wish to try moving some members into another object.
+ import Bs.B._
+ ^
+one error found
diff --git a/test/files/neg/t6535.scala b/test/files/neg/t6535.scala
new file mode 100644
index 0000000000..30a750311c
--- /dev/null
+++ b/test/files/neg/t6535.scala
@@ -0,0 +1,15 @@
+object As {
+ import Bs.B._
+
+ object A
+ extends scala.AnyRef // needed for the cycle;
+ // replacing with a locally defined closs doesn't
+ // hit the locked import and hence doesn't cycle.
+}
+
+object Bs {
+ import As.A._
+
+ object B
+ extends scala.AnyRef // scala.Immutable, ...
+}
diff --git a/test/files/neg/t6558.check b/test/files/neg/t6558.check
new file mode 100644
index 0000000000..6ad3cecd50
--- /dev/null
+++ b/test/files/neg/t6558.check
@@ -0,0 +1,10 @@
+t6558.scala:4: error: not found: type classs
+ @classs
+ ^
+t6558.scala:7: error: not found: type typeparam
+ class D[@typeparam T]
+ ^
+t6558.scala:10: error: not found: type valueparam
+ @valueparam x: Any
+ ^
+three errors found
diff --git a/test/files/neg/t6558.scala b/test/files/neg/t6558.scala
new file mode 100644
index 0000000000..b4304ff686
--- /dev/null
+++ b/test/files/neg/t6558.scala
@@ -0,0 +1,12 @@
+class AnnotNotFound {
+ def foo(a: Any) = ()
+
+ @classs
+ class C
+
+ class D[@typeparam T]
+
+ class E(
+ @valueparam x: Any
+ )
+}
diff --git a/test/files/neg/t6558b.check b/test/files/neg/t6558b.check
new file mode 100644
index 0000000000..cfa384fc08
--- /dev/null
+++ b/test/files/neg/t6558b.check
@@ -0,0 +1,7 @@
+t6558b.scala:5: error: not found: type inargument
+ @inargument
+ ^
+t6558b.scala:11: error: not found: type infunction
+ @infunction
+ ^
+two errors found
diff --git a/test/files/neg/t6558b.scala b/test/files/neg/t6558b.scala
new file mode 100644
index 0000000000..2aa06f69cf
--- /dev/null
+++ b/test/files/neg/t6558b.scala
@@ -0,0 +1,15 @@
+class AnnotNotFound {
+ def foo(a: Any) = ()
+
+ foo {
+ @inargument
+ def foo = 0
+ foo
+ }
+
+ () => {
+ @infunction
+ def foo = 0
+ ()
+ }
+}
diff --git a/test/files/neg/t6667.check b/test/files/neg/t6667.check
new file mode 100644
index 0000000000..43313fa4fe
--- /dev/null
+++ b/test/files/neg/t6667.check
@@ -0,0 +1,13 @@
+t6667.scala:8: error: ambiguous implicit values:
+ both value inScope1 in object Test of type => C
+ and value inScope2 in object Test of type => C
+ match expected type C
+ implicitly[C]: Unit // C.companion was used; whereas the ambiguity should abort the implicit search.
+ ^
+t6667.scala:9: error: ambiguous implicit values:
+ both value inScope1 in object Test of type => C
+ and value inScope2 in object Test of type => C
+ match expected type C
+ implicitly[C] // ambiguity reported, rather than falling back to C.companion
+ ^
+two errors found
diff --git a/test/files/neg/t6667.scala b/test/files/neg/t6667.scala
new file mode 100644
index 0000000000..fb857ebd33
--- /dev/null
+++ b/test/files/neg/t6667.scala
@@ -0,0 +1,10 @@
+class C
+object C {
+ implicit def companion = new C
+}
+
+object Test {
+ implicit val inScope1, inScope2 = new C
+ implicitly[C]: Unit // C.companion was used; whereas the ambiguity should abort the implicit search.
+ implicitly[C] // ambiguity reported, rather than falling back to C.companion
+}
diff --git a/test/files/neg/t6667b.check b/test/files/neg/t6667b.check
new file mode 100644
index 0000000000..99cea9a47c
--- /dev/null
+++ b/test/files/neg/t6667b.check
@@ -0,0 +1,13 @@
+t6667b.scala:16: error: ambiguous implicit values:
+ both value a in object Test of type => Test.Box
+ and value b of type Test.Box
+ match expected type Test.Box
+ new Test()
+ ^
+t6667b.scala:19: error: ambiguous implicit values:
+ both value a in object Test of type => Test.Box
+ and value b of type Test.Box
+ match expected type Test.Box
+ new Test()
+ ^
+two errors found
diff --git a/test/files/neg/t6667b.scala b/test/files/neg/t6667b.scala
new file mode 100644
index 0000000000..4e64e1af17
--- /dev/null
+++ b/test/files/neg/t6667b.scala
@@ -0,0 +1,25 @@
+object Test {
+ abstract class Box {
+ val value: Int
+ }
+
+ implicit val a: Box = new Box {
+ val value= 1
+ }
+
+ def main(args: Array[String]) {
+ implicit val b: Box= new Box {
+ val value= 2
+ }
+
+ new Object {
+ new Test()
+ }
+ // compare with:
+ new Test()
+ }
+}
+
+class Test()(implicit x: Test.Box) {
+ println(x.value)
+}
diff --git a/test/files/neg/t667.check b/test/files/neg/t667.check
index d4367bc87b..e68c6dea00 100644
--- a/test/files/neg/t667.check
+++ b/test/files/neg/t667.check
@@ -1,4 +1,4 @@
-t667.scala:8: error: class Ni inherits itself
+t667.scala:8: error: illegal cyclic reference involving class Ni
class Ni extends super.Ni with Ni;
- ^
+ ^
one error found
diff --git a/test/files/neg/t6758.check b/test/files/neg/t6758.check
new file mode 100644
index 0000000000..2cdd6b8ae5
--- /dev/null
+++ b/test/files/neg/t6758.check
@@ -0,0 +1,28 @@
+t6758.scala:5: error: not found: type inargument
+ @inargument
+ ^
+t6758.scala:11: error: not found: type infunction
+ @infunction
+ ^
+t6758.scala:18: error: not found: type nested
+ @nested
+ ^
+t6758.scala:25: error: not found: type param
+ def func(@param x: Int): Int = 0
+ ^
+t6758.scala:28: error: not found: type typealias
+ @typealias
+ ^
+t6758.scala:32: error: not found: type classs
+ @classs
+ ^
+t6758.scala:35: error: not found: type module
+ @module
+ ^
+t6758.scala:38: error: not found: type typeparam
+ class D[@typeparam T]
+ ^
+t6758.scala:41: error: not found: type valueparam
+ @valueparam x: Any
+ ^
+9 errors found
diff --git a/test/files/neg/t6758.scala b/test/files/neg/t6758.scala
new file mode 100644
index 0000000000..acf333bf90
--- /dev/null
+++ b/test/files/neg/t6758.scala
@@ -0,0 +1,43 @@
+class AnnotNotFound {
+ def foo(a: Any) = ()
+
+ foo {
+ @inargument
+ def foo = 0
+ foo
+ }
+
+ () => {
+ @infunction
+ def foo = 0
+ ()
+ }
+
+ () => {
+ val bar: Int = {
+ @nested
+ val bar2: Int = 2
+ 2
+ }
+ ()
+ }
+
+ def func(@param x: Int): Int = 0
+
+ abstract class A {
+ @typealias
+ type B = Int
+ }
+
+ @classs
+ class C
+
+ @module
+ object D
+
+ class D[@typeparam T]
+
+ class E(
+ @valueparam x: Any
+ )
+}
diff --git a/test/files/neg/t877.check b/test/files/neg/t877.check
index 5f25bd439c..c3d4ab6584 100644
--- a/test/files/neg/t877.check
+++ b/test/files/neg/t877.check
@@ -1,7 +1,7 @@
t877.scala:3: error: Invalid literal number
trait Foo extends A(22A, Bug!) {}
^
-t877.scala:3: error: parents of traits may not have parameters
+t877.scala:3: error: ')' expected but eof found.
trait Foo extends A(22A, Bug!) {}
- ^
+ ^
two errors found
diff --git a/test/files/pos/annotated-treecopy.check b/test/files/pos/annotated-treecopy.check
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/files/pos/annotated-treecopy.check
diff --git a/test/files/pos/annotated-treecopy.flags b/test/files/pos/annotated-treecopy.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/pos/annotated-treecopy.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/pos/annotated-treecopy/Impls_Macros_1.scala b/test/files/pos/annotated-treecopy/Impls_Macros_1.scala
new file mode 100644
index 0000000000..d92fbca380
--- /dev/null
+++ b/test/files/pos/annotated-treecopy/Impls_Macros_1.scala
@@ -0,0 +1,53 @@
+import scala.language.experimental.macros
+import scala.reflect.macros.Context
+import collection.mutable.ListBuffer
+import collection.mutable.Stack
+
+object Macros {
+ trait TypedFunction {
+ def tree: scala.reflect.runtime.universe.Tree
+ val typeIn: String
+ val typeOut: String
+ }
+
+ def tree[T,U](f:Function1[T,U]): Function1[T,U] = macro tree_impl[T,U]
+
+ def tree_impl[T:c.WeakTypeTag,U:c.WeakTypeTag](c: Context)
+ (f:c.Expr[Function1[T,U]]): c.Expr[Function1[T,U]] = {
+ import c.universe._
+ val ttag = c.weakTypeTag[U]
+ f match {
+ case Expr(Function(List(ValDef(_,n,tp,_)),b)) =>
+ // normalize argument name
+ var b1 = new Transformer {
+ override def transform(tree: Tree): Tree = tree match {
+ case Ident(x) if (x==n) => Ident(newTermName("_arg"))
+ case tt @ TypeTree() if tt.original != null => TypeTree(tt.tpe) setOriginal transform(tt.original)
+ // without the fix to LazyTreeCopier.Annotated, we would need to uncomment the line below to make the macro work
+ // that's because the pattern match in the input expression gets expanded into Typed(<x>, TypeTree(<Int @unchecked>))
+ // with the original of the TypeTree being Annotated(<@unchecked>, Ident(<x>))
+ // then the macro tries to replace all Ident(<x>) trees with Ident(<_arg>), recurs into the original of the TypeTree, changes it,
+ // but leaves the <@unchecked> part untouched. this signals the misguided LazyTreeCopier that the Annotated tree hasn't been modified,
+ // so the original tree should be copied over and returned => crash when later <x: @unchecked> re-emerges from TypeTree.original
+ // case Annotated(annot, arg) => treeCopy.Annotated(tree, transform(annot).duplicate, transform(arg))
+ case _ => super.transform(tree)
+ }
+ }.transform(b)
+
+ val reifiedTree = c.reifyTree(treeBuild.mkRuntimeUniverseRef, EmptyTree, b1)
+ val reifiedExpr = c.Expr[scala.reflect.runtime.universe.Expr[T => U]](reifiedTree)
+ val template =
+ c.universe.reify(new (T => U) with TypedFunction {
+ override def toString = c.literal(tp+" => "+ttag.tpe+" { "+b1.toString+" } ").splice // DEBUG
+ def tree = reifiedExpr.splice.tree
+ val typeIn = c.literal(tp.toString).splice
+ val typeOut = c.literal(ttag.tpe.toString).splice
+ def apply(_arg: T): U = c.Expr[U](b1)(ttag.asInstanceOf[c.WeakTypeTag[U]]).splice
+ })
+ val untyped = c.resetLocalAttrs(template.tree)
+
+ c.Expr[T => U](untyped)
+ case _ => sys.error("Bad function type")
+ }
+ }
+} \ No newline at end of file
diff --git a/test/files/pos/annotated-treecopy/Test_2.scala b/test/files/pos/annotated-treecopy/Test_2.scala
new file mode 100644
index 0000000000..836e0d888d
--- /dev/null
+++ b/test/files/pos/annotated-treecopy/Test_2.scala
@@ -0,0 +1,5 @@
+object Test extends App {
+ import Macros._
+ // tree { (x:((Int,Int,Int),(Int,Int,Int))) => { val y=x; val ((r1,m1,c1),(r2,m2,c2))=y; (r1, m1 + m2 + r1 * c1 * c2, c2) } }
+ tree { (x:((Int,Int,Int),(Int,Int,Int))) => { val ((r1,m1,c1),(r2,m2,c2))=x; (r1, m1 + m2 + r1 * c1 * c2, c2) } }
+} \ No newline at end of file
diff --git a/test/files/pos/attachments-typed-ident.check b/test/files/pos/attachments-typed-ident.check
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/test/files/pos/attachments-typed-ident.check
diff --git a/test/files/pos/attachments-typed-ident.flags b/test/files/pos/attachments-typed-ident.flags
new file mode 100644
index 0000000000..cd66464f2f
--- /dev/null
+++ b/test/files/pos/attachments-typed-ident.flags
@@ -0,0 +1 @@
+-language:experimental.macros \ No newline at end of file
diff --git a/test/files/pos/attachments-typed-ident/Impls_1.scala b/test/files/pos/attachments-typed-ident/Impls_1.scala
new file mode 100644
index 0000000000..cc40893a93
--- /dev/null
+++ b/test/files/pos/attachments-typed-ident/Impls_1.scala
@@ -0,0 +1,17 @@
+import scala.reflect.macros.Context
+import language.experimental.macros
+
+object MyAttachment
+
+object Macros {
+ def impl(c: Context) = {
+ import c.universe._
+ val ident = Ident(newTermName("bar")) updateAttachment MyAttachment
+ assert(ident.attachments.get[MyAttachment.type].isDefined, ident.attachments)
+ val typed = c.typeCheck(ident)
+ assert(typed.attachments.get[MyAttachment.type].isDefined, typed.attachments)
+ c.Expr[Int](typed)
+ }
+
+ def foo = macro impl
+} \ No newline at end of file
diff --git a/test/files/pos/attachments-typed-ident/Macros_Test_2.scala b/test/files/pos/attachments-typed-ident/Macros_Test_2.scala
new file mode 100644
index 0000000000..37065ead4b
--- /dev/null
+++ b/test/files/pos/attachments-typed-ident/Macros_Test_2.scala
@@ -0,0 +1,4 @@
+object Test extends App {
+ def bar = 2
+ Macros.foo
+} \ No newline at end of file
diff --git a/test/files/pos/strip-tvars-for-lubbasetypes.scala b/test/files/pos/strip-tvars-for-lubbasetypes.scala
new file mode 100644
index 0000000000..2be8625bae
--- /dev/null
+++ b/test/files/pos/strip-tvars-for-lubbasetypes.scala
@@ -0,0 +1,25 @@
+object Test {
+
+ implicit final class EqualOps[T](val x: T) extends AnyVal {
+ def ===[T1, Ph >: T <: T1, Ph2 >: Ph <: T1](other: T1): Boolean = x == other
+ def !!![T1, Ph2 >: Ph <: T1, Ph >: T <: T1](other: T1): Boolean = x == other
+ }
+
+ class A
+ class B extends A
+ class C extends A
+
+ val a = new A
+ val b = new B
+ val c = new C
+
+ val x1 = a === b
+ val x2 = b === a
+ val x3 = b === c // error, infers Object{} for T1
+ val x4 = b.===[A, B, B](c)
+
+ val x5 = b !!! c // always compiled due to the order of Ph2 and Ph
+
+
+
+}
diff --git a/test/files/pos/t1672.scala b/test/files/pos/t1672.scala
new file mode 100644
index 0000000000..5ee6bb1759
--- /dev/null
+++ b/test/files/pos/t1672.scala
@@ -0,0 +1,10 @@
+object Test {
+ @annotation.tailrec
+ def bar : Nothing = {
+ try {
+ throw new RuntimeException
+ } catch {
+ case _: Throwable => bar
+ }
+ }
+}
diff --git a/test/files/pos/t5390.scala b/test/files/pos/t5390.scala
new file mode 100644
index 0000000000..36febb6a58
--- /dev/null
+++ b/test/files/pos/t5390.scala
@@ -0,0 +1,11 @@
+class A {
+ case class B[A](s: String)
+}
+
+object X {
+ def foo {
+ val a = new A
+ val b = new a.B[c.type]("") // not a forward reference
+ val c = ""
+ }
+} \ No newline at end of file
diff --git a/test/files/pos/t5726.scala b/test/files/pos/t5726.scala
new file mode 100644
index 0000000000..b28ebd8674
--- /dev/null
+++ b/test/files/pos/t5726.scala
@@ -0,0 +1,17 @@
+import scala.language.dynamics
+
+class DynamicTest extends Dynamic {
+ def selectDynamic(name: String) = s"value of $name"
+ def updateDynamic(name: String)(value: Any) {
+ println(s"You have just updated property '$name' with value: $value")
+ }
+}
+
+object MyApp extends App {
+ def testing() {
+ val test = new DynamicTest
+ test.firstName = "John"
+ }
+
+ testing()
+}
diff --git a/test/files/pos/t5877.scala b/test/files/pos/t5877.scala
new file mode 100644
index 0000000000..c7827df99f
--- /dev/null
+++ b/test/files/pos/t5877.scala
@@ -0,0 +1,14 @@
+package foo {
+ class Foo
+
+ object Test {
+ new Foo().huzzah
+ }
+}
+
+package object foo {
+ // Crasher: No synthetics for method PimpedFoo2: synthetics contains
+ implicit class PimpedFoo2(value: Foo) {
+ def huzzah = ""
+ }
+}
diff --git a/test/files/pos/t5877b.scala b/test/files/pos/t5877b.scala
new file mode 100644
index 0000000000..6b8cbd473e
--- /dev/null
+++ b/test/files/pos/t5877b.scala
@@ -0,0 +1,13 @@
+package foo
+
+class Foo
+
+object Test {
+ new Foo().huzzah
+}
+
+object `package` {
+ implicit class PimpedFoo2(value: Foo) {
+ def huzzah = ""
+ }
+}
diff --git a/test/files/pos/t6547.flags b/test/files/pos/t6547.flags
new file mode 100644
index 0000000000..c9b68d70dc
--- /dev/null
+++ b/test/files/pos/t6547.flags
@@ -0,0 +1 @@
+-optimise
diff --git a/test/files/pos/t6547.scala b/test/files/pos/t6547.scala
new file mode 100644
index 0000000000..53bd798219
--- /dev/null
+++ b/test/files/pos/t6547.scala
@@ -0,0 +1,6 @@
+trait ConfigurableDefault[@specialized V] {
+ def fillArray(arr: Array[V], v: V) = (arr: Any) match {
+ case x: Array[Int] => null
+ case x: Array[Long] => v.asInstanceOf[Long]
+ }
+}
diff --git a/test/files/pos/t6551.scala b/test/files/pos/t6551.scala
index fb68663809..8bb396a19f 100644
--- a/test/files/pos/t6551.scala
+++ b/test/files/pos/t6551.scala
@@ -1,4 +1,4 @@
-import language.dynamics
+import scala.language.dynamics
object Test {
def main(args: Array[String]) {
diff --git a/test/files/pos/t6712.scala b/test/files/pos/t6712.scala
new file mode 100644
index 0000000000..3c96eb14fb
--- /dev/null
+++ b/test/files/pos/t6712.scala
@@ -0,0 +1,5 @@
+class H {
+ object O
+
+ def foo() { object O }
+}
diff --git a/test/files/pos/t6722.scala b/test/files/pos/t6722.scala
new file mode 100644
index 0000000000..576746c915
--- /dev/null
+++ b/test/files/pos/t6722.scala
@@ -0,0 +1,11 @@
+import scala.language.dynamics
+
+class Dyn extends Dynamic {
+ def selectDynamic(s: String): Dyn = new Dyn
+ def get[T]: T = null.asInstanceOf[T]
+}
+
+object Foo {
+ val dyn = new Dyn
+ dyn.foo.bar.baz.get[String]
+}
diff --git a/test/files/presentation/doc.check b/test/files/presentation/doc.check
new file mode 100755
index 0000000000..62b3bfc2e3
--- /dev/null
+++ b/test/files/presentation/doc.check
@@ -0,0 +1,48 @@
+body:Body(List(Paragraph(Chain(List(Summary(Chain(List(Text(This is a test comment), Text(.)))), Text(
+))))))
+@example:Body(List(Paragraph(Chain(List(Summary(Monospace(Text("abb".permutations = Iterator(abb, bab, bba)))))))))
+@version:
+@since:
+@todo:
+@note:
+@see:
+body:Body(List(Paragraph(Chain(List(Summary(Chain(List(Text(This is a test comment), Text(.)))), Text(
+))))))
+@example:Body(List(Paragraph(Chain(List(Summary(Monospace(Text("abb".permutations = Iterator(abb, bab, bba)))))))))
+@version:Body(List(Paragraph(Chain(List(Summary(Chain(List(Text(1), Text(.)))), Text(0, 09/07/2012))))))
+@since:
+@todo:
+@note:
+@see:
+body:Body(List(Paragraph(Chain(List(Summary(Chain(List(Text(This is a test comment), Text(.)))), Text(
+))))))
+@example:Body(List(Paragraph(Chain(List(Summary(Monospace(Text("abb".permutations = Iterator(abb, bab, bba)))))))))
+@version:Body(List(Paragraph(Chain(List(Summary(Chain(List(Text(1), Text(.)))), Text(0, 09/07/2012))))))
+@since:Body(List(Paragraph(Chain(List(Summary(Chain(List(Text(2), Text(.)))), Text(10))))))
+@todo:
+@note:
+@see:
+body:Body(List(Paragraph(Chain(List(Summary(Chain(List(Text(This is a test comment), Text(.)))), Text(
+))))))
+@example:Body(List(Paragraph(Chain(List(Summary(Monospace(Text("abb".permutations = Iterator(abb, bab, bba)))))))))
+@version:Body(List(Paragraph(Chain(List(Summary(Chain(List(Text(1), Text(.)))), Text(0, 09/07/2012))))))
+@since:Body(List(Paragraph(Chain(List(Summary(Chain(List(Text(2), Text(.)))), Text(10))))))
+@todo:Body(List(Paragraph(Chain(List(Summary(Text(this method is unsafe)))))))
+@note:
+@see:
+body:Body(List(Paragraph(Chain(List(Summary(Chain(List(Text(This is a test comment), Text(.)))), Text(
+))))))
+@example:Body(List(Paragraph(Chain(List(Summary(Monospace(Text("abb".permutations = Iterator(abb, bab, bba)))))))))
+@version:Body(List(Paragraph(Chain(List(Summary(Chain(List(Text(1), Text(.)))), Text(0, 09/07/2012))))))
+@since:Body(List(Paragraph(Chain(List(Summary(Chain(List(Text(2), Text(.)))), Text(10))))))
+@todo:Body(List(Paragraph(Chain(List(Summary(Text(this method is unsafe)))))))
+@note:Body(List(Paragraph(Chain(List(Summary(Text(Don't inherit!)))))))
+@see:
+body:Body(List(Paragraph(Chain(List(Summary(Chain(List(Text(This is a test comment), Text(.)))), Text(
+))))))
+@example:Body(List(Paragraph(Chain(List(Summary(Monospace(Text("abb".permutations = Iterator(abb, bab, bba)))))))))
+@version:Body(List(Paragraph(Chain(List(Summary(Chain(List(Text(1), Text(.)))), Text(0, 09/07/2012))))))
+@since:Body(List(Paragraph(Chain(List(Summary(Chain(List(Text(2), Text(.)))), Text(10))))))
+@todo:Body(List(Paragraph(Chain(List(Summary(Text(this method is unsafe)))))))
+@note:Body(List(Paragraph(Chain(List(Summary(Text(Don't inherit!)))))))
+@see:Body(List(Paragraph(Chain(List(Summary(Text(some other method)))))))
diff --git a/test/files/presentation/doc.scala b/test/files/presentation/doc.scala
new file mode 100755
index 0000000000..4b0d6baa1f
--- /dev/null
+++ b/test/files/presentation/doc.scala
@@ -0,0 +1,71 @@
+import scala.tools.nsc.doc
+import scala.tools.nsc.doc.base.LinkTo
+import scala.tools.nsc.doc.base.comment._
+import scala.tools.nsc.interactive._
+import scala.tools.nsc.interactive.tests._
+import scala.tools.nsc.util._
+import scala.tools.nsc.io._
+
+object Test extends InteractiveTest {
+ override val settings: doc.Settings = docSettings
+
+ val tags = Seq(
+ "@example `\"abb\".permutations = Iterator(abb, bab, bba)`",
+ "@version 1.0, 09/07/2012",
+ "@since 2.10",
+ "@todo this method is unsafe",
+ "@note Don't inherit!",
+ "@see some other method"
+ )
+
+ val comment = "This is a test comment."
+ val caret = "<caret>"
+
+ def text(nTags: Int) =
+ """|/** %s
+ |
+ | * %s */
+ |trait Commented {}
+ |class User(c: %sCommented)""".stripMargin.format(comment, tags take nTags mkString "\n", caret)
+
+ override def main(args: Array[String]) {
+ val documenter = new Doc(settings) {
+ val global: compiler.type = compiler
+
+ def chooseLink(links: List[LinkTo]): LinkTo = links.head
+ }
+ for (i <- 1 to tags.length) {
+ val markedText = text(i)
+ val idx = markedText.indexOf(caret)
+ val fileText = markedText.substring(0, idx) + markedText.substring(idx + caret.length)
+ val source = sourceFiles(0)
+ val batch = new BatchSourceFile(source.file, fileText.toCharArray)
+ val reloadResponse = new Response[Unit]
+ compiler.askReload(List(batch), reloadResponse)
+ reloadResponse.get.left.toOption match {
+ case None =>
+ reporter.println("Couldn't reload")
+ case Some(_) =>
+ val treeResponse = new compiler.Response[compiler.Tree]
+ val pos = compiler.rangePos(batch, idx, idx, idx)
+ compiler.askTypeAt(pos, treeResponse)
+ treeResponse.get.left.toOption match {
+ case Some(tree) =>
+ val sym = tree.tpe.typeSymbol
+ documenter.retrieve(sym, sym.owner) match {
+ case Some(HtmlResult(comment)) =>
+ import comment._
+ val tags: List[(String, Iterable[Body])] =
+ List(("@example", example), ("@version", version), ("@since", since.toList), ("@todo", todo), ("@note", note), ("@see", see))
+ val str = ("body:" + body + "\n") +
+ tags.map{ case (name, bodies) => name + ":" + bodies.mkString("\n") }.mkString("\n")
+ reporter.println(str)
+ case Some(_) => reporter.println("Got unexpected result")
+ case None => reporter.println("Got no result")
+ }
+ case None => reporter.println("Couldn't find a typedTree")
+ }
+ }
+ }
+ }
+}
diff --git a/test/files/presentation/doc/src/Test.scala b/test/files/presentation/doc/src/Test.scala
new file mode 100755
index 0000000000..fcc1554994
--- /dev/null
+++ b/test/files/presentation/doc/src/Test.scala
@@ -0,0 +1 @@
+object Test \ No newline at end of file
diff --git a/test/files/presentation/memory-leaks/MemoryLeaksTest.scala b/test/files/presentation/memory-leaks/MemoryLeaksTest.scala
index a5533a623a..159097cc10 100644
--- a/test/files/presentation/memory-leaks/MemoryLeaksTest.scala
+++ b/test/files/presentation/memory-leaks/MemoryLeaksTest.scala
@@ -5,6 +5,7 @@ import java.util.Calendar
import scala.tools.nsc.interactive.tests._
import scala.tools.nsc.util._
import scala.tools.nsc.io._
+import scala.tools.nsc.doc
/** This test runs the presentation compiler on the Scala compiler project itself and records memory consumption.
*
@@ -24,6 +25,8 @@ import scala.tools.nsc.io._
object Test extends InteractiveTest {
final val mega = 1024 * 1024
+ override val settings: doc.Settings = docSettings
+
override def execute(): Unit = memoryConsumptionTest()
def batchSource(name: String) =
@@ -120,4 +123,4 @@ object Test extends InteractiveTest {
r.totalMemory() - r.freeMemory()
}
-} \ No newline at end of file
+}
diff --git a/test/files/run/idempotency-case-classes.check b/test/files/run/idempotency-case-classes.check
new file mode 100644
index 0000000000..d2fb8169cb
--- /dev/null
+++ b/test/files/run/idempotency-case-classes.check
@@ -0,0 +1,52 @@
+C(2,3)
+()
+{
+ case class C extends AnyRef with Product with Serializable {
+ <caseaccessor> <paramaccessor> private[this] val x: Int = _;
+ <stable> <caseaccessor> <accessor> <paramaccessor> def x: Int = C.this.x;
+ <caseaccessor> <paramaccessor> private[this] val y: Int = _;
+ <stable> <caseaccessor> <accessor> <paramaccessor> def y: Int = C.this.y;
+ def <init>(x: Int, y: Int): C = {
+ C.super.<init>();
+ ()
+ };
+ <synthetic> def copy(x: Int = x, y: Int = y): C = new C(x, y);
+ <synthetic> def copy$default$1: Int = C.this.x;
+ <synthetic> def copy$default$2: Int = C.this.y;
+ override <synthetic> def productPrefix: String = "C";
+ <synthetic> def productArity: Int = 2;
+ <synthetic> def productElement(x$1: Int): Any = x$1 match {
+ case 0 => C.this.x
+ case 1 => C.this.y
+ case _ => throw new IndexOutOfBoundsException(x$1.toString())
+ };
+ override <synthetic> def productIterator: Iterator[Any] = runtime.this.ScalaRunTime.typedProductIterator[Any](C.this);
+ <synthetic> def canEqual(x$1: Any): Boolean = x$1.$isInstanceOf[C]();
+ override <synthetic> def hashCode(): Int = {
+ <synthetic> var acc: Int = -889275714;
+ acc = Statics.this.mix(acc, x);
+ acc = Statics.this.mix(acc, y);
+ Statics.this.finalizeHash(acc, 2)
+ };
+ override <synthetic> def toString(): String = ScalaRunTime.this._toString(C.this);
+ override <synthetic> def equals(x$1: Any): Boolean = C.this.eq(x$1.asInstanceOf[Object]).||(x$1.isInstanceOf[C].&&({
+ <synthetic> val C$1: C = x$1.asInstanceOf[C];
+ C.this.x.==(C$1.x).&&(C.this.y.==(C$1.y)).&&(C$1.canEqual(C.this))
+ }))
+ };
+ <synthetic> object C extends scala.runtime.AbstractFunction2[Int,Int,C] with Serializable {
+ def <init>(): C.type = {
+ C.super.<init>();
+ ()
+ };
+ final override def toString(): String = "C";
+ case <synthetic> def apply(x: Int, y: Int): C = new C(x, y);
+ case <synthetic> def unapply(x$0: C): Option[(Int, Int)] = if (x$0.==(null))
+ scala.this.None
+ else
+ Some.apply[(Int, Int)](Tuple2.apply[Int, Int](x$0.x, x$0.y));
+ <synthetic> private def readResolve(): Object = C
+ };
+ scala.this.Predef.println(C.apply(2, 3))
+}
+error!
diff --git a/test/files/run/idempotency-case-classes.scala b/test/files/run/idempotency-case-classes.scala
new file mode 100644
index 0000000000..4da8393cb6
--- /dev/null
+++ b/test/files/run/idempotency-case-classes.scala
@@ -0,0 +1,22 @@
+import scala.reflect.runtime.universe._
+import scala.reflect.runtime.{currentMirror => cm}
+import scala.tools.reflect.{ToolBox, ToolBoxError}
+import scala.tools.reflect.Eval
+
+object Test extends App {
+ val casee = reify {
+ case class C(x: Int, y: Int)
+ println(C(2, 3))
+ }
+ println(casee.eval)
+ val tb = cm.mkToolBox()
+ val tcasee = tb.typeCheck(casee.tree)
+ println(tcasee)
+ val rtcasee = tb.resetAllAttrs(tcasee)
+ try {
+ println(tb.eval(rtcasee))
+ } catch {
+ // this is the current behaviour, rather than the desired behavior; see SI-5467
+ case _: ToolBoxError => println("error!")
+ }
+} \ No newline at end of file
diff --git a/test/files/run/idempotency-extractors.check b/test/files/run/idempotency-extractors.check
new file mode 100644
index 0000000000..fcd50faa79
--- /dev/null
+++ b/test/files/run/idempotency-extractors.check
@@ -0,0 +1,5 @@
+2
+2 match {
+ case Test.this.Extractor.unapply(<unapply-selector>) <unapply> ((x @ _)) => x
+}
+error!
diff --git a/test/files/run/idempotency-extractors.scala b/test/files/run/idempotency-extractors.scala
new file mode 100644
index 0000000000..fe033295f5
--- /dev/null
+++ b/test/files/run/idempotency-extractors.scala
@@ -0,0 +1,22 @@
+import scala.reflect.runtime.universe._
+import scala.reflect.runtime.{currentMirror => cm}
+import scala.tools.reflect.{ToolBox, ToolBoxError}
+import scala.tools.reflect.Eval
+
+object Test extends App {
+ object Extractor { def unapply(x: Int): Option[Int] = Some(x) }
+ val extractor = reify {
+ 2 match { case Extractor(x) => x }
+ }
+ println(extractor.eval)
+ val tb = cm.mkToolBox()
+ val textractor = tb.typeCheck(extractor.tree)
+ println(textractor)
+ val rtextractor = tb.resetAllAttrs(textractor)
+ try {
+ println(tb.eval(rtextractor))
+ } catch {
+ // this is the current behaviour, rather than the desired behavior; see SI-5465
+ case _: ToolBoxError => println("error!")
+ }
+} \ No newline at end of file
diff --git a/test/files/run/idempotency-labels.check b/test/files/run/idempotency-labels.check
new file mode 100644
index 0000000000..8709efeb43
--- /dev/null
+++ b/test/files/run/idempotency-labels.check
@@ -0,0 +1,15 @@
+2
+{
+ var x: Int = 0;
+ while$1(){
+ if (x.<(2))
+ {
+ x = x.+(1);
+ while$1()
+ }
+ else
+ ()
+ };
+ x
+}
+2
diff --git a/test/files/run/idempotency-labels.scala b/test/files/run/idempotency-labels.scala
new file mode 100644
index 0000000000..82d009751a
--- /dev/null
+++ b/test/files/run/idempotency-labels.scala
@@ -0,0 +1,22 @@
+import scala.reflect.runtime.universe._
+import scala.reflect.runtime.{currentMirror => cm}
+import scala.tools.reflect.{ToolBox, ToolBoxError}
+import scala.tools.reflect.Eval
+
+object Test extends App {
+ val label = reify {
+ var x = 0
+ while (x < 2) { x += 1 }
+ x
+ }
+ println(label.eval)
+ val tb = cm.mkToolBox()
+ val tlabel = tb.typeCheck(label.tree)
+ println(tlabel)
+ val rtlabel = tb.resetAllAttrs(tlabel)
+ try {
+ println(tb.eval(rtlabel))
+ } catch {
+ case _: ToolBoxError => println("error!")
+ }
+} \ No newline at end of file
diff --git a/test/files/run/idempotency-lazy-vals.check b/test/files/run/idempotency-lazy-vals.check
new file mode 100644
index 0000000000..4dcbf96184
--- /dev/null
+++ b/test/files/run/idempotency-lazy-vals.check
@@ -0,0 +1,23 @@
+6
+{
+ class C extends AnyRef {
+ def <init>(): C = {
+ C.super.<init>();
+ ()
+ };
+ lazy private[this] val x: Int = _;
+ <stable> <accessor> lazy def x: Int = {
+ C.this.x = 2;
+ C.this.x
+ };
+ lazy private[this] val y: Int = _;
+ implicit <stable> <accessor> lazy def y: Int = {
+ C.this.y = 3;
+ C.this.y
+ }
+ };
+ val c: C = new C();
+ import c._;
+ c.x.*(scala.this.Predef.implicitly[Int](c.y))
+}
+error!
diff --git a/test/files/run/idempotency-lazy-vals.scala b/test/files/run/idempotency-lazy-vals.scala
new file mode 100644
index 0000000000..3531f9ff4b
--- /dev/null
+++ b/test/files/run/idempotency-lazy-vals.scala
@@ -0,0 +1,27 @@
+import scala.reflect.runtime.universe._
+import scala.reflect.runtime.{currentMirror => cm}
+import scala.tools.reflect.{ToolBox, ToolBoxError}
+import scala.tools.reflect.Eval
+
+object Test extends App {
+ val lazee = reify {
+ class C {
+ lazy val x = 2
+ implicit lazy val y = 3
+ }
+ val c = new C()
+ import c._
+ x * implicitly[Int]
+ }
+ println(lazee.eval)
+ val tb = cm.mkToolBox()
+ val tlazee = tb.typeCheck(lazee.tree)
+ println(tlazee)
+ val rtlazee = tb.resetAllAttrs(tlazee)
+ try {
+ println(tb.eval(rtlazee))
+ } catch {
+ // this is the current behaviour, rather than the desired behavior; see SI-5466
+ case _: ToolBoxError => println("error!")
+ }
+} \ No newline at end of file
diff --git a/test/files/run/idempotency-partial-functions.check b/test/files/run/idempotency-partial-functions.check
new file mode 100644
index 0000000000..5c8a411655
--- /dev/null
+++ b/test/files/run/idempotency-partial-functions.check
@@ -0,0 +1,2 @@
+error!!
+error!
diff --git a/test/files/run/idempotency-partial-functions.scala b/test/files/run/idempotency-partial-functions.scala
new file mode 100644
index 0000000000..dd5f1167f1
--- /dev/null
+++ b/test/files/run/idempotency-partial-functions.scala
@@ -0,0 +1,25 @@
+import scala.reflect.runtime.universe._
+import scala.reflect.runtime.{currentMirror => cm}
+import scala.tools.reflect.{ToolBox, ToolBoxError}
+import scala.tools.reflect.Eval
+
+object Test extends App {
+ val partials = reify {
+ List((false,true)) collect { case (x,true) => x }
+ }
+ try {
+ println(partials.eval)
+ } catch {
+ case _: ToolBoxError => println("error!!")
+ }
+ try {
+ val tb = cm.mkToolBox()
+ val tpartials = tb.typeCheck(partials.tree)
+ println(tpartials)
+ val rtpartials = tb.resetAllAttrs(tpartials)
+ println(tb.eval(rtpartials))
+ } catch {
+ // this is the current behaviour, rather than the desired behavior; see SI-6187
+ case _: ToolBoxError => println("error!")
+ }
+} \ No newline at end of file
diff --git a/test/files/run/idempotency-this.check b/test/files/run/idempotency-this.check
new file mode 100644
index 0000000000..08738c4565
--- /dev/null
+++ b/test/files/run/idempotency-this.check
@@ -0,0 +1,4 @@
+List()
+immutable.this.List.apply[String]("")
+Apply(TypeApply(Select(Select(This(newTypeName("immutable")), scala.collection.immutable.List), newTermName("apply")), List(TypeTree().setOriginal(Ident(newTypeName("String"))))), List(Literal(Constant(""))))
+error!
diff --git a/test/files/run/idempotency-this.scala b/test/files/run/idempotency-this.scala
new file mode 100644
index 0000000000..5cd4226326
--- /dev/null
+++ b/test/files/run/idempotency-this.scala
@@ -0,0 +1,22 @@
+import scala.reflect.runtime.universe._
+import scala.reflect.runtime.{currentMirror => cm}
+import scala.tools.reflect.{ToolBox, ToolBoxError}
+import scala.tools.reflect.Eval
+
+object Test extends App {
+ val thiss = reify {
+ List[String]("")
+ }
+ println(thiss.eval)
+ val tb = cm.mkToolBox()
+ val tthiss = tb.typeCheck(thiss.tree)
+ println(tthiss)
+ println(showRaw(tthiss))
+ val rtthiss = tb.resetAllAttrs(tthiss)
+ try {
+ println(tb.eval(rtthiss))
+ } catch {
+ // this is the current behaviour, rather than the desired behavior; see SI-5705
+ case _: ToolBoxError => println("error!")
+ }
+} \ No newline at end of file
diff --git a/test/files/run/inline-ex-handlers.check b/test/files/run/inline-ex-handlers.check
index e786c780d6..45db7c3a15 100644
--- a/test/files/run/inline-ex-handlers.check
+++ b/test/files/run/inline-ex-handlers.check
@@ -47,7 +47,7 @@
< 106 LOAD_LOCAL(value message)
---
> ? LOAD_LOCAL(value x5)
-> ? CALL_METHOD MyException.message (dynamic)
+> 106 CALL_METHOD MyException.message (dynamic)
502c504
< blocks: [1,2,3,4,6,7,8,9,10]
---
@@ -162,12 +162,12 @@
< 176 LOAD_LOCAL(value message)
---
> ? LOAD_LOCAL(value x5)
-> ? CALL_METHOD MyException.message (dynamic)
+> 176 CALL_METHOD MyException.message (dynamic)
783c833,834
< 177 LOAD_LOCAL(value message)
---
> ? LOAD_LOCAL(value x5)
-> ? CALL_METHOD MyException.message (dynamic)
+> 177 CALL_METHOD MyException.message (dynamic)
785c836,837
< 177 THROW(MyException)
---
@@ -194,12 +194,12 @@
< 181 LOAD_LOCAL(value message)
---
> ? LOAD_LOCAL(value x5)
-> ? CALL_METHOD MyException.message (dynamic)
+> 181 CALL_METHOD MyException.message (dynamic)
822c878,879
< 182 LOAD_LOCAL(value message)
---
> ? LOAD_LOCAL(value x5)
-> ? CALL_METHOD MyException.message (dynamic)
+> 182 CALL_METHOD MyException.message (dynamic)
824c881,882
< 182 THROW(MyException)
---
@@ -260,7 +260,7 @@
< 127 LOAD_LOCAL(value message)
---
> ? LOAD_LOCAL(value x5)
-> ? CALL_METHOD MyException.message (dynamic)
+> 127 CALL_METHOD MyException.message (dynamic)
966c1042
< catch (IllegalArgumentException) in ArrayBuffer(6, 7, 8, 11, 14, 16, 17, 19) starting at: 3
---
@@ -299,7 +299,7 @@
< 154 LOAD_LOCAL(value message)
---
> ? LOAD_LOCAL(value x5)
-> ? CALL_METHOD MyException.message (dynamic)
+> 154 CALL_METHOD MyException.message (dynamic)
1275c1354
< blocks: [1,2,3,4,5,7]
---
@@ -354,22 +354,23 @@
< 213 LOAD_LOCAL(value message)
---
> ? LOAD_LOCAL(value x5)
-> ? CALL_METHOD MyException.message (dynamic)
+> 213 CALL_METHOD MyException.message (dynamic)
1470c1560
< blocks: [1,2,3,4,5,7]
---
> blocks: [1,2,3,4,5,7,8]
-1494c1584,1591
+1494c1584,1585
< 58 THROW(IllegalArgumentException)
---
> ? STORE_LOCAL(value e)
> ? JUMP 8
->
+1495a1587,1592
> 8:
> 62 LOAD_MODULE object Predef
> 62 CONSTANT("RuntimeException")
> 62 CALL_METHOD scala.Predef.println (dynamic)
> 62 JUMP 2
+>
1543c1640
< blocks: [1,2,3,4]
---
diff --git a/test/files/run/macro-abort-fresh/Test_2.scala b/test/files/run/macro-abort-fresh/Test_2.scala
index 15c498efb0..0b9986e9f6 100644
--- a/test/files/run/macro-abort-fresh/Test_2.scala
+++ b/test/files/run/macro-abort-fresh/Test_2.scala
@@ -2,7 +2,7 @@ object Test extends App {
import scala.reflect.runtime.universe._
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
- val tree = Select(Ident("Macros"), newTermName("foo"))
+ val tree = Select(Ident(newTermName("Macros")), newTermName("foo"))
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-declared-in-class-class/Impls_1.scala b/test/files/run/macro-declared-in-class-class/Impls_1.scala
index 1f8f3cbd5a..6f06f6d3f0 100644
--- a/test/files/run/macro-declared-in-class-class/Impls_1.scala
+++ b/test/files/run/macro-declared-in-class-class/Impls_1.scala
@@ -5,7 +5,7 @@ object Impls {
import c.{prefix => prefix}
import c.universe._
val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix))))
- val body = Block(printPrefix, Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))))
+ val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))))
c.Expr[Unit](body)
}
} \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-class-object/Impls_1.scala b/test/files/run/macro-declared-in-class-object/Impls_1.scala
index 1f8f3cbd5a..6f06f6d3f0 100644
--- a/test/files/run/macro-declared-in-class-object/Impls_1.scala
+++ b/test/files/run/macro-declared-in-class-object/Impls_1.scala
@@ -5,7 +5,7 @@ object Impls {
import c.{prefix => prefix}
import c.universe._
val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix))))
- val body = Block(printPrefix, Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))))
+ val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))))
c.Expr[Unit](body)
}
} \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-class/Impls_1.scala b/test/files/run/macro-declared-in-class/Impls_1.scala
index 1f8f3cbd5a..6f06f6d3f0 100644
--- a/test/files/run/macro-declared-in-class/Impls_1.scala
+++ b/test/files/run/macro-declared-in-class/Impls_1.scala
@@ -5,7 +5,7 @@ object Impls {
import c.{prefix => prefix}
import c.universe._
val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix))))
- val body = Block(printPrefix, Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))))
+ val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))))
c.Expr[Unit](body)
}
} \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-implicit-class/Impls_Macros_1.scala b/test/files/run/macro-declared-in-implicit-class/Impls_Macros_1.scala
index d506de4252..837b306976 100644
--- a/test/files/run/macro-declared-in-implicit-class/Impls_Macros_1.scala
+++ b/test/files/run/macro-declared-in-implicit-class/Impls_Macros_1.scala
@@ -5,7 +5,7 @@ object Impls {
import c.{prefix => prefix}
import c.universe._
val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix))))
- val body = Block(printPrefix, Apply(Ident(definitions.SomeModule), List(Select(Select(prefix.tree, newTermName("x")), newTermName("toInt")))))
+ val body = Block(List(printPrefix), Apply(Ident(definitions.SomeModule), List(Select(Select(prefix.tree, newTermName("x")), newTermName("toInt")))))
c.Expr[Option[Int]](body)
}
}
diff --git a/test/files/run/macro-declared-in-method/Impls_1.scala b/test/files/run/macro-declared-in-method/Impls_1.scala
index 1f8f3cbd5a..6f06f6d3f0 100644
--- a/test/files/run/macro-declared-in-method/Impls_1.scala
+++ b/test/files/run/macro-declared-in-method/Impls_1.scala
@@ -5,7 +5,7 @@ object Impls {
import c.{prefix => prefix}
import c.universe._
val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix))))
- val body = Block(printPrefix, Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))))
+ val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))))
c.Expr[Unit](body)
}
} \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-object-class/Impls_1.scala b/test/files/run/macro-declared-in-object-class/Impls_1.scala
index 1f8f3cbd5a..6f06f6d3f0 100644
--- a/test/files/run/macro-declared-in-object-class/Impls_1.scala
+++ b/test/files/run/macro-declared-in-object-class/Impls_1.scala
@@ -5,7 +5,7 @@ object Impls {
import c.{prefix => prefix}
import c.universe._
val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix))))
- val body = Block(printPrefix, Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))))
+ val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))))
c.Expr[Unit](body)
}
} \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-object-object/Impls_1.scala b/test/files/run/macro-declared-in-object-object/Impls_1.scala
index 1f8f3cbd5a..6f06f6d3f0 100644
--- a/test/files/run/macro-declared-in-object-object/Impls_1.scala
+++ b/test/files/run/macro-declared-in-object-object/Impls_1.scala
@@ -5,7 +5,7 @@ object Impls {
import c.{prefix => prefix}
import c.universe._
val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix))))
- val body = Block(printPrefix, Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))))
+ val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))))
c.Expr[Unit](body)
}
} \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-object/Impls_1.scala b/test/files/run/macro-declared-in-object/Impls_1.scala
index 1f8f3cbd5a..6f06f6d3f0 100644
--- a/test/files/run/macro-declared-in-object/Impls_1.scala
+++ b/test/files/run/macro-declared-in-object/Impls_1.scala
@@ -5,7 +5,7 @@ object Impls {
import c.{prefix => prefix}
import c.universe._
val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix))))
- val body = Block(printPrefix, Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))))
+ val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))))
c.Expr[Unit](body)
}
} \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-package-object/Impls_1.scala b/test/files/run/macro-declared-in-package-object/Impls_1.scala
index 1f8f3cbd5a..6f06f6d3f0 100644
--- a/test/files/run/macro-declared-in-package-object/Impls_1.scala
+++ b/test/files/run/macro-declared-in-package-object/Impls_1.scala
@@ -5,7 +5,7 @@ object Impls {
import c.{prefix => prefix}
import c.universe._
val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix))))
- val body = Block(printPrefix, Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))))
+ val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))))
c.Expr[Unit](body)
}
} \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-refinement/Impls_1.scala b/test/files/run/macro-declared-in-refinement/Impls_1.scala
index 1f8f3cbd5a..6f06f6d3f0 100644
--- a/test/files/run/macro-declared-in-refinement/Impls_1.scala
+++ b/test/files/run/macro-declared-in-refinement/Impls_1.scala
@@ -5,7 +5,7 @@ object Impls {
import c.{prefix => prefix}
import c.universe._
val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix))))
- val body = Block(printPrefix, Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))))
+ val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))))
c.Expr[Unit](body)
}
} \ No newline at end of file
diff --git a/test/files/run/macro-declared-in-trait/Impls_1.scala b/test/files/run/macro-declared-in-trait/Impls_1.scala
index 1f8f3cbd5a..6f06f6d3f0 100644
--- a/test/files/run/macro-declared-in-trait/Impls_1.scala
+++ b/test/files/run/macro-declared-in-trait/Impls_1.scala
@@ -5,7 +5,7 @@ object Impls {
import c.{prefix => prefix}
import c.universe._
val printPrefix = Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("prefix = " + prefix))))
- val body = Block(printPrefix, Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))))
+ val body = Block(List(printPrefix), Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("it works")))))
c.Expr[Unit](body)
}
} \ 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 ef2920a432..ea0fd4bbff 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
@@ -2,7 +2,7 @@ object Test extends App {
import scala.reflect.runtime.universe._
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
- val tree = Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant(42))))
+ val tree = Apply(Select(Ident(newTermName("Macros")), newTermName("foo")), List(Literal(Constant(42))))
try cm.mkToolBox().eval(tree)
catch { case ex: Throwable => println(ex.getMessage) }
}
diff --git a/test/files/run/macro-expand-implicit-argument/Macros_1.scala b/test/files/run/macro-expand-implicit-argument/Macros_1.scala
index b1665256cd..d9fd5b8cb0 100644
--- a/test/files/run/macro-expand-implicit-argument/Macros_1.scala
+++ b/test/files/run/macro-expand-implicit-argument/Macros_1.scala
@@ -43,16 +43,16 @@ object Macros {
val n = as.length
val arr = newTermName("arr")
- val create = Apply(Select(ct.tree, "newArray"), List(const(n)))
+ val create = Apply(Select(ct.tree, newTermName("newArray")), List(const(n)))
val arrtpe = TypeTree(implicitly[c.WeakTypeTag[Array[A]]].tpe)
val valdef = ValDef(Modifiers(), arr, arrtpe, create)
val updates = (0 until n).map {
- i => Apply(Select(Ident(arr), "update"), List(const(i), as(i).tree))
+ i => Apply(Select(Ident(arr), newTermName("update")), List(const(i), as(i).tree))
}
- val exprs = Seq(valdef) ++ updates ++ Seq(Ident(arr))
- val block = Block(exprs:_*)
+ val exprs = (Seq(valdef) ++ updates ++ Seq(Ident(arr))).toList
+ val block = Block(exprs.init, exprs.last)
c.Expr[Array[A]](block)
}
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 16d2c1e6ac..c832826d64 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
@@ -6,7 +6,7 @@ object Test extends App {
import scala.reflect.runtime.universe._
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))))
+ val tree = Apply(Select(Ident(newTermName("Macros")), newTermName("foo")), List(Typed(Apply(Ident(definitions.ListModule), List(Literal(Constant(1)), Literal(Constant(2)))), Ident(tpnme.WILDCARD_STAR))))
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-impl-default-params/Impls_Macros_1.scala b/test/files/run/macro-impl-default-params/Impls_Macros_1.scala
index db77b1923a..7c40045c0f 100644
--- a/test/files/run/macro-impl-default-params/Impls_Macros_1.scala
+++ b/test/files/run/macro-impl-default-params/Impls_Macros_1.scala
@@ -6,11 +6,11 @@ object Impls {
import c.{prefix => prefix}
import c.universe._
val U = implicitly[c.WeakTypeTag[U]]
- val body = Block(
+ val body = Block(List(
Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("invoking foo_targs...")))),
Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("type of prefix is: " + prefix.staticType)))),
Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("type of prefix tree is: " + prefix.tree.tpe)))),
- Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("U is: " + U.tpe)))),
+ Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("U is: " + U.tpe))))),
Literal(Constant(())))
c.Expr[Unit](body)
}
diff --git a/test/files/run/macro-impl-rename-context/Impls_Macros_1.scala b/test/files/run/macro-impl-rename-context/Impls_Macros_1.scala
index 537f1db8c6..56c23f5faf 100644
--- a/test/files/run/macro-impl-rename-context/Impls_Macros_1.scala
+++ b/test/files/run/macro-impl-rename-context/Impls_Macros_1.scala
@@ -3,8 +3,8 @@ import scala.reflect.macros.{Context => Ctx}
object Impls {
def foo(unconventionalName: Ctx)(x: unconventionalName.Expr[Int]) = {
import unconventionalName.universe._
- val body = Block(
- Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("invoking foo...")))),
+ val body = Block(List(
+ Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Literal(Constant("invoking foo..."))))),
Literal(Constant(())))
unconventionalName.Expr[Unit](body)
}
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 15c498efb0..0b9986e9f6 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
@@ -2,7 +2,7 @@ object Test extends App {
import scala.reflect.runtime.universe._
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
- val tree = Select(Ident("Macros"), newTermName("foo"))
+ val tree = Select(Ident(newTermName("Macros")), newTermName("foo"))
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/Impls_Macros_1.scala b/test/files/run/macro-invalidret-nontypeable/Impls_Macros_1.scala
index 405ae7024f..fb0d55208c 100644
--- a/test/files/run/macro-invalidret-nontypeable/Impls_Macros_1.scala
+++ b/test/files/run/macro-invalidret-nontypeable/Impls_Macros_1.scala
@@ -3,7 +3,7 @@ import scala.reflect.macros.{Context => Ctx}
object Impls {
def foo(c: Ctx) = {
import c.universe._
- val body = Ident("IDoNotExist")
+ val body = Ident(newTermName("IDoNotExist"))
c.Expr[Int](body)
}
}
diff --git a/test/files/run/macro-invalidret-nontypeable/Test_2.scala b/test/files/run/macro-invalidret-nontypeable/Test_2.scala
index 15c498efb0..0daee49a08 100644
--- a/test/files/run/macro-invalidret-nontypeable/Test_2.scala
+++ b/test/files/run/macro-invalidret-nontypeable/Test_2.scala
@@ -1,8 +1,8 @@
-object Test extends App {
+ object Test extends App {
import scala.reflect.runtime.universe._
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
- val tree = Select(Ident("Macros"), newTermName("foo"))
+ val tree = Select(Ident(newTermName("Macros")), newTermName("foo"))
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 f3a76f3fff..5cb0be5ddd 100644
--- a/test/files/run/macro-invalidusage-badret/Test_2.scala
+++ b/test/files/run/macro-invalidusage-badret/Test_2.scala
@@ -2,7 +2,7 @@ object Test extends App {
import scala.reflect.runtime.universe._
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")))
+ val tree = Typed(Apply(Select(Ident(newTermName("Macros")), newTermName("foo")), List(Literal(Constant(42)))), Ident(newTypeName("String")))
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 c91fd7d380..e453d0b70c 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
@@ -2,7 +2,7 @@ object Test extends App {
import scala.reflect.runtime.universe._
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
- val tree = Select(Ident("Macros"), newTermName("foo"))
+ val tree = Select(Ident(newTermName("Macros")), newTermName("foo"))
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 cbfee725e2..dc48c127f4 100644
--- a/test/files/run/macro-invalidusage-partialapplication/Test_2.scala
+++ b/test/files/run/macro-invalidusage-partialapplication/Test_2.scala
@@ -2,7 +2,7 @@ object Test extends App {
import scala.reflect.runtime.universe._
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
- val tree = Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant(40))))
+ val tree = Apply(Select(Ident(newTermName("Macros")), newTermName("foo")), List(Literal(Constant(40))))
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 373c6a6fca..2e64c01e35 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
@@ -2,6 +2,6 @@ object Test extends App {
import scala.reflect.runtime.universe._
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
- val tree = Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant(42))))
+ val tree = Apply(Select(Ident(newTermName("Macros")), newTermName("foo")), List(Literal(Constant(42))))
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 adecfcff17..70560009b1 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
@@ -11,10 +11,10 @@ object Test extends App {
val macrobody = Select(Ident(newTermName("Impls")), newTermName("foo"))
val macroparam = ValDef(NoMods, newTermName("x"), TypeTree(definitions.IntClass.toType), EmptyTree)
val macrodef = DefDef(Modifiers(MACRO), newTermName("foo"), Nil, List(List(macroparam)), TypeTree(), macrobody)
- val modulector = DefDef(NoMods, nme.CONSTRUCTOR, Nil, List(List()), TypeTree(), Block(Apply(Select(Super(This(tpnme.EMPTY), tpnme.EMPTY), nme.CONSTRUCTOR), List())))
+ val modulector = DefDef(NoMods, nme.CONSTRUCTOR, Nil, List(List()), TypeTree(), Block(List(Apply(Select(Super(This(tpnme.EMPTY), tpnme.EMPTY), nme.CONSTRUCTOR), List())), Literal(Constant(()))))
val module = ModuleDef(NoMods, newTermName("Macros"), Template(Nil, emptyValDef, List(modulector, macrodef)))
- val macroapp = Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant(42))))
- val tree = Block(macrodef, module, macroapp)
+ val macroapp = Apply(Select(Ident(newTermName("Macros")), newTermName("foo")), List(Literal(Constant(42))))
+ val tree = Block(List(macrodef, module), macroapp)
val toolbox = cm.mkToolBox(options = "-language:experimental.macros")
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 e24758cfb4..7af9d89bdb 100644
--- a/test/files/run/macro-reify-freevars/Test_2.scala
+++ b/test/files/run/macro-reify-freevars/Test_2.scala
@@ -2,8 +2,8 @@ object Test extends App {
import scala.reflect.runtime.universe._
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
- val q = New(AppliedTypeTree(Select(Select(Select(Ident("scala"), newTermName("collection")), newTermName("slick")), newTypeName("Queryable")), List(Ident("Int"))))
- val x = ValDef(NoMods, newTermName("x"), Ident("Int"), EmptyTree)
+ val q = New(AppliedTypeTree(Select(Select(Select(Ident(newTermName("scala")), newTermName("collection")), newTermName("slick")), newTypeName("Queryable")), List(Ident(newTermName("Int")))))
+ val x = ValDef(NoMods, newTermName("x"), Ident(newTermName("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().eval(tree)
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 8f96ea199d..54bd03fcd2 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
@@ -2,7 +2,7 @@ object Test extends App {
import scala.reflect.runtime.universe._
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
- val tree = Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant(42))))
+ val tree = Apply(Select(Ident(newTermName("Macros")), newTermName("foo")), List(Literal(Constant(42))))
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 1bb3945ece..584c4bdf5b 100644
--- a/test/files/run/macro-reify-tagless-a/Test_2.scala
+++ b/test/files/run/macro-reify-tagless-a/Test_2.scala
@@ -6,9 +6,9 @@ object Test extends App {
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
val tpt = AppliedTypeTree(Ident(definitions.ListClass), List(Ident(definitions.StringClass)))
- val rhs = Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant("hello world"))))
+ val rhs = Apply(Select(Ident(newTermName("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))))
+ val tree = Block(List(list), Apply(Select(Ident(definitions.PredefModule), newTermName("println")), List(Ident(list.name))))
try cm.mkToolBox().eval(tree)
catch { case ex: Throwable => println(ex.getMessage) }
}
diff --git a/test/files/run/reify_renamed_term_basic.check b/test/files/run/reify_renamed_term_basic.check
new file mode 100644
index 0000000000..e78f94fffd
--- /dev/null
+++ b/test/files/run/reify_renamed_term_basic.check
@@ -0,0 +1 @@
+((),(),())
diff --git a/test/files/run/reify_renamed_term_basic.scala b/test/files/run/reify_renamed_term_basic.scala
new file mode 100644
index 0000000000..cd76def395
--- /dev/null
+++ b/test/files/run/reify_renamed_term_basic.scala
@@ -0,0 +1,20 @@
+import scala.reflect.runtime.universe._
+import scala.tools.reflect.Eval
+
+object A {
+ object B {
+ val c = ()
+ }
+}
+
+object Test extends App {
+ import A.{B => X}
+ import A.B.{c => y}
+ import X.{c => z}
+
+ val expr = reify (
+ X.c, y, z
+ )
+
+ println(expr.eval)
+} \ No newline at end of file
diff --git a/test/files/run/reify_renamed_term_local_to_reifee.check b/test/files/run/reify_renamed_term_local_to_reifee.check
new file mode 100644
index 0000000000..e78f94fffd
--- /dev/null
+++ b/test/files/run/reify_renamed_term_local_to_reifee.check
@@ -0,0 +1 @@
+((),(),())
diff --git a/test/files/run/reify_renamed_term_local_to_reifee.scala b/test/files/run/reify_renamed_term_local_to_reifee.scala
new file mode 100644
index 0000000000..1860316a5b
--- /dev/null
+++ b/test/files/run/reify_renamed_term_local_to_reifee.scala
@@ -0,0 +1,20 @@
+import scala.reflect.runtime.universe._
+import scala.tools.reflect.Eval
+
+object A {
+ object B {
+ val c = ()
+ }
+}
+
+object Test extends App {
+ val expr = reify {
+ import A.{B => X}
+ import A.B.{c => y}
+ import X.{c => z}
+
+ (X.c, y, z)
+ }
+
+ println(expr.eval)
+} \ No newline at end of file
diff --git a/test/files/run/reify_renamed_term_overloaded_method.check b/test/files/run/reify_renamed_term_overloaded_method.check
new file mode 100644
index 0000000000..48082f72f0
--- /dev/null
+++ b/test/files/run/reify_renamed_term_overloaded_method.check
@@ -0,0 +1 @@
+12
diff --git a/test/files/run/reify_renamed_term_overloaded_method.scala b/test/files/run/reify_renamed_term_overloaded_method.scala
new file mode 100644
index 0000000000..3ef442d203
--- /dev/null
+++ b/test/files/run/reify_renamed_term_overloaded_method.scala
@@ -0,0 +1,17 @@
+import scala.reflect.runtime.universe._
+import scala.tools.reflect.Eval
+
+object O {
+ def show(i: Int) = i.toString
+ def show(s: String) = s
+}
+
+object Test extends App {
+ import O.{show => s}
+
+ val expr = reify {
+ s("1") + s(2)
+ }
+
+ println(expr.eval)
+} \ No newline at end of file
diff --git a/test/files/run/reify_renamed_term_si5841.check b/test/files/run/reify_renamed_term_si5841.check
new file mode 100644
index 0000000000..6031277b76
--- /dev/null
+++ b/test/files/run/reify_renamed_term_si5841.check
@@ -0,0 +1 @@
+class scala.reflect.runtime.JavaUniverse
diff --git a/test/files/run/reify_renamed_term_si5841.scala b/test/files/run/reify_renamed_term_si5841.scala
new file mode 100644
index 0000000000..ef18d650bf
--- /dev/null
+++ b/test/files/run/reify_renamed_term_si5841.scala
@@ -0,0 +1,7 @@
+import scala.reflect.runtime.universe._
+import scala.reflect.runtime.{universe => ru}
+import scala.tools.reflect.Eval
+
+object Test extends App {
+ println(reify{ru}.eval.getClass)
+} \ No newline at end of file
diff --git a/test/files/run/reify_renamed_type_basic.check b/test/files/run/reify_renamed_type_basic.check
new file mode 100644
index 0000000000..6a452c185a
--- /dev/null
+++ b/test/files/run/reify_renamed_type_basic.check
@@ -0,0 +1 @@
+()
diff --git a/test/files/run/reify_renamed_type_basic.scala b/test/files/run/reify_renamed_type_basic.scala
new file mode 100644
index 0000000000..23729e5c54
--- /dev/null
+++ b/test/files/run/reify_renamed_type_basic.scala
@@ -0,0 +1,16 @@
+import scala.reflect.runtime.universe._
+import scala.tools.reflect.Eval
+
+object O {
+ type A = Unit
+}
+
+object Test extends App {
+ import O.{A => X}
+
+ def expr = reify {
+ val a: X = ()
+ }
+
+ println(expr.eval)
+} \ No newline at end of file
diff --git a/test/files/run/reify_renamed_type_local_to_reifee.check b/test/files/run/reify_renamed_type_local_to_reifee.check
new file mode 100644
index 0000000000..6a452c185a
--- /dev/null
+++ b/test/files/run/reify_renamed_type_local_to_reifee.check
@@ -0,0 +1 @@
+()
diff --git a/test/files/run/reify_renamed_type_local_to_reifee.scala b/test/files/run/reify_renamed_type_local_to_reifee.scala
new file mode 100644
index 0000000000..ed1bad239e
--- /dev/null
+++ b/test/files/run/reify_renamed_type_local_to_reifee.scala
@@ -0,0 +1,24 @@
+import scala.reflect.runtime.universe._
+import scala.tools.reflect.Eval
+
+object O {
+ type A = Unit
+}
+
+object Test extends App {
+ val expr = reify {
+ import O.{A => X}
+
+ val a: X = ()
+
+ object P {
+ type B = Unit
+ }
+
+ import P.{B => Y}
+
+ val b: Y = ()
+ }
+
+ println(expr.eval)
+} \ No newline at end of file
diff --git a/test/files/run/reify_renamed_type_spliceable.check b/test/files/run/reify_renamed_type_spliceable.check
new file mode 100644
index 0000000000..6a452c185a
--- /dev/null
+++ b/test/files/run/reify_renamed_type_spliceable.check
@@ -0,0 +1 @@
+()
diff --git a/test/files/run/reify_renamed_type_spliceable.scala b/test/files/run/reify_renamed_type_spliceable.scala
new file mode 100644
index 0000000000..9c2cff5199
--- /dev/null
+++ b/test/files/run/reify_renamed_type_spliceable.scala
@@ -0,0 +1,21 @@
+import scala.reflect.runtime.universe._
+import scala.tools.reflect.Eval
+
+abstract class C {
+ type T >: Null
+}
+
+object Test extends App {
+ def foo(c: C) = {
+ import c.{T => U}
+ reify {
+ val x: U = null
+ }
+ }
+
+ val expr = foo(new C {
+ type T = AnyRef
+ })
+
+ println(expr.eval)
+} \ No newline at end of file
diff --git a/test/files/run/t1672.scala b/test/files/run/t1672.scala
new file mode 100644
index 0000000000..ee025b9031
--- /dev/null
+++ b/test/files/run/t1672.scala
@@ -0,0 +1,28 @@
+object Test {
+ @annotation.tailrec
+ def bar(i : Int) : Int = {
+ if (i == 0) 0
+ else try {
+ throw new RuntimeException
+ } catch {
+ case _: Throwable => bar(i - 1)
+ }
+ }
+
+ @annotation.tailrec
+ def nestedTry1(i : Int) : Int = {
+ if (i == 0) 0
+ else try {
+ throw new RuntimeException
+ } catch {
+ case _: Throwable =>
+ try { ??? } catch { case _: Throwable => nestedTry1(i - 1) }
+ }
+ }
+
+ def main(args: Array[String]) {
+ assert(bar(2) == 0)
+
+ assert(nestedTry1(2) == 0)
+ }
+}
diff --git a/test/files/run/t5064.check b/test/files/run/t5064.check
index 077006abd9..61ccfd16e7 100644
--- a/test/files/run/t5064.check
+++ b/test/files/run/t5064.check
@@ -1,6 +1,6 @@
-[12] T5064.super.<init>()
-[12] T5064.super.<init>
-[12] this
+[53] T5064.super.<init>()
+[53] T5064.super.<init>
+[53] this
[16:23] immutable.this.List.apply(scala.this.Predef.wrapIntArray(Array[Int]{1}))
[16:20] immutable.this.List.apply
<16:20> immutable.this.List
diff --git a/test/files/run/t5603.check b/test/files/run/t5603.check
index 5127d3c1c7..3b2eb55313 100644
--- a/test/files/run/t5603.check
+++ b/test/files/run/t5603.check
@@ -12,7 +12,7 @@
[95:101]<paramaccessor> private[this] val i: [98:101]Int = _;
<119:139>def <init>([95]i: [98]Int) = <119:139>{
<119:139>val nameElse = <134:139>"Bob";
- [94][94][94]super.<init>();
+ [NoPosition][NoPosition][NoPosition]super.<init>();
[94]()
};
[168:184]val name = [179:184]"avc";
@@ -20,7 +20,7 @@
};
[215:241]object Test extends [227:241][235:238]App {
[227]def <init>() = [227]{
- [227][227][227]super.<init>();
+ [NoPosition][NoPosition][NoPosition]super.<init>();
[227]()
};
[NoPosition]<empty>
diff --git a/test/files/run/t5733.check b/test/files/run/t5733.check
new file mode 100644
index 0000000000..e697046a94
--- /dev/null
+++ b/test/files/run/t5733.check
@@ -0,0 +1,2 @@
+Running ABTest asserts
+Done
diff --git a/test/files/run/t5733.scala b/test/files/run/t5733.scala
new file mode 100644
index 0000000000..360264e4ed
--- /dev/null
+++ b/test/files/run/t5733.scala
@@ -0,0 +1,53 @@
+import scala.language.dynamics
+
+object A extends Dynamic {
+ var a = "a"
+
+ def selectDynamic(method:String): String = a
+
+ def updateDynamic(method:String)(v:String) { a = v }
+}
+
+class B extends Dynamic {
+ var b = "b"
+
+ def selectDynamic(method:String): String = b
+
+ def updateDynamic(method:String)(v:String) { b = v }
+}
+
+object Test extends App {
+ assert( A.foo == "a" )
+ assert( A.bar == "a" )
+ A.aaa = "aaa"
+ assert( A.bar == "aaa" )
+
+ val b = new B
+ assert( b.foo == "b" )
+ assert( b.bar == "b" )
+ b.bbb = "bbb"
+ assert( b.bar == "bbb" )
+
+ {
+ println("Running ABTest asserts")
+ A.a = "a"
+ (new ABTest).test()
+ }
+
+ println("Done")
+}
+
+class ABTest {
+ def test() {
+ assert( A.foo == "a" )
+ assert( A.bar == "a" )
+ A.aaa = "aaa"
+ assert( A.bar == "aaa" )
+
+ val b = new B
+ assert( b.foo == "b" )
+ assert( b.bar == "b" )
+ b.bbb = "bbb"
+ assert( b.bar == "bbb" )
+ }
+}
diff --git a/test/files/run/t5789.check b/test/files/run/t5789.check
new file mode 100644
index 0000000000..ea8d4966b1
--- /dev/null
+++ b/test/files/run/t5789.check
@@ -0,0 +1,14 @@
+Type in expressions to have them evaluated.
+Type :help for more information.
+
+scala>
+
+scala> val n = 2
+n: Int = 2
+
+scala> () => n
+res0: () => Int = <function0>
+
+scala>
+
+scala>
diff --git a/test/files/run/t5789.scala b/test/files/run/t5789.scala
new file mode 100644
index 0000000000..461f6a4aae
--- /dev/null
+++ b/test/files/run/t5789.scala
@@ -0,0 +1,14 @@
+
+import scala.tools.nsc._
+import interpreter.ILoop
+import scala.tools.partest.ReplTest
+
+
+object Test extends ReplTest {
+ override def extraSettings = "-Yinline"
+ def code = """
+ val n = 2
+ () => n
+ """
+}
+
diff --git a/test/files/run/t5894.scala b/test/files/run/t5894.scala
new file mode 100644
index 0000000000..abeec32365
--- /dev/null
+++ b/test/files/run/t5894.scala
@@ -0,0 +1,17 @@
+import language.experimental.macros
+
+class Test
+
+object Test {
+ def foo = macro fooImpl
+ def fooImpl(c: reflect.macros.Context) = c.literalUnit
+
+ def main(args: Array[String]) {
+ try {
+ val method = classOf[Test].getMethod("foo")
+ sys.error("Static forwarder generated for macro: " + method)
+ } catch {
+ case _: NoSuchMethodException => // okay
+ }
+ }
+}
diff --git a/test/files/run/t6288.check b/test/files/run/t6288.check
new file mode 100644
index 0000000000..af6bd5d269
--- /dev/null
+++ b/test/files/run/t6288.check
@@ -0,0 +1,85 @@
+[[syntax trees at end of patmat]] // newSource1
+[7]package [7]<empty> {
+ [7]object Case3 extends [13][106]scala.AnyRef {
+ [106]def <init>(): [13]Case3.type = [106]{
+ [106][106][106]Case3.super.<init>();
+ [13]()
+ };
+ [21]def unapply([29]z: [32]<type: [32]scala.Any>): [21]Option[Int] = [56][52][52]scala.Some.apply[[52]Int]([58]-1);
+ [64]{
+ [64]case <synthetic> val x1: [64]Any = [64]"";
+ [64]case5()[84]{
+ [84]<synthetic> val o7: [84]Option[Int] = [84][84]Case3.unapply([84]x1);
+ [84]if ([84]o7.isEmpty.unary_!)
+ [84]{
+ [90]val nr: [90]Int = [90]o7.get;
+ [97][97]matchEnd4([97]())
+ }
+ else
+ [84][84]case6()
+ };
+ [64]case6(){
+ [64][64]matchEnd4([64]throw [64][64][64]new [64]MatchError([64]x1))
+ };
+ [64]matchEnd4(x: [NoPosition]Unit){
+ [64]x
+ }
+ }
+ };
+ [113]object Case4 extends [119][217]scala.AnyRef {
+ [217]def <init>(): [119]Case4.type = [217]{
+ [217][217][217]Case4.super.<init>();
+ [119]()
+ };
+ [127]def unapplySeq([138]z: [141]<type: [141]scala.Any>): [127]Option[List[Int]] = [167]scala.None;
+ [175]{
+ [175]case <synthetic> val x1: [175]Any = [175]"";
+ [175]case5()[195]{
+ [195]<synthetic> val o7: [195]Option[List[Int]] = [195][195]Case4.unapplySeq([195]x1);
+ [195]if ([195]o7.isEmpty.unary_!)
+ [195]if ([195][195][195][195]o7.get.!=([195]null).&&([195][195][195][195]o7.get.lengthCompare([195]1).==([195]0)))
+ [195]{
+ [201]val nr: [201]Int = [201][201]o7.get.apply([201]0);
+ [208][208]matchEnd4([208]())
+ }
+ else
+ [195][195]case6()
+ else
+ [195][195]case6()
+ };
+ [175]case6(){
+ [175][175]matchEnd4([175]throw [175][175][175]new [175]MatchError([175]x1))
+ };
+ [175]matchEnd4(x: [NoPosition]Unit){
+ [175]x
+ }
+ }
+ };
+ [224]object Case5 extends [230][312]scala.AnyRef {
+ [312]def <init>(): [230]Case5.type = [312]{
+ [312][312][312]Case5.super.<init>();
+ [230]()
+ };
+ [238]def unapply([246]z: [249]<type: [249]scala.Any>): [238]Boolean = [265]true;
+ [273]{
+ [273]case <synthetic> val x1: [273]Any = [273]"";
+ [273]case5()[293]{
+ [293]<synthetic> val o7: [293]Option[List[Int]] = [293][293]Case4.unapplySeq([293]x1);
+ [293]if ([293]o7.isEmpty.unary_!)
+ [293]if ([293][293][293][293]o7.get.!=([293]null).&&([293][293][293][293]o7.get.lengthCompare([293]0).==([195]0)))
+ [304][304]matchEnd4([304]())
+ else
+ [293][293]case6()
+ else
+ [293][293]case6()
+ };
+ [273]case6(){
+ [273][273]matchEnd4([273]throw [273][273][273]new [273]MatchError([273]x1))
+ };
+ [273]matchEnd4(x: [NoPosition]Unit){
+ [273]x
+ }
+ }
+ }
+}
+
diff --git a/test/files/run/t6288.scala b/test/files/run/t6288.scala
new file mode 100644
index 0000000000..cf5865e95a
--- /dev/null
+++ b/test/files/run/t6288.scala
@@ -0,0 +1,41 @@
+import scala.tools.partest._
+import java.io.{Console => _, _}
+
+object Test extends DirectTest {
+
+ override def extraSettings: String = "-usejavacp -Xprint:patmat -Xprint-pos -d " + testOutput.path
+
+ override def code =
+ """
+ |object Case3 {
+ | def unapply(z: Any): Option[Int] = Some(-1)
+ |
+ | "" match {
+ | case Case3(nr) => ()
+ | }
+ |}
+ |object Case4 {
+ | def unapplySeq(z: Any): Option[List[Int]] = None
+ |
+ | "" match {
+ | case Case4(nr) => ()
+ | }
+ |}
+ |object Case5 {
+ | def unapply(z: Any): Boolean = true
+ |
+ | "" match {
+ | case Case4() => ()
+ | }
+ |}
+ |
+ |""".stripMargin.trim
+
+ override def show(): Unit = {
+ // Now: [84][84]Case3.unapply([84]x1);
+ // Was: [84][84]Case3.unapply([64]x1);
+ Console.withErr(System.out) {
+ compile()
+ }
+ }
+}
diff --git a/test/files/run/t6288b-jump-position.check b/test/files/run/t6288b-jump-position.check
new file mode 100644
index 0000000000..45ec31c308
--- /dev/null
+++ b/test/files/run/t6288b-jump-position.check
@@ -0,0 +1,80 @@
+object Case3 extends Object {
+ // fields:
+
+ // methods
+ def unapply(z: Object (REF(class Object))): Option {
+ locals: value z
+ startBlock: 1
+ blocks: [1]
+
+ 1:
+ 2 NEW REF(class Some)
+ 2 DUP(REF(class Some))
+ 2 CONSTANT(-1)
+ 2 BOX INT
+ 2 CALL_METHOD scala.Some.<init> (static-instance)
+ 2 RETURN(REF(class Option))
+
+ }
+ Exception handlers:
+
+ def main(args: Array[String] (ARRAY[REF(class String)])): Unit {
+ locals: value args, value x1, value x2, value x
+ startBlock: 1
+ blocks: [1,2,3,6,7]
+
+ 1:
+ 4 CONSTANT("")
+ 4 STORE_LOCAL(value x1)
+ 4 SCOPE_ENTER value x1
+ 4 JUMP 2
+
+ 2:
+ 5 LOAD_LOCAL(value x1)
+ 5 IS_INSTANCE REF(class String)
+ 5 CZJUMP (BOOL)NE ? 3 : 6
+
+ 3:
+ 5 LOAD_LOCAL(value x1)
+ 5 CHECK_CAST REF(class String)
+ 5 STORE_LOCAL(value x2)
+ 5 SCOPE_ENTER value x2
+ 6 LOAD_MODULE object Predef
+ 6 CONSTANT("case 0")
+ 6 CALL_METHOD scala.Predef.println (dynamic)
+ 6 LOAD_FIELD scala.runtime.BoxedUnit.UNIT
+ 6 STORE_LOCAL(value x)
+ 6 JUMP 7
+
+ 6:
+ 8 LOAD_MODULE object Predef
+ 8 CONSTANT("default")
+ 8 CALL_METHOD scala.Predef.println (dynamic)
+ 8 LOAD_FIELD scala.runtime.BoxedUnit.UNIT
+ 8 STORE_LOCAL(value x)
+ 8 JUMP 7
+
+ 7:
+ 10 LOAD_MODULE object Predef
+ 10 CONSTANT("done")
+ 10 CALL_METHOD scala.Predef.println (dynamic)
+ 10 RETURN(UNIT)
+
+ }
+ Exception handlers:
+
+ def <init>(): Case3.type {
+ locals:
+ startBlock: 1
+ blocks: [1]
+
+ 1:
+ 12 THIS(Case3)
+ 12 CALL_METHOD java.lang.Object.<init> (super())
+ 12 RETURN(UNIT)
+
+ }
+ Exception handlers:
+
+
+}
diff --git a/test/files/run/t6288b-jump-position.scala b/test/files/run/t6288b-jump-position.scala
new file mode 100644
index 0000000000..e22a1ab120
--- /dev/null
+++ b/test/files/run/t6288b-jump-position.scala
@@ -0,0 +1,22 @@
+import scala.tools.partest.IcodeTest
+
+object Test extends IcodeTest {
+ override def code =
+ """object Case3 { // 01
+ | def unapply(z: Any): Option[Int] = Some(-1) // 02
+ | def main(args: Array[String]) { // 03
+ | ("": Any) match { // 04
+ | case x : String => // 05 Read: <linenumber> JUMP <target basic block id>
+ | println("case 0") // 06 expecting "6 JUMP 7", was "8 JUMP 7"
+ | case _ => // 07
+ | println("default") // 08 expecting "8 JUMP 7"
+ | } // 09
+ | println("done") // 10
+ | }
+ |}""".stripMargin
+
+ override def show() {
+ val lines1 = collectIcode("")
+ println(lines1 mkString "\n")
+ }
+}
diff --git a/test/files/run/t6320.check b/test/files/run/t6320.check
new file mode 100644
index 0000000000..e56bacd223
--- /dev/null
+++ b/test/files/run/t6320.check
@@ -0,0 +1,17 @@
+Type in expressions to have them evaluated.
+Type :help for more information.
+
+scala>
+
+scala> import scala.language.dynamics
+import scala.language.dynamics
+
+scala> class Dyn(m: Map[String, Any]) extends Dynamic { def selectDynamic[T](s: String): T = m(s).asInstanceOf[T] }
+defined class Dyn
+
+scala> new Dyn(Map("foo" -> 10)).foo[Int]
+res0: Int = 10
+
+scala>
+
+scala>
diff --git a/test/files/run/t6320.scala b/test/files/run/t6320.scala
new file mode 100644
index 0000000000..26085a3d7d
--- /dev/null
+++ b/test/files/run/t6320.scala
@@ -0,0 +1,9 @@
+import scala.tools.partest.ReplTest
+
+object Test extends ReplTest {
+ def code = """
+import scala.language.dynamics
+class Dyn(m: Map[String, Any]) extends Dynamic { def selectDynamic[T](s: String): T = m(s).asInstanceOf[T] }
+new Dyn(Map("foo" -> 10)).foo[Int]
+ """
+}
diff --git a/test/files/run/t6548.check b/test/files/run/t6548.check
new file mode 100644
index 0000000000..e82cae110a
--- /dev/null
+++ b/test/files/run/t6548.check
@@ -0,0 +1,2 @@
+false
+List(JavaAnnotationWithNestedEnum(value = VALUE))
diff --git a/test/files/run/t6548.scala b/test/files/run/t6548.scala
new file mode 100644
index 0000000000..be3eb5b932
--- /dev/null
+++ b/test/files/run/t6548.scala
@@ -0,0 +1,12 @@
+import scala.reflect.runtime.universe._
+import scala.reflect.runtime.{currentMirror => cm}
+
+class Bean {
+ @JavaAnnotationWithNestedEnum(JavaAnnotationWithNestedEnum.Value.VALUE)
+ def value = 1
+}
+
+object Test extends App {
+ println(cm.staticClass("Bean").isCaseClass)
+ println(typeOf[Bean].declaration(newTermName("value")).annotations)
+}
diff --git a/test/files/run/t6549.check b/test/files/run/t6549.check
new file mode 100644
index 0000000000..bc78aac741
--- /dev/null
+++ b/test/files/run/t6549.check
@@ -0,0 +1,32 @@
+Type in expressions to have them evaluated.
+Type :help for more information.
+
+scala>
+
+scala> case class `X"`(var xxx: Any)
+defined class X$u0022
+
+scala> val m = Map(("": Any) -> `X"`("\""), ('s: Any) -> `X"`("\""))
+m: scala.collection.immutable.Map[Any,X"] = Map("" -> X"("), 's -> X"("))
+
+scala> m("")
+res0: X" = X"(")
+
+scala> m("").xxx
+res1: Any = "
+
+scala> m("").xxx = 0
+m("").xxx: Any = 0
+
+scala> m("").xxx = "\""
+m("").xxx: Any = "
+
+scala> m('s).xxx = 's
+m(scala.Symbol("s")).xxx: Any = 's
+
+scala> val `"` = 0
+": Int = 0
+
+scala>
+
+scala>
diff --git a/test/files/run/t6549.scala b/test/files/run/t6549.scala
new file mode 100644
index 0000000000..7335661dc7
--- /dev/null
+++ b/test/files/run/t6549.scala
@@ -0,0 +1,22 @@
+import scala.tools.partest.ReplTest
+
+// Check that the fragments of code generated in
+// in the REPL correctly escape values added to
+// literal strings.
+//
+// Before, we saw:
+// scala> m("").x = 77
+// <console>:10: error: ')' expected but string literal found.
+// + "m("").x: Int = " + `$ires8` + "\n"
+object Test extends ReplTest {
+ def code = """
+ |case class `X"`(var xxx: Any)
+ |val m = Map(("": Any) -> `X"`("\""), ('s: Any) -> `X"`("\""))
+ |m("")
+ |m("").xxx
+ |m("").xxx = 0
+ |m("").xxx = "\""
+ |m('s).xxx = 's
+ |val `"` = 0
+ """.stripMargin
+}
diff --git a/test/files/run/t6555.check b/test/files/run/t6555.check
new file mode 100644
index 0000000000..04117b7c2f
--- /dev/null
+++ b/test/files/run/t6555.check
@@ -0,0 +1,22 @@
+[[syntax trees at end of specialize]] // newSource1
+package <empty> {
+ class Foo extends Object {
+ def <init>(): Foo = {
+ Foo.super.<init>();
+ ()
+ };
+ private[this] val f: Int => Int = {
+ @SerialVersionUID(0) final <synthetic> class $anonfun extends scala.runtime.AbstractFunction1$mcII$sp with Serializable {
+ def <init>(): anonymous class $anonfun = {
+ $anonfun.super.<init>();
+ ()
+ };
+ final def apply(param: Int): Int = $anonfun.this.apply$mcII$sp(param);
+ <specialized> def apply$mcII$sp(param: Int): Int = param
+ };
+ (new anonymous class $anonfun(): Int => Int)
+ };
+ <stable> <accessor> def f(): Int => Int = Foo.this.f
+ }
+}
+
diff --git a/test/files/run/t6555.scala b/test/files/run/t6555.scala
new file mode 100644
index 0000000000..b1a6137786
--- /dev/null
+++ b/test/files/run/t6555.scala
@@ -0,0 +1,15 @@
+import scala.tools.partest._
+import java.io.{Console => _, _}
+
+object Test extends DirectTest {
+
+ override def extraSettings: String = "-usejavacp -Xprint:specialize -d " + testOutput.path
+
+ override def code = "class Foo { val f = (param: Int) => param } "
+
+ override def show(): Unit = {
+ Console.withErr(System.out) {
+ compile()
+ }
+ }
+}
diff --git a/test/files/run/t6614.check b/test/files/run/t6614.check
new file mode 100644
index 0000000000..2e80ebda8b
--- /dev/null
+++ b/test/files/run/t6614.check
@@ -0,0 +1,11 @@
+(ArrayStack(),true)
+(ArrayStack(0),true)
+(ArrayStack(0, 1),true)
+(ArrayStack(0, 1, 2),true)
+(ArrayStack(0, 1, 2, 3),true)
+(ArrayStack(0, 1, 2, 3, 4),true)
+(ArrayStack(0, 1, 2, 3, 4, 5),true)
+(ArrayStack(0, 1, 2, 3, 4, 5, 6),true)
+(ArrayStack(0, 1, 2, 3, 4, 5, 6, 7),true)
+(ArrayStack(0, 1, 2, 3, 4, 5, 6, 7, 8),true)
+(ArrayStack(0, 1, 2, 3, 4, 5, 6, 7, 8, 9),true)
diff --git a/test/files/run/t6614.scala b/test/files/run/t6614.scala
new file mode 100644
index 0000000000..3ad9f36fc4
--- /dev/null
+++ b/test/files/run/t6614.scala
@@ -0,0 +1,8 @@
+object Test extends App {
+ import scala.collection.mutable.ArrayStack
+
+ println((for (i <- 0 to 10) yield {
+ val in = ArrayStack.tabulate(i)(_.toString)
+ (in, (in filter (_ => true)) == in)
+ }).mkString("\n"))
+}
diff --git a/test/files/run/t6631.scala b/test/files/run/t6631.scala
new file mode 100644
index 0000000000..e472b83d50
--- /dev/null
+++ b/test/files/run/t6631.scala
@@ -0,0 +1,18 @@
+import reflect.ClassTag
+
+object Test extends App {
+ def intercept[T <: Throwable : ClassTag](act: => Any) = try {
+ act
+ } catch {
+ case x: Throwable =>
+ val cls = implicitly[ClassTag[T]].runtimeClass
+ assert(cls.isInstance(x), (x.getClass, x, cls).toString)
+ }
+ assert(s"""\f\r\n\t""" == "\f\r\n\t")
+
+ import StringContext.InvalidEscapeException
+ intercept[InvalidEscapeException](s"""\""")
+ intercept[InvalidEscapeException](s"""\x""")
+ intercept[InvalidEscapeException](s"\")
+
+}
diff --git a/test/files/run/t6690.scala b/test/files/run/t6690.scala
new file mode 100644
index 0000000000..43ede967a0
--- /dev/null
+++ b/test/files/run/t6690.scala
@@ -0,0 +1,62 @@
+import scala.collection.mutable
+
+object Test extends App {
+ def last0(ml: mutable.MutableList[Int]) =
+ ml.asInstanceOf[{def last0: mutable.LinkedList[Int]}].last0
+
+ def first0(ml: mutable.MutableList[Int]) =
+ ml.asInstanceOf[{def first0: mutable.LinkedList[Int]}].first0
+
+ val f = mutable.Queue[Int]()
+ def check(desc: String) {
+ assert(f.length == 0, s"$desc: non empty: $f")
+ assert(last0(f).isEmpty, s"$desc: last0 leak: ${last0(f)}")
+ assert(first0(f).isEmpty, s"$desc: first0 leak: ${last0(f)}")
+ }
+
+ f.enqueue(1)
+ f.dequeue()
+ check("dequeue 1")
+
+ f.enqueue(1)
+ f.enqueue(2)
+ f.dequeue()
+ assert(last0(f).toList == List(2), last0(f))
+ f.dequeue()
+ check("dequeue 2")
+
+ f.enqueue(1)
+ f.dequeueAll(_ => false)
+ f.dequeueAll(_ => true)
+ check("dequeueAll")
+
+ f.enqueue(1)
+ f.dequeueFirst(_ => true)
+ check("dequeueFirst")
+
+ {
+ f.enqueue(1)
+ val tail = f.tail
+ assert(last0(tail).isEmpty, last0(tail))
+ assert(first0(tail).isEmpty, first0(tail))
+ }
+
+ {
+ val ml = mutable.MutableList[Int]()
+ 1 +=: ml
+ val tail = ml.tail
+ assert(last0(tail).isEmpty, last0(tail))
+ assert(first0(tail).isEmpty, first0(tail))
+ }
+
+ {
+ val ml = mutable.MutableList[Int]()
+ 1 +=: ml
+ ml += 2
+ val tail = ml.tail
+ assert(last0(tail).toList == List(2), last0(tail))
+ assert(first0(tail) == last0(tail).toList, first0(tail))
+ assert(last0(tail.tail).toList == Nil, last0(tail.tail).toList)
+ assert(first0(tail.tail) == Nil, first0(tail.tail))
+ }
+}
diff --git a/test/files/run/t6731.check b/test/files/run/t6731.check
new file mode 100644
index 0000000000..a5d59bd378
--- /dev/null
+++ b/test/files/run/t6731.check
@@ -0,0 +1,40 @@
+Mono$.bar()
+Mono$.bar
+Mono$.bar()
+Mono$.bar
+Mono$.bar
+Mono$.baz
+Mono$.bar(bippy=1, boppy=2)
+Mono$.baz
+Poly.bar[Nothing]
+Poly.bar[Int]
+Poly.bar[Nothing]()
+Poly.bar[Int]()
+Poly.bar[Int](1, 2, 3)
+Poly.bar[Nothing]
+Poly.bar[Int]
+Poly.bar[Nothing]()
+Poly.bar[Int]()
+Poly.bar[Int](1, 2, 3)
+Updating.bar
+Updating.bar = b
+Nest1$Nest2$Nest3$.bippy(1, 2, 3)
+Nest1$Nest2$Nest3$.bippy
+Named.bippy(a=1, b=2)
+Named.boppy(c=3, d=4)
+Named.apply()
+Named.apply()
+Named.apply(e=5, f=6)
+Named2.bippy(1)(q0, c)
+Named2.bippy(1)(q0, c)
+Named2.bippy(1)(b, q0)
+Named2.bippy(1)(q0, c)
+Named2.bippy(1)(c, b)
+Named2.bippy(1)(b, c)
+Named2.bippy(1)(q0, c)
+Named2.bippy(2)(b, c)
+Named2.bippy(1)(q0, c)
+Named2.bippy(5)(b, c)
+Named2.dingus(100)(b, dong)
+Named2.bippy(1)(q0, q1)
+Named2.hello(100)(!!, !!)
diff --git a/test/files/run/t6731.scala b/test/files/run/t6731.scala
new file mode 100644
index 0000000000..89d212e91e
--- /dev/null
+++ b/test/files/run/t6731.scala
@@ -0,0 +1,143 @@
+import scala.language.dynamics
+import scala.reflect.{ ClassTag, classTag }
+
+object Util {
+ def show[T](x: T): T = { println(x) ; x }
+ def mkArgs(xs: Any*) = xs map { case ((k, v)) => k + "=" + v ; case x => "" + x } mkString ("(", ", ", ")")
+}
+import Util._
+
+abstract class MonoDynamic extends Dynamic {
+ def selectDynamic(name: String): String = show(this + "." + name)
+ def applyDynamic(name: String)(args: Any*): String = show(this + "." + name + mkArgs(args: _*))
+ def applyDynamicNamed(name: String)(args: (String, Any)*): String = show(this + "." + name + mkArgs(args: _*))
+
+ override def toString = this.getClass.getName split '.' last
+}
+
+object Mono extends MonoDynamic {
+ def f(s: String): String = s
+
+ def f1 = this.bar()
+ def f2 = this.bar
+ def f3 = f(this.bar())
+ def f4 = f(this.bar)
+ def f5 = f(f(f(f(f(f(this.bar)))))) + f(f(f(f(f(f(this.baz))))))
+ def f6 = f(f(f(f(f(f(this.bar(bippy = 1, boppy = 2))))))) + f(f(f(f(f(f(this.baz))))))
+}
+
+object Poly extends Dynamic {
+ def selectDynamic[T: ClassTag](name: String): String = show(s"$this.$name[${classTag[T]}]")
+ def applyDynamic[T: ClassTag](name: String)(args: Any*): String = show(args.mkString(s"$this.$name[${classTag[T]}](", ", ", ")"))
+
+ def f(s: String): String = s
+
+ def f1 = this.bar
+ def f2 = this.bar[Int]
+ def f3 = this.bar()
+ def f4 = this.bar[Int]()
+ def f5 = this.bar[Int](1, 2, 3)
+
+ def f6 = f(f(this.bar))
+ def f7 = f(f(this.bar[Int]))
+ def f8 = f(f(this.bar()))
+ def f9 = f(f(this.bar[Int]()))
+ def f10 = f(f(this.bar[Int](1, 2, 3)))
+
+ override def toString = "Poly"
+}
+
+object Updating extends Dynamic {
+ def selectDynamic(name: String): String = show(s"$this.$name")
+ def updateDynamic(name: String)(value: Any): String = show(s"$this.$name = $value")
+
+ def f1 = this.bar
+ def f2 = this.bar = "b"
+
+ override def toString = "Updating"
+}
+
+object Nest1 extends Dynamic {
+ def applyDynamic(name: String)(args: Any*): Nest2.type = Nest2
+
+ object Nest2 extends Dynamic {
+ def applyDynamicNamed(name: String)(args: (String, Any)*): Nest3.type = Nest3
+
+ object Nest3 extends MonoDynamic {
+
+ }
+ }
+
+ def f1 = Nest1.bip().bop(foo = "bar").bippy(1, 2, 3)
+ def f2 = Nest1.bip("abc").bop(foo = 5).bippy
+}
+
+object Named extends Dynamic {
+ def applyDynamic(name: String)(args: Any*): Named.type = {
+ show(this + "." + name + mkArgs(args: _*))
+ this
+ }
+ def applyDynamicNamed(name: String)(args: (String, Any)*): Named.type = {
+ show(this + "." + name + mkArgs(args: _*))
+ this
+ }
+
+ def f1 = this.bippy(a = 1, b = 2).boppy(c = 3, d = 4)()()(e = 5, f = 6)
+ override def toString = "Named"
+}
+
+object Named2 extends Dynamic {
+ def applyDynamic(name: String)(a: Any)(b: Any = "b", c: Any = "c"): Named2.type = {
+ show(this + "." + name + mkArgs(a) + mkArgs(b, c))
+ this
+ }
+ def applyDynamicNamed(name: String)(a: (String, Any))(b: (String, Any), c: (String, Any)): Named2.type = {
+ show(this + "." + name + mkArgs(a) + mkArgs(b, c))
+ this
+ }
+
+ def f1 = this.bippy(1)(b = "q0")
+ def f2 = this.bippy(1)("q0")
+ def f3 = this.bippy(1)(c = "q0")
+ def f4 = this.bippy(1)("q0")
+ def f5 = this.bippy(1)(c = "b", b = "c")
+ def f6 = this.bippy(1)("b", "c")
+ def f7 = this.bippy(1)(b = "q0").bippy(2)()
+ def f8 = this.bippy(1)("q0").bippy(5)(c = "c").dingus(100)(c = "dong")
+ def f9 = this.bippy(1)(b = "q0", c = "q1").hello(100)("!!", "!!")
+
+ override def toString = "Named2"
+}
+
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ {
+ import Mono._
+ f1 ; f2 ; f3 ; f4 ; f5
+ f6
+ }
+ {
+ import Poly._
+ f1 ; f2 ; f3 ; f4 ; f5
+ f6 ; f7 ; f8 ; f9 ; f10
+ }
+ {
+ import Updating._
+ f1 ; f2
+ }
+ {
+ import Nest1._
+ f1 ; f2
+ }
+ {
+ import Named._
+ f1
+ }
+ {
+ import Named2._
+ f1 ; f2 ; f3 ; f4 ; f5
+ f6 ; f7 ; f8 ; f9
+ }
+ }
+}
diff --git a/test/files/run/toolbox_typecheck_implicitsdisabled.scala b/test/files/run/toolbox_typecheck_implicitsdisabled.scala
index f11f0192f3..8a3d433142 100644
--- a/test/files/run/toolbox_typecheck_implicitsdisabled.scala
+++ b/test/files/run/toolbox_typecheck_implicitsdisabled.scala
@@ -6,16 +6,16 @@ import scala.tools.reflect.ToolBox
object Test extends App {
val toolbox = cm.mkToolBox()
- val tree1 = Block(
- Import(Select(Ident(newTermName("scala")), newTermName("Predef")), List(ImportSelector(nme.WILDCARD, -1, null, -1))),
+ val tree1 = Block(List(
+ Import(Select(Ident(newTermName("scala")), newTermName("Predef")), List(ImportSelector(nme.WILDCARD, -1, null, -1)))),
Apply(Select(Literal(Constant(1)), newTermName("$minus$greater")), List(Literal(Constant(2))))
)
val ttree1 = toolbox.typeCheck(tree1, withImplicitViewsDisabled = false)
println(ttree1)
try {
- val tree2 = Block(
- Import(Select(Ident(newTermName("scala")), newTermName("Predef")), List(ImportSelector(nme.WILDCARD, -1, null, -1))),
+ val tree2 = Block(List(
+ Import(Select(Ident(newTermName("scala")), newTermName("Predef")), List(ImportSelector(nme.WILDCARD, -1, null, -1)))),
Apply(Select(Literal(Constant(1)), newTermName("$minus$greater")), List(Literal(Constant(2))))
)
val ttree2 = toolbox.typeCheck(tree2, withImplicitViewsDisabled = true)
diff --git a/test/pending/run/macro-reify-tagless-b/Test_2.scala b/test/pending/run/macro-reify-tagless-b/Test_2.scala
index ebd35ffe47..10487b1515 100644
--- a/test/pending/run/macro-reify-tagless-b/Test_2.scala
+++ b/test/pending/run/macro-reify-tagless-b/Test_2.scala
@@ -6,7 +6,7 @@ object Test extends App {
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.ToolBox
val tpt = AppliedTypeTree(Ident(definitions.ListClass), List(Ident(definitions.StringClass)))
- val rhs = Apply(Select(Ident("Macros"), newTermName("foo")), List(Literal(Constant("hello world"))))
+ val rhs = Apply(Select(Ident(newTermName("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))))
println(cm.mkToolBox().eval(tree))
diff --git a/test/scaladoc/run/SI-191-deprecated.scala b/test/scaladoc/run/SI-191-deprecated.scala
index 746aa9c598..4ed24ff8d1 100755
--- a/test/scaladoc/run/SI-191-deprecated.scala
+++ b/test/scaladoc/run/SI-191-deprecated.scala
@@ -1,5 +1,6 @@
import scala.tools.nsc.doc.model._
-import scala.tools.nsc.doc.model.comment._
+import scala.tools.nsc.doc.base._
+import scala.tools.nsc.doc.base.comment._
import scala.tools.partest.ScaladocModelTest
import java.net.{URI, URL}
import java.io.File
diff --git a/test/scaladoc/run/SI-191.scala b/test/scaladoc/run/SI-191.scala
index 0fb28145c3..6fb5339d66 100755
--- a/test/scaladoc/run/SI-191.scala
+++ b/test/scaladoc/run/SI-191.scala
@@ -1,5 +1,6 @@
import scala.tools.nsc.doc.model._
-import scala.tools.nsc.doc.model.comment._
+import scala.tools.nsc.doc.base._
+import scala.tools.nsc.doc.base.comment._
import scala.tools.partest.ScaladocModelTest
import java.net.{URI, URL}
import java.io.File
diff --git a/test/scaladoc/run/SI-3314.scala b/test/scaladoc/run/SI-3314.scala
index fe220b08af..c856fe46a8 100644
--- a/test/scaladoc/run/SI-3314.scala
+++ b/test/scaladoc/run/SI-3314.scala
@@ -1,3 +1,4 @@
+import scala.tools.nsc.doc.base._
import scala.tools.nsc.doc.model._
import scala.tools.partest.ScaladocModelTest
@@ -88,4 +89,4 @@ object Test extends ScaladocModelTest {
assert(bar.valueParams(0)(0).resultType.name == "(AnyRef { type Lambda[X] <: Either[A,X] })#Lambda[String]",
bar.valueParams(0)(0).resultType.name + " == (AnyRef { type Lambda[X] <: Either[A,X] })#Lambda[String]")
}
-} \ No newline at end of file
+}
diff --git a/test/scaladoc/run/SI-5235.scala b/test/scaladoc/run/SI-5235.scala
index 6295fc7786..c6b7922bb8 100644
--- a/test/scaladoc/run/SI-5235.scala
+++ b/test/scaladoc/run/SI-5235.scala
@@ -1,3 +1,4 @@
+import scala.tools.nsc.doc.base._
import scala.tools.nsc.doc.model._
import scala.tools.nsc.doc.model.diagram._
import scala.tools.partest.ScaladocModelTest
@@ -84,4 +85,4 @@ object Test extends ScaladocModelTest {
assert(mcReverseType.refEntity(0)._1 == LinkToTpl(MyCollection),
mcReverse.qualifiedName + "'s return type has a link to " + MyCollection.qualifiedName)
}
-} \ No newline at end of file
+}
diff --git a/test/scaladoc/run/links.scala b/test/scaladoc/run/links.scala
index 0c67857e1c..fde24edb2a 100644
--- a/test/scaladoc/run/links.scala
+++ b/test/scaladoc/run/links.scala
@@ -1,3 +1,4 @@
+import scala.tools.nsc.doc.base._
import scala.tools.nsc.doc.model._
import scala.tools.partest.ScaladocModelTest
@@ -23,9 +24,9 @@ object Test extends ScaladocModelTest {
val base = rootPackage._package("scala")._package("test")._package("scaladoc")._package("links")
val TEST = base._object("TEST")
- val memberLinks = countLinks(TEST.comment.get, _.link.isInstanceOf[LinkToMember])
- val templateLinks = countLinks(TEST.comment.get, _.link.isInstanceOf[LinkToTpl])
+ val memberLinks = countLinks(TEST.comment.get, _.link.isInstanceOf[LinkToMember[_, _]])
+ val templateLinks = countLinks(TEST.comment.get, _.link.isInstanceOf[LinkToTpl[_]])
assert(memberLinks == 17, memberLinks + " == 17 (the member links in object TEST)")
assert(templateLinks == 6, templateLinks + " == 6 (the template links in object TEST)")
}
-} \ No newline at end of file
+}
diff --git a/test/scaladoc/run/t4922.check b/test/scaladoc/run/t4922.check
new file mode 100644
index 0000000000..619c56180b
--- /dev/null
+++ b/test/scaladoc/run/t4922.check
@@ -0,0 +1 @@
+Done.
diff --git a/test/scaladoc/run/t4922.scala b/test/scaladoc/run/t4922.scala
new file mode 100644
index 0000000000..bce87ac980
--- /dev/null
+++ b/test/scaladoc/run/t4922.scala
@@ -0,0 +1,32 @@
+import scala.tools.nsc.doc.model._
+import scala.tools.partest.ScaladocModelTest
+
+object Test extends ScaladocModelTest {
+
+ // Test code
+ override def code = """
+ // This the default values should be displayed
+
+ object Test {
+ def f (a: Any = "".isEmpty) = ()
+ def g[A](b: A = null) = ()
+ }
+ """
+
+ // no need for special settings
+ def scaladocSettings = ""
+
+ def testModel(rootPackage: Package) = {
+ // get the quick access implicit defs in scope (_package(s), _class(es), _trait(s), object(s) _method(s), _value(s))
+ import access._
+
+ val Test = rootPackage._object("Test")
+ val f = Test._method("f")
+ val g = Test._method("g")
+
+ def assertEqual(s1: String, s2: String) = assert(s1 == s2, s1 + " == " + s2)
+
+ assertEqual(f.valueParams(0)(0).defaultValue.get.expression, "\"\".isEmpty")
+ assertEqual(g.valueParams(0)(0).defaultValue.get.expression, "null")
+ }
+} \ No newline at end of file
diff --git a/test/scaladoc/scalacheck/CommentFactoryTest.scala b/test/scaladoc/scalacheck/CommentFactoryTest.scala
index 5e3141bdc0..96174d29d1 100644
--- a/test/scaladoc/scalacheck/CommentFactoryTest.scala
+++ b/test/scaladoc/scalacheck/CommentFactoryTest.scala
@@ -3,8 +3,7 @@ import org.scalacheck.Prop._
import scala.tools.nsc.Global
import scala.tools.nsc.doc
-import scala.tools.nsc.doc.model._
-import scala.tools.nsc.doc.model.comment._
+import scala.tools.nsc.doc.base.comment._
import scala.tools.nsc.doc.model._
import scala.tools.nsc.doc.model.diagram._