|
73 | 73 | <attr path="/api/package[@name='androidx.compose.foundation']/class[@name='MutationInterruptedException']" name="visibility">public</attr> |
74 | 74 |
|
75 | 75 | <!-- |
76 | | - Kotlin `object` companion on a `class`: the nested peer binds as |
77 | | - `<Outer>.Companion`, which collides with the static `Companion` property the |
78 | | - generator would otherwise emit on the outer class (a nested type and a |
79 | | - property can't share a name), so the field is silently dropped and the |
80 | | - singleton is only reachable via raw JNI. Rename every nested `*.Companion` |
81 | | - peer to `CompanionStatic` (the same wildcard pattern kotlin-stdlib, okio, |
82 | | - aicore, and genai-prompt already use) so the generator surfaces |
83 | | - `public static <Outer>.CompanionStatic Companion { get; }` on every outer |
84 | | - class, letting consumers write e.g. `KeyboardOptions.Companion.Default`, |
85 | | - `ScrollState.Companion.Saver`, `LazyListState.Companion.Saver` directly. |
86 | | - (Interface companions are hoisted to top-level `<Outer>Companion` by the |
87 | | - generator before this rename matches, so they're unaffected.) |
| 76 | + Kotlin `object` companion on a `class`: the JVM emits a `public static |
| 77 | + Companion Companion;` field on the outer class plus a nested |
| 78 | + `<Outer>.Companion` peer type. C# can't have both a static member and a |
| 79 | + nested type with the same name, so the generator silently drops the static |
| 80 | + field and the singleton is only reachable via raw JNI. Rename the static |
| 81 | + field to `CompanionInstance` (leaving the nested type as |
| 82 | + `<Outer>.Companion`) so the generator emits |
| 83 | + `public static <Outer>.Companion CompanionInstance { get; }` on every outer |
| 84 | + class — `KeyboardOptions.CompanionInstance.Default`, |
| 85 | + `ScrollState.CompanionInstance.Saver`, `LazyListState.CompanionInstance.Saver` |
| 86 | + are now reachable directly. Interface companions are unaffected — the |
| 87 | + generator hoists their peer to top-level `<Outer>Companion` and emits a |
| 88 | + public `CompanionStatic` accessor that this rename doesn't match. |
88 | 89 | --> |
89 | | - <attr path="/api/package/class[substring(@name,string-length(@name)-9)='.Companion']" name="managedName">CompanionStatic</attr> |
| 90 | + <attr path="/api/package/class/field[@name='Companion' and substring(@type,string-length(@type)-9)='.Companion']" name="managedName">CompanionInstance</attr> |
90 | 91 | </metadata> |
0 commit comments