Skip to content

Commit 8e2c11f

Browse files
committed
add comment explaining why checkValue skips Java compilation units
1 parent c9fbc92 commit 8e2c11f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/dotty/tools/dotc/typer/Checking.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ trait Checking {
179179
def checkValue(tree: Tree, proto: Type)(implicit ctx: Context): tree.type = {
180180
if (!proto.isInstanceOf[SelectionProto]) {
181181
val sym = tree.tpe.termSymbol
182+
// The check is avoided inside Java compilation units because it always fails
183+
// on the singleton type Module.type.
182184
if ((sym is Package) || ((sym is JavaModule) && !ctx.compilationUnit.isJava)) ctx.error(d"$sym is not a value", tree.pos)
183185
}
184186
tree

0 commit comments

Comments
 (0)