diff options
-rw-r--r-- | src/dotty/tools/dotc/parsing/JavaParsers.scala | 2 | ||||
-rw-r--r-- | tests/pos/java-interop/volatile/volatile.java | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/parsing/JavaParsers.scala b/src/dotty/tools/dotc/parsing/JavaParsers.scala index 297f3c0f9..7b9d29ce3 100644 --- a/src/dotty/tools/dotc/parsing/JavaParsers.scala +++ b/src/dotty/tools/dotc/parsing/JavaParsers.scala @@ -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 { diff --git a/tests/pos/java-interop/volatile/volatile.java b/tests/pos/java-interop/volatile/volatile.java new file mode 100644 index 000000000..c6a607b4d --- /dev/null +++ b/tests/pos/java-interop/volatile/volatile.java @@ -0,0 +1,3 @@ +public class Foo { + volatile int x = 1; +} |