Skip to content

Commit 201ce2f

Browse files
committed
Merge pull request #882 from dotty-staging/fix/java-annots-pos
Set position on annotations parsed from Java
2 parents 68cc0b7 + 40d4935 commit 201ce2f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/dotty/tools/dotc/parsing/JavaParsers.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ object JavaParsers {
356356
// assumed true unless we see public/private/protected
357357
var isPackageAccess = true
358358
var annots: List[Tree] = Nil
359-
def addAnnot(sym: ClassSymbol) = annots :+= New(TypeTree(sym.typeRef))
359+
def addAnnot(sym: ClassSymbol) = annots :+= New(TypeTree(sym.typeRef)).withPos(Position(in.offset))
360360

361361
while (true) {
362362
in.token match {
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
public class Foo {
2+
volatile int x = 1;
3+
}

0 commit comments

Comments
 (0)