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 {
212
212
* in `scalaShadowing` so they don't clash with the same-named `scala`
213
213
* members at runtime.
214
214
*/
215
- lazy val ScalaShadowingPackageVal = ctx.requiredPackage(" scalaShadowing" )
215
+ lazy val ScalaShadowingPackageVal = ctx.requiredPackage(nme. scalaShadowing)
216
216
lazy val ScalaShadowingPackageClass = ScalaShadowingPackageVal .moduleClass.asClass
217
217
218
218
/** 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 {
1199
1199
val alt =
1200
1200
if (generateStubs) missingHook(owner.symbol.moduleClass, selector)
1201
1201
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)
1203
1206
}
1204
1207
}
1205
1208
else owner
Original file line number Diff line number Diff line change @@ -491,6 +491,7 @@ object StdNames {
491
491
val runtimeMirror : N = " runtimeMirror"
492
492
val sameElements : N = " sameElements"
493
493
val scala_ : N = " scala"
494
+ val scalaShadowing : N = " scalaShadowing"
494
495
val selectDynamic : N = " selectDynamic"
495
496
val selectDynamicMethod : N = " selectDynamicMethod"
496
497
val selectOverloadedMethod : N = " selectOverloadedMethod"
You can’t perform that action at this time.
0 commit comments