summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/reflect/scala/reflect/internal/TreeGen.scala11
-rw-r--r--test/files/neg/t6323a.check6
-rw-r--r--test/files/presentation/random.check2
-rw-r--r--test/files/presentation/t8941.check2
-rw-r--r--test/files/run/delambdafy_t6028.check2
-rw-r--r--test/files/run/idempotency-case-classes.check12
-rw-r--r--test/files/run/macro-typecheck-implicitsdisabled.check2
-rw-r--r--test/files/run/macroPlugins-enterStats.check12
-rw-r--r--test/files/run/macroPlugins-namerHooks.check12
-rw-r--r--test/files/run/reflection-scala-annotations.check2
-rw-r--r--test/files/run/reify-aliases.check2
-rw-r--r--test/files/run/t5064.check45
-rw-r--r--test/files/run/t5943a1.check2
-rw-r--r--test/files/run/t6028.check2
-rw-r--r--test/files/run/t6331b.check6
-rw-r--r--test/files/run/t7375b.check8
-rw-r--r--test/files/run/t7817-tree-gen.check28
-rw-r--r--test/files/scalacheck/quasiquotes/TypecheckedProps.scala2
-rw-r--r--test/junit/scala/reflect/internal/TreeGenTest.scala51
-rw-r--r--test/junit/scala/tools/nsc/symtab/SymbolTableForUnitTesting.scala4
20 files changed, 138 insertions, 75 deletions
diff --git a/src/reflect/scala/reflect/internal/TreeGen.scala b/src/reflect/scala/reflect/internal/TreeGen.scala
index 5c8ae17f5b..2933aa3892 100644
--- a/src/reflect/scala/reflect/internal/TreeGen.scala
+++ b/src/reflect/scala/reflect/internal/TreeGen.scala
@@ -129,7 +129,16 @@ abstract class TreeGen {
/** Builds a reference to given symbol. */
def mkAttributedRef(sym: Symbol): RefTree =
- if (sym.owner.isClass) mkAttributedRef(sym.owner.thisType, sym)
+ if (sym.owner.isStaticOwner) {
+ if (sym.owner.isRoot)
+ mkAttributedIdent(sym)
+ else {
+ val ownerModule = sym.owner.sourceModule
+ assert(ownerModule != NoSymbol, sym.owner)
+ mkAttributedSelect(mkAttributedRef(sym.owner.sourceModule), sym)
+ }
+ }
+ else if (sym.owner.isClass) mkAttributedRef(sym.owner.thisType, sym)
else mkAttributedIdent(sym)
def mkUnattributedRef(sym: Symbol): RefTree = mkUnattributedRef(sym.fullNameAsName('.'))
diff --git a/test/files/neg/t6323a.check b/test/files/neg/t6323a.check
index 261a60ef3c..c4e92d93f0 100644
--- a/test/files/neg/t6323a.check
+++ b/test/files/neg/t6323a.check
@@ -1,10 +1,10 @@
-t6323a.scala:10: materializing requested scala.reflect.type.ClassTag[Test] using `package`.this.materializeClassTag[Test]()
+t6323a.scala:10: materializing requested scala.reflect.type.ClassTag[Test] using scala.reflect.`package`.materializeClassTag[Test]()
val lookAtMe = m.reflect(Test("a",List(5)))
^
-t6323a.scala:11: materializing requested reflect.runtime.universe.type.TypeTag[Test] using `package`.this.materializeTypeTag[Test](scala.reflect.runtime.`package`.universe)
+t6323a.scala:11: materializing requested reflect.runtime.universe.type.TypeTag[Test] using scala.reflect.api.`package`.materializeTypeTag[Test](scala.reflect.runtime.`package`.universe)
val value = u.typeOf[Test]
^
-t6323a.scala:11: `package`.this.materializeTypeTag[Test](scala.reflect.runtime.`package`.universe) is not a valid implicit value for reflect.runtime.universe.TypeTag[Test] because:
+t6323a.scala:11: scala.reflect.api.`package`.materializeTypeTag[Test](scala.reflect.runtime.`package`.universe) is not a valid implicit value for reflect.runtime.universe.TypeTag[Test] because:
failed to typecheck the materialized tag:
cannot create a TypeTag referring to class Test.Test local to the reifee: use WeakTypeTag instead
val value = u.typeOf[Test]
diff --git a/test/files/presentation/random.check b/test/files/presentation/random.check
index fb3500aeea..1e40e178be 100644
--- a/test/files/presentation/random.check
+++ b/test/files/presentation/random.check
@@ -4,7 +4,7 @@ askType at Random.scala(18,14)
================================================================================
[response] askTypeAt (18,14)
val filter: Int => Boolean = try {
- java.this.lang.Integer.parseInt(args.apply(0)) match {
+ java.lang.Integer.parseInt(args.apply(0)) match {
case 1 => ((x: Int) => x.%(2).!=(0))
case 2 => ((x: Int) => x.%(2).==(0))
case _ => ((x: Int) => x.!=(0))
diff --git a/test/files/presentation/t8941.check b/test/files/presentation/t8941.check
index 341804903a..4285eebd8f 100644
--- a/test/files/presentation/t8941.check
+++ b/test/files/presentation/t8941.check
@@ -3,5 +3,5 @@ reload: Source.scala
askType at Source.scala(6,7)
================================================================================
[response] askTypeAt (6,7)
-scala.this.Predef.???
+scala.Predef.???
================================================================================
diff --git a/test/files/run/delambdafy_t6028.check b/test/files/run/delambdafy_t6028.check
index 9ff1d0e78e..885fc3c9f3 100644
--- a/test/files/run/delambdafy_t6028.check
+++ b/test/files/run/delambdafy_t6028.check
@@ -46,7 +46,7 @@ package <empty> {
def /*MethodLocalTrait$1$class*/$init$(barParam$1: String): Unit = {
()
};
- scala.this.Predef.print(barParam$1)
+ scala.Predef.print(barParam$1)
};
final <artifact> private[this] def $anonfun$2(tryyParam$1: String, tryyLocal$1: runtime.ObjectRef): Unit = try {
tryyLocal$1.elem = tryyParam$1
diff --git a/test/files/run/idempotency-case-classes.check b/test/files/run/idempotency-case-classes.check
index ea698cec59..38c2fb9326 100644
--- a/test/files/run/idempotency-case-classes.check
+++ b/test/files/run/idempotency-case-classes.check
@@ -20,15 +20,15 @@ C(2,3)
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);
+ override <synthetic> def productIterator: Iterator[Any] = scala.runtime.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)
+ acc = scala.runtime.Statics.mix(acc, x);
+ acc = scala.runtime.Statics.mix(acc, y);
+ scala.runtime.Statics.finalizeHash(acc, 2)
};
- override <synthetic> def toString(): String = ScalaRunTime.this._toString(C.this);
+ override <synthetic> def toString(): String = scala.runtime.ScalaRunTime._toString(C.this);
override <synthetic> def equals(x$1: Any): Boolean = C.this.eq(x$1.asInstanceOf[Object]).||(x$1 match {
case (_: C) => true
case _ => false
@@ -45,7 +45,7 @@ C(2,3)
final override <synthetic> 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
+ scala.None
else
Some.apply[(Int, Int)](scala.Tuple2.apply[Int, Int](x$0.x, x$0.y))
};
diff --git a/test/files/run/macro-typecheck-implicitsdisabled.check b/test/files/run/macro-typecheck-implicitsdisabled.check
index 91d8fabd72..07404cf3fb 100644
--- a/test/files/run/macro-typecheck-implicitsdisabled.check
+++ b/test/files/run/macro-typecheck-implicitsdisabled.check
@@ -1,2 +1,2 @@
-scala.this.Predef.ArrowAssoc[Int](1).->[Int](2)
+scala.Predef.ArrowAssoc[Int](1).->[Int](2)
scala.reflect.macros.TypecheckException: value -> is not a member of Int
diff --git a/test/files/run/macroPlugins-enterStats.check b/test/files/run/macroPlugins-enterStats.check
index 133b1ae1af..182d54ca34 100644
--- a/test/files/run/macroPlugins-enterStats.check
+++ b/test/files/run/macroPlugins-enterStats.check
@@ -6,13 +6,13 @@ package <empty> {
()
};
def x: Int = 2;
- def xmacroPlugin1: Nothing = scala.this.Predef.???;
- def xmacroPlugin2: Nothing = scala.this.Predef.???;
- def xmacroPlugin2macroPlugin1: Nothing = scala.this.Predef.???;
+ def xmacroPlugin1: Nothing = scala.Predef.???;
+ def xmacroPlugin2: Nothing = scala.Predef.???;
+ def xmacroPlugin2macroPlugin1: Nothing = scala.Predef.???;
def y: Int = 3;
- def ymacroPlugin1: Nothing = scala.this.Predef.???;
- def ymacroPlugin2: Nothing = scala.this.Predef.???;
- def ymacroPlugin2macroPlugin1: Nothing = scala.this.Predef.???
+ def ymacroPlugin1: Nothing = scala.Predef.???;
+ def ymacroPlugin2: Nothing = scala.Predef.???;
+ def ymacroPlugin2macroPlugin1: Nothing = scala.Predef.???
}
}
diff --git a/test/files/run/macroPlugins-namerHooks.check b/test/files/run/macroPlugins-namerHooks.check
index 56b170cbd9..4409f196f0 100644
--- a/test/files/run/macroPlugins-namerHooks.check
+++ b/test/files/run/macroPlugins-namerHooks.check
@@ -1,7 +1,7 @@
enterSym(package <empty> { case class C extends scala.Product with scala.Serializable { <caseaccessor> <paramaccessor> val x: Int = _; <caseaccessor> <paramaccessor> val y: Int = _; def <init>(x: Int, y: Int) = { super.<init>(); () } } })
enterSym(case class C extends scala.Product with scala.Serializable { <caseaccessor> <paramaccessor> val x: Int = _; <caseaccessor> <paramaccessor> val y: Int = _; def <init>(x: Int, y: Int) = { super.<init>(); () } })
ensureCompanionObject(case class C extends scala.Product with scala.Serializable { <caseaccessor> <paramaccessor> val x: Int = _; <caseaccessor> <paramaccessor> val y: Int = _; def <init>(x: Int, y: Int) = { super.<init>(); () } }, ...)
-enterSym(<synthetic> object C extends runtime.this.AbstractFunction2[Int, Int, C] { def <init>() = { super.<init>(); () }; final override <synthetic> def toString() = "C" })
+enterSym(<synthetic> object C extends scala.runtime.AbstractFunction2[Int, Int, C] { def <init>() = { super.<init>(); () }; final override <synthetic> def toString() = "C" })
enterStat(case class C extends scala.Product with scala.Serializable { <caseaccessor> <paramaccessor> val x: Int = _; <caseaccessor> <paramaccessor> val y: Int = _; def <init>(x: Int, y: Int) = { super.<init>(); () } })
enterSym(<caseaccessor> <paramaccessor> val x: Int = _)
enterSym(<caseaccessor> <paramaccessor> val y: Int = _)
@@ -18,17 +18,17 @@ enterStat(super.<init>())
enterSym(<synthetic> def copy$default$1 = x)
enterSym(<synthetic> def copy$default$2 = y)
enterSym(<synthetic> var acc: Int = -889275714)
-enterSym(acc = Statics.this.mix(acc, x))
-enterSym(acc = Statics.this.mix(acc, y))
+enterSym(acc = scala.runtime.Statics.mix(acc, x))
+enterSym(acc = scala.runtime.Statics.mix(acc, y))
enterStat(<synthetic> var acc: Int = -889275714)
-enterStat(acc = Statics.this.mix(acc, x))
-enterStat(acc = Statics.this.mix(acc, y))
+enterStat(acc = scala.runtime.Statics.mix(acc, x))
+enterStat(acc = scala.runtime.Statics.mix(acc, y))
enterSym(<synthetic> val C$1: C = x$1.asInstanceOf[C])
enterStat(<synthetic> val C$1: C = x$1.asInstanceOf[C])
enterSym(def <init>() = { super.<init>(); () })
enterSym(final override <synthetic> def toString() = "C")
enterSym(case <synthetic> def apply(x: Int, y: Int): C = new C(x, y))
-enterSym(case <synthetic> def unapply(x$0: C): _root_.scala.Option[scala.Tuple2[Int, Int]] = if (x$0.==(null)) scala.this.None else Some(scala.Tuple2(x$0.x, x$0.y)))
+enterSym(case <synthetic> def unapply(x$0: C): _root_.scala.Option[scala.Tuple2[Int, Int]] = if (x$0.==(null)) scala.None else Some(scala.Tuple2(x$0.x, x$0.y)))
enterStat(def <init>() = { super.<init>(); () })
enterStat(final override <synthetic> def toString() = "C")
enterSym(def <init>() = { super.<init>(); () })
diff --git a/test/files/run/reflection-scala-annotations.check b/test/files/run/reflection-scala-annotations.check
index 5bc2786161..44062d8c4a 100644
--- a/test/files/run/reflection-scala-annotations.check
+++ b/test/files/run/reflection-scala-annotations.check
@@ -3,5 +3,5 @@ make your annotation visible at runtime. If that is what
you want, you must write the annotation class in Java.
class jann(x: Int, y: Array[Int]) extends ClassfileAnnotation
^
-new sann(1, immutable.this.List.apply[Int](1, 2))
+new sann(1, scala.collection.immutable.List.apply[Int](1, 2))
new jann(y = Array(1, 2), x = 2)
diff --git a/test/files/run/reify-aliases.check b/test/files/run/reify-aliases.check
index da784227af..b6b5fb71b2 100644
--- a/test/files/run/reify-aliases.check
+++ b/test/files/run/reify-aliases.check
@@ -1 +1 @@
-TypeRef(SingleType(ThisType(scala), scala.Predef), TypeName("String"), List())
+TypeRef(SingleType(TypeRef(ThisType(<root>), scala, List()), scala.Predef), TypeName("String"), List())
diff --git a/test/files/run/t5064.check b/test/files/run/t5064.check
index 61ccfd16e7..f7d25a67e4 100644
--- a/test/files/run/t5064.check
+++ b/test/files/run/t5064.check
@@ -1,25 +1,26 @@
[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
-<16:20> immutable.this
-[16:23] scala.this.Predef.wrapIntArray(Array[Int]{1})
-[20] scala.this.Predef.wrapIntArray
-[20] scala.this.Predef
-[20] scala.this
-[26:32] collection.this.Seq.apply(scala.this.Predef.wrapIntArray(Array[Int]{1}))
-[26:29] collection.this.Seq.apply
-<26:29> collection.this.Seq
-<26:29> collection.this
-[26:32] scala.this.Predef.wrapIntArray(Array[Int]{1})
-[29] scala.this.Predef.wrapIntArray
-[29] scala.this.Predef
-[29] scala.this
-[35:39] immutable.this.List
-<35:39> immutable.this
-[42:45] collection.this.Seq
-<42:45> collection.this
-[48:51] immutable.this.Nil
-<48:51> immutable.this
+[16:23] scala.collection.immutable.List.apply(scala.Predef.wrapIntArray(Array[Int]{1}))
+[16:20] scala.collection.immutable.List.apply
+<16:20> scala.collection.immutable.List
+<16:20> scala.collection.immutable
+<16:20> scala.collection
+[16:23] scala.Predef.wrapIntArray(Array[Int]{1})
+[20] scala.Predef.wrapIntArray
+[20] scala.Predef
+[26:32] scala.collection.Seq.apply(scala.Predef.wrapIntArray(Array[Int]{1}))
+[26:29] scala.collection.Seq.apply
+<26:29> scala.collection.Seq
+<26:29> scala.collection
+[26:32] scala.Predef.wrapIntArray(Array[Int]{1})
+[29] scala.Predef.wrapIntArray
+[29] scala.Predef
+[35:39] scala.collection.immutable.List
+<35:39> scala.collection.immutable
+<35:39> scala.collection
+[42:45] scala.collection.Seq
+<42:45> scala.collection
+[48:51] scala.collection.immutable.Nil
+<48:51> scala.collection.immutable
+<48:51> scala.collection
diff --git a/test/files/run/t5943a1.check b/test/files/run/t5943a1.check
index 9f4d160af8..4b683a3da5 100644
--- a/test/files/run/t5943a1.check
+++ b/test/files/run/t5943a1.check
@@ -1 +1 @@
-scala.this.Predef.intWrapper(1).to(3).map[Int, scala.collection.immutable.IndexedSeq[Int]](((x$1: Int) => x$1.+(1)))(immutable.this.IndexedSeq.canBuildFrom[Int])
+scala.Predef.intWrapper(1).to(3).map[Int, scala.collection.immutable.IndexedSeq[Int]](((x$1: Int) => x$1.+(1)))(immutable.this.IndexedSeq.canBuildFrom[Int])
diff --git a/test/files/run/t6028.check b/test/files/run/t6028.check
index edc8b22d6d..a768f32976 100644
--- a/test/files/run/t6028.check
+++ b/test/files/run/t6028.check
@@ -58,7 +58,7 @@ package <empty> {
def /*MethodLocalTrait$1$class*/$init$(barParam$1: Int): Unit = {
()
};
- scala.this.Predef.print(scala.Int.box(barParam$1))
+ scala.Predef.print(scala.Int.box(barParam$1))
};
@SerialVersionUID(value = 0) final <synthetic> class $anonfun$tryy$1 extends scala.runtime.AbstractFunction0$mcV$sp with Serializable {
def <init>($outer: T, tryyParam$1: Int, tryyLocal$1: runtime.IntRef): <$anon: Function0> = {
diff --git a/test/files/run/t6331b.check b/test/files/run/t6331b.check
index 6ca09e3814..565348ce3f 100644
--- a/test/files/run/t6331b.check
+++ b/test/files/run/t6331b.check
@@ -10,19 +10,19 @@ else
-0.0
res: Double = 0.0
-trace> Test.this.intercept.apply[Any](if (scala.this.Predef.???)
+trace> Test.this.intercept.apply[Any](if (scala.Predef.???)
-0.0
else
0.0)
res: Any = class scala.NotImplementedError
-trace> Test.this.intercept.apply[Any](if (scala.this.Predef.???)
+trace> Test.this.intercept.apply[Any](if (scala.Predef.???)
0.0
else
0.0)
res: Any = class scala.NotImplementedError
-trace> Test.this.intercept.apply[Any](if (scala.this.Predef.???)
+trace> Test.this.intercept.apply[Any](if (scala.Predef.???)
()
else
())
diff --git a/test/files/run/t7375b.check b/test/files/run/t7375b.check
index d7578e28ba..0993cceca2 100644
--- a/test/files/run/t7375b.check
+++ b/test/files/run/t7375b.check
@@ -1,4 +1,4 @@
-Predef.this.classOf[C1]
-Predef.this.classOf[C2]
-Predef.this.classOf[C1]
-Predef.this.classOf[C2]
+scala.Predef.classOf[C1]
+scala.Predef.classOf[C2]
+scala.Predef.classOf[C1]
+scala.Predef.classOf[C2]
diff --git a/test/files/run/t7817-tree-gen.check b/test/files/run/t7817-tree-gen.check
index 4ed4b0d94a..69ad2b2f28 100644
--- a/test/files/run/t7817-tree-gen.check
+++ b/test/files/run/t7817-tree-gen.check
@@ -38,13 +38,13 @@ Joint Compilation:
mixin [ test2.PO] - test2.package$PO
cleanup [ test2.PO] - test2.package$PO
- typer [ test2.bar] - `package`.this.bar
- pickler [ test2.bar] - `package`.this.bar
- refchecks [ test2.bar] - `package`.this.bar
- uncurry [ test2.bar] - `package`.this.bar
- specialize [ test2.bar] - `package`.this.bar
- explicitouter [ test2.bar] - `package`.this.bar
- erasure [ test2.bar] - `package`.this.bar
+ typer [ test2.bar] - test2.`package`.bar
+ pickler [ test2.bar] - test2.`package`.bar
+ refchecks [ test2.bar] - test2.`package`.bar
+ uncurry [ test2.bar] - test2.`package`.bar
+ specialize [ test2.bar] - test2.`package`.bar
+ explicitouter [ test2.bar] - test2.`package`.bar
+ erasure [ test2.bar] - test2.`package`.bar
posterasure [ test2.bar] - test2.`package`.bar
flatten [ test2.bar] - test2.`package`.bar
mixin [ test2.bar] - test2.`package`.bar
@@ -90,13 +90,13 @@ Separate Compilation:
mixin [ PO] - test2.package$PO
cleanup [ PO] - test2.package$PO
- typer [testSep2.bar] - `package`.this.bar
- pickler [testSep2.bar] - `package`.this.bar
- refchecks [testSep2.bar] - `package`.this.bar
- uncurry [testSep2.bar] - `package`.this.bar
- specialize [testSep2.bar] - `package`.this.bar
- explicitouter [testSep2.bar] - `package`.this.bar
- erasure [testSep2.bar] - `package`.this.bar
+ typer [testSep2.bar] - test2.`package`.bar
+ pickler [testSep2.bar] - test2.`package`.bar
+ refchecks [testSep2.bar] - test2.`package`.bar
+ uncurry [testSep2.bar] - test2.`package`.bar
+ specialize [testSep2.bar] - test2.`package`.bar
+ explicitouter [testSep2.bar] - test2.`package`.bar
+ erasure [testSep2.bar] - test2.`package`.bar
posterasure [testSep2.bar] - test2.`package`.bar
flatten [testSep2.bar] - test2.`package`.bar
mixin [testSep2.bar] - test2.`package`.bar
diff --git a/test/files/scalacheck/quasiquotes/TypecheckedProps.scala b/test/files/scalacheck/quasiquotes/TypecheckedProps.scala
index f84df269ca..2c4d81f333 100644
--- a/test/files/scalacheck/quasiquotes/TypecheckedProps.scala
+++ b/test/files/scalacheck/quasiquotes/TypecheckedProps.scala
@@ -167,7 +167,7 @@ trait TypecheckedTypes { self: QuasiquoteProperties =>
property("applied type") = test {
val tt = typecheckTyp(tq"Map[Int, Int]")
val tq"$tpt[..$tpts]" = tt
- val tq"scala.this.Predef.Map" = tpt
+ val tq"scala.Predef.Map" = tpt
val List(tq"scala.Int", tq"scala.Int") = tpts
}
diff --git a/test/junit/scala/reflect/internal/TreeGenTest.scala b/test/junit/scala/reflect/internal/TreeGenTest.scala
new file mode 100644
index 0000000000..db1ea5cf6a
--- /dev/null
+++ b/test/junit/scala/reflect/internal/TreeGenTest.scala
@@ -0,0 +1,51 @@
+package scala.reflect.internal
+
+import org.junit.Assert._
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
+
+import scala.runtime.ScalaRunTime
+import scala.tools.nsc.symtab.SymbolTableForUnitTesting
+
+@RunWith(classOf[JUnit4])
+class TreeGenTest {
+ object symbolTable extends SymbolTableForUnitTesting
+
+ import symbolTable._
+
+ @Test
+ def attributedRefToTopLevelMemberNotPrefixedByThis_t9473_a(): Unit = {
+ val SomeClass = symbolOf[Some[_]]
+ val ref = gen.mkAttributedRef(SomeClass)
+ assertEquals("scala.Some", ref.toString) // was scala.this.Some
+ ref match {
+ case sel @ Select(pre @ Ident(preName), name) =>
+ assertEquals(TermName("scala"), preName)
+ assertEquals(TypeName("Some"), name)
+ assertEquals(SomeClass, sel.symbol)
+ case _ => fail(showRaw(ref))
+ }
+ }
+
+ @Test
+ def attributedRefToTopLevelMemberNotPrefixedByThis_t9473_b(): Unit = {
+ val ScalaRuntimeModule = symbolOf[ScalaRunTime.type].sourceModule
+ val ref = gen.mkAttributedRef(ScalaRuntimeModule)
+ assertEquals("scala.runtime.ScalaRunTime", ref.toString)
+ ref match {
+ case sel @ Select(Select(Ident(TermName("scala")), TermName("runtime")), TermName("ScalaRunTime")) =>
+ case _ => fail(showRaw(ref))
+ }
+ }
+ @Test
+ def attributedRefToTopLevelMemberNotPrefixedByThis_t9473_c(): Unit = {
+ val DummyImplicitClass = symbolOf[Predef.DummyImplicit]
+ val ref = gen.mkAttributedRef(DummyImplicitClass)
+ assertEquals("scala.Predef.DummyImplicit", ref.toString)
+// ref match {
+// case sel @ Select(Select(Ident(TermName("scala")), TermName("runtime")), TermName("ScalaRunTime")) =>
+// case _ => fail(showRaw(ref))
+// }
+ }
+}
diff --git a/test/junit/scala/tools/nsc/symtab/SymbolTableForUnitTesting.scala b/test/junit/scala/tools/nsc/symtab/SymbolTableForUnitTesting.scala
index f0f20acf07..365901c4d6 100644
--- a/test/junit/scala/tools/nsc/symtab/SymbolTableForUnitTesting.scala
+++ b/test/junit/scala/tools/nsc/symtab/SymbolTableForUnitTesting.scala
@@ -119,7 +119,9 @@ class SymbolTableForUnitTesting extends SymbolTable {
}
phasesArray
}
- lazy val treeInfo: scala.reflect.internal.TreeInfo{val global: SymbolTableForUnitTesting.this.type} = ???
+ lazy val treeInfo = new scala.reflect.internal.TreeInfo {
+ val global: SymbolTableForUnitTesting.this.type = SymbolTableForUnitTesting.this
+ }
val currentFreshNameCreator = new reflect.internal.util.FreshNameCreator