diff options
author | Ondrej Lhotak <olhotak@uwaterloo.ca> | 2014-10-10 13:48:21 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2014-11-22 20:10:21 +0100 |
commit | 36cb1028c0806991fae9e5d33fe9cb0f2d596ed0 (patch) | |
tree | f40c64567b2ce81976ac9afcbd60a4d684e4e1b3 /src/dotty/tools/dotc/typer/Checking.scala | |
parent | 95e845ba131b3d2495b7e8664a568858251e5157 (diff) | |
download | dotty-36cb1028c0806991fae9e5d33fe9cb0f2d596ed0.tar.gz dotty-36cb1028c0806991fae9e5d33fe9cb0f2d596ed0.tar.bz2 dotty-36cb1028c0806991fae9e5d33fe9cb0f2d596ed0.zip |
add comment explaining why checkValue skips Java compilation units
Diffstat (limited to 'src/dotty/tools/dotc/typer/Checking.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Checking.scala | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/typer/Checking.scala b/src/dotty/tools/dotc/typer/Checking.scala index a0c43c568..982b97f7e 100644 --- a/src/dotty/tools/dotc/typer/Checking.scala +++ b/src/dotty/tools/dotc/typer/Checking.scala @@ -182,6 +182,8 @@ trait Checking { def checkValue(tree: Tree, proto: Type)(implicit ctx: Context): tree.type = { if (!proto.isInstanceOf[SelectionProto]) { val sym = tree.tpe.termSymbol + // The check is avoided inside Java compilation units because it always fails + // on the singleton type Module.type. if ((sym is Package) || ((sym is JavaModule) && !ctx.compilationUnit.isJava)) ctx.error(d"$sym is not a value", tree.pos) } tree |