Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions compiler/src/dotty/tools/dotc/parsing/JavaParsers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ object JavaParsers {
}
while (in.token == DOT) {
in.nextToken()
annotations()
t = typeArgs(atSpan(t.span.start, in.offset)(typeSelect(t, ident())))
}
convertToTypeId(t)
Expand Down
8 changes: 8 additions & 0 deletions tests/pos/i21319/Foo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package app;

import java.util.Optional;
import lib.*;

public class Foo {
private [email protected] Optional<String> userId;
}
3 changes: 3 additions & 0 deletions tests/pos/i21319/Test.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package app

class Test
17 changes: 17 additions & 0 deletions tests/pos/i21319/Valid.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package lib;

import static java.lang.annotation.ElementType.CONSTRUCTOR;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.ElementType.TYPE_USE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

@Target({ METHOD, FIELD, CONSTRUCTOR, PARAMETER, TYPE_USE })
@Retention(RUNTIME)
@Documented
public @interface Valid {}