Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

maddi-java-openjdk: type-use annotations on an anonymous class creation's type are dropped

Chiusa
#144 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
java, kotlin
Ambito
backend, compilers

Direzione di ricerca

Start by tracing how the OpenJDK front end builds the anonymous class’s parent ParameterizedType and the ConstructorCall type, then compare that path with the named class supertype clause that preserves annotations. The issue names no files or tests, so first locate those entry points and a focused front end test. Done when the anonymous class parent type retains @Nullable and the Kotlin output keeps the annotation consistently with the next() return type.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug front-end:javac

The OpenJDK front end keeps no type-use annotations on the type of an anonymous class creation. guava's Iterators.partitionImpl:

return new UnmodifiableIterator<List<@Nullable T>>() {
  @Override
  public List<@Nullable T> next() { ... }
};

arrives as UnmodifiableIterator<List<T>>. Neither the anonymous class's parent type nor the ConstructorCall's type carries the @Nullable. The same annotation on a named class's supertype clause is kept; the J2K printer prints that one as T? since 367ca79bc.

Effect: the Kotlin translation prints the anonymous class header as UnmodifiableIterator<MutableList<T>>, while its next(): MutableList<T?> keeps the annotation. kotlinc then reports "return type of 'fun next(): MutableList<T?>' is not a subtype of the return type of the overridden member" (guava Iterators.kt:387, Iterables.kt:177, and Iterators.kt:376/397 downstream).

Expected: the parent ParameterizedType of the anonymous TypeInfo, or the ConstructorCall's parameterizedType(), carries the type-use annotations as written, as for a named class's extends/implements clause.

Found while reducing guava's KotlinConf scoreboard compile errors, together with the printer session.

🤖 Generated with Claude Code

Lingua principale
Java
Stelle
1
Fork
1
Merge medio
1h 58m
PR unite (30g)
5

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di CodeLaser/maddi

Tutte le issue di CodeLaser/maddi

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.