File tree Expand file tree Collapse file tree 4 files changed +15
-2
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 4 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 1+ package dotty .tools .dotc
2+
3+ import dotty .tools .FatalError
4+
5+ class MissingCoreLibraryException (rootPackage : String ) extends FatalError (
6+ s """ Could not find package $rootPackage from compiler core libraries.
7+ |Make sure the compiler core libraries are on the classpath.
8+ """ .stripMargin
9+ )
Original file line number Diff line number Diff line change @@ -212,7 +212,7 @@ class Definitions {
212212 * in `scalaShadowing` so they don't clash with the same-named `scala`
213213 * members at runtime.
214214 */
215- lazy val ScalaShadowingPackageVal = ctx.requiredPackage(" scalaShadowing" )
215+ lazy val ScalaShadowingPackageVal = ctx.requiredPackage(nme. scalaShadowing)
216216 lazy val ScalaShadowingPackageClass = ScalaShadowingPackageVal .moduleClass.asClass
217217
218218 /** Note: We cannot have same named methods defined in Object and Any (and AnyVal, for that matter)
Original file line number Diff line number Diff line change @@ -1199,7 +1199,10 @@ object Denotations {
11991199 val alt =
12001200 if (generateStubs) missingHook(owner.symbol.moduleClass, selector)
12011201 else NoSymbol
1202- if (alt.exists) alt.denot else MissingRef (owner, selector)
1202+ if (alt.exists) alt.denot
1203+ else if (owner.symbol == defn.RootClass && (selector == nme.scala_ || selector == nme.scalaShadowing))
1204+ throw new MissingCoreLibraryException (selector.toString)
1205+ else MissingRef (owner, selector)
12031206 }
12041207 }
12051208 else owner
Original file line number Diff line number Diff line change @@ -491,6 +491,7 @@ object StdNames {
491491 val runtimeMirror : N = " runtimeMirror"
492492 val sameElements : N = " sameElements"
493493 val scala_ : N = " scala"
494+ val scalaShadowing : N = " scalaShadowing"
494495 val selectDynamic : N = " selectDynamic"
495496 val selectDynamicMethod : N = " selectDynamicMethod"
496497 val selectOverloadedMethod : N = " selectOverloadedMethod"
You can’t perform that action at this time.
0 commit comments