K2: a @JvmField actual companion property, read from common code, is read through a getter it does not have
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 32/100
Direzione di ricerca
Reproduce with the given commonMain/jvmMain expect/actual Listener.Factory.NONE fixture and compare the IR/access path to coil’s EventListener.Factory.NONE (nonAndroidMain) after the TestCoilJvmSlice fix. Trace where an expect companion property still synthesizes a getter instead of taking @JvmField/const from the actual (readAsField) and falling back to the enclosing interface’s static field. Done when common-code reads of the actual @JvmField companion use Listener.Factory.NONE with no getter.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
A @JvmField actual companion property read from common code is read through a getter it does not have, in a minimal multiplatform fixture:
// commonMain
expect abstract class Listener {
fun interface Factory {
fun create(): Listener
companion object { val NONE: Factory }
}
}
class User { fun none(f: Listener.Factory?): Listener.Factory = f ?: Listener.Factory.NONE }
// jvmMain
actual abstract class Listener {
actual fun interface Factory {
actual fun create(): Listener
actual companion object { @JvmField actual val NONE = Factory { object : Listener() {} } }
}
}
User.none converts to return f==null?Factory.Companion.getNONE():f;. kotlinc compiles a @JvmField companion property to a public static field of the enclosing interface, with no getter, so the read should be the field Listener.Factory.NONE.
The same source shape in coil (EventListener.Factory.NONE, nonAndroidMain actual) took a different path: no getter was found there either, so it was a k2-unresolved-access:NONE placeholder. Since the fix for TestCoilJvmSlice, a companion with no getter for the name falls back to the enclosing class's static field, and coil reads the field. This fixture, however, still finds a getter, most likely one built from the expect companion's declaration, which has no @JvmField.
Likely direction: when an expect property has an actual, take @JvmField/const from the actual (readAsField), and do not synthesize accessors for an expect companion property whose actual is a @JvmField.
- Lingua principale
- Java
- Stelle
- 1
- Fork
- 1
- Merge medio
- 1h 58m
- PR unite (30g)
- 5
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di CodeLaser/maddi
-
build/ci good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
bug front-end:javac
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
-
C# printer: an inner class of a generic class needs the outer type's arguments (Outer<A>.Inner)Apertafront-end:csharp
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 10/100
-
Java → C# translation: an idiomatic C# printer driven by the modification and nullability analysesApertaenhancement extension front-end:csharp
Difficoltà 5/5 Più di una settimana Idoneità per principianti 8/100
Tutte le issue di CodeLaser/maddi
Issue simili
-
NullPointerException when a `DeserializationProblemHandler` returns `null` for `byte[]` (single value unwrapped) and `char[]` elementsForse già presa @Marti2203 l’ha presa oggi. Aperta
Difficoltà 2/5 Mezza giornata Idoneità per principianti 88/100
FasterXML/jackson-databind#6300 ·
I maintainer di solito rispondono entro 1 giorno
-
content good first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
cpinitiative/usaco-guide#6699 ·
I maintainer di solito rispondono entro 1 giorno
-
BC remittance upload: a claim MSP refused (S03) is saved with a blank status instead of refused (F)Apertatype: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
carlos-emr/carlos#4933 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
apache/rocketmq-dashboard#6925 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Vakore/ZappierGames#147 ·