Skip to content

Commit

Permalink
Merge pull request scala#882 from dotty-staging/fix/java-annots-pos
Browse files Browse the repository at this point in the history
Set position on annotations parsed from Java
  • Loading branch information
odersky committed Oct 30, 2015
2 parents 68cc0b7 + 40d4935 commit 201ce2f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/dotty/tools/dotc/parsing/JavaParsers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ object JavaParsers {
// assumed true unless we see public/private/protected
var isPackageAccess = true
var annots: List[Tree] = Nil
def addAnnot(sym: ClassSymbol) = annots :+= New(TypeTree(sym.typeRef))
def addAnnot(sym: ClassSymbol) = annots :+= New(TypeTree(sym.typeRef)).withPos(Position(in.offset))

while (true) {
in.token match {
Expand Down
3 changes: 3 additions & 0 deletions tests/pos/java-interop/volatile/volatile.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
public class Foo {
volatile int x = 1;
}

0 comments on commit 201ce2f

Please sign in to comment.