8246257: Annotated record's vararg type component started to be uncompilable with JDK15b24
Reviewed-by: jjg, jlaskey
This commit is contained in:
parent
2a794b696c
commit
ce4978ffe6
@ -548,6 +548,9 @@ public class TypeAnnotations {
|
|||||||
*/
|
*/
|
||||||
private Type rewriteArrayType(ArrayType type, List<TypeCompound> annotations, TypeAnnotationPosition pos) {
|
private Type rewriteArrayType(ArrayType type, List<TypeCompound> annotations, TypeAnnotationPosition pos) {
|
||||||
ArrayType tomodify = new ArrayType(type);
|
ArrayType tomodify = new ArrayType(type);
|
||||||
|
if (type.isVarargs()) {
|
||||||
|
tomodify = tomodify.makeVarargs();
|
||||||
|
}
|
||||||
ArrayType res = tomodify;
|
ArrayType res = tomodify;
|
||||||
|
|
||||||
List<TypePathEntry> loc = List.nil();
|
List<TypePathEntry> loc = List.nil();
|
||||||
|
@ -1130,6 +1130,26 @@ public class RecordCompilationTests extends CompilationTestCase {
|
|||||||
this.args = args;
|
this.args = args;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
""",
|
||||||
|
"""
|
||||||
|
record R(@A int... ints) {}
|
||||||
|
|
||||||
|
@java.lang.annotation.Target({
|
||||||
|
java.lang.annotation.ElementType.TYPE_USE,
|
||||||
|
java.lang.annotation.ElementType.RECORD_COMPONENT})
|
||||||
|
@interface A {}
|
||||||
|
""",
|
||||||
|
"""
|
||||||
|
record R(@A int... ints) {
|
||||||
|
R(@A int... ints) {
|
||||||
|
this.ints = ints;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@java.lang.annotation.Target({
|
||||||
|
java.lang.annotation.ElementType.TYPE_USE,
|
||||||
|
java.lang.annotation.ElementType.RECORD_COMPONENT})
|
||||||
|
@interface A {}
|
||||||
"""
|
"""
|
||||||
)) {
|
)) {
|
||||||
assertOK(source);
|
assertOK(source);
|
||||||
|
Loading…
Reference in New Issue
Block a user