diff options
author | Ondrej Lhotak <olhotak@uwaterloo.ca> | 2014-09-04 17:06:02 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2014-11-22 20:10:20 +0100 |
commit | 03627e71d9fdc4b2211d244cc8fd844d57997357 (patch) | |
tree | b0062570c12f5713c09d0aa2519819c202c1f8cb /src/dotty/tools/dotc/typer/Checking.scala | |
parent | cc1d36f64d324b972ec3116f93c4f62fafd706bc (diff) | |
download | dotty-03627e71d9fdc4b2211d244cc8fd844d57997357.tar.gz dotty-03627e71d9fdc4b2211d244cc8fd844d57997357.tar.bz2 dotty-03627e71d9fdc4b2211d244cc8fd844d57997357.zip |
Initial implementation of Java scanner and parser
Ported from scalac 2.11.x branch SHA 9753f23f9362b25a9f481b11dd8d51187187882a
This is mostly a direct port, with few significant dotty-specific
changes needed. The two more significant changes are:
In dotty, the first constructor of a class is pulled out separately from
the other stats in the Template.
The keyword detection code (buildKeywordArray) was moved into Tokens so
that it can more cleanly be shared by the Scala and Java scanners.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Checking.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Checking.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/typer/Checking.scala b/src/dotty/tools/dotc/typer/Checking.scala index 4466e05ed..a0c43c568 100644 --- a/src/dotty/tools/dotc/typer/Checking.scala +++ b/src/dotty/tools/dotc/typer/Checking.scala @@ -182,7 +182,7 @@ trait Checking { def checkValue(tree: Tree, proto: Type)(implicit ctx: Context): tree.type = { if (!proto.isInstanceOf[SelectionProto]) { val sym = tree.tpe.termSymbol - if ((sym is Package) || (sym is JavaModule)) ctx.error(d"$sym is not a value", tree.pos) + if ((sym is Package) || ((sym is JavaModule) && !ctx.compilationUnit.isJava)) ctx.error(d"$sym is not a value", tree.pos) } tree } |