Skip to content

Commit

Permalink
Remove an obsolete workaround for an issue with repeated annotations …
Browse files Browse the repository at this point in the history
…in Kotlin stubs

PiperOrigin-RevId: 725401092
  • Loading branch information
cushon authored and Javac Team committed Feb 11, 2025
1 parent 5d422e5 commit 086765f
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions java/com/google/turbine/binder/DisambiguateTypeAnnotations.java
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,6 @@ public static ImmutableList<AnnoInfo> groupRepeated(
}
ClassSymbol container = info.annotationMetadata().repeatable();
if (container == null) {
if (isKotlinRepeatable(info)) {
continue;
}
AnnoInfo anno = infos.iterator().next();
throw TurbineError.format(
anno.source(), anno.position(), ErrorKind.NONREPEATABLE_ANNOTATION, symbol);
Expand All @@ -329,19 +326,5 @@ public static ImmutableList<AnnoInfo> groupRepeated(
return result.build();
}

// Work-around for https://youtrack.jetbrains.net/issue/KT-34189.
// Kotlin stubs include repeated annotations that are valid in Kotlin (i.e. meta-annotated with
// @kotlin.annotation.Repeatable), even though they are invalid Java.
// TODO(b/142002426): kill this with fire
static boolean isKotlinRepeatable(TypeBoundClass info) {
for (AnnoInfo metaAnno : info.annotations()) {
if (metaAnno.sym() != null
&& metaAnno.sym().binaryName().equals("kotlin/annotation/Repeatable")) {
return true;
}
}
return false;
}

private DisambiguateTypeAnnotations() {}
}

0 comments on commit 086765f

Please sign in to comment.