Skip to content

Commit 4d6c29f

Browse files
committed
Add documentation
1 parent 3e5009d commit 4d6c29f

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

compiler/src/dotty/tools/dotc/core/Denotations.scala

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,6 +1192,13 @@ object Denotations {
11921192
def staticRef(path: Name, generateStubs: Boolean = true, isPackage: Boolean = false)(implicit ctx: Context): Denotation = {
11931193
def select(prefix: Denotation, selector: Name): Denotation = {
11941194
val owner = prefix.disambiguate(_.info.isParameterless)
1195+
def isPackageFromCoreLibMissing: Boolean = {
1196+
owner.symbol == defn.RootClass &&
1197+
{
1198+
selector == nme.scala_ || // if the scala package is missing, the stdlib must be missing
1199+
selector == nme.scalaShadowing // if the scalaShadowing package is missing, the dotty library must be missing
1200+
}
1201+
}
11951202
if (owner.exists) {
11961203
val result = if (isPackage) owner.info.decl(selector) else owner.info.member(selector)
11971204
if (result.exists) result
@@ -1200,8 +1207,7 @@ object Denotations {
12001207
if (generateStubs) missingHook(owner.symbol.moduleClass, selector)
12011208
else NoSymbol
12021209
if (alt.exists) alt.denot
1203-
else if (owner.symbol == defn.RootClass && (selector == nme.scala_ || selector == nme.scalaShadowing))
1204-
throw new MissingCoreLibraryException(selector.toString)
1210+
else if (isPackageFromCoreLibMissing) throw new MissingCoreLibraryException(selector.toString)
12051211
else MissingRef(owner, selector)
12061212
}
12071213
}

compiler/test/dotty/tools/vulpix/TestConfiguration.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ object TestConfiguration {
2525

2626
val classPath = mkClassPath(Jars.dottyTestDeps)
2727

28-
def mkClassPath(deps: List[String]) = {
28+
def mkClassPath(deps: List[String]): Array[String] = {
2929
val paths = deps map { p =>
3030
val file = new java.io.File(p)
3131
assert(

0 commit comments

Comments
 (0)