Repository navigation
Conversation
|
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Szymon.
|
013913d to
bfbb3c0
Compare
Really? I'm fairly certain we've been using |
|
To clarify the scope: the reproducer returns the defaults object from native Swift to Kotlin. Ordinary native reads and writes use different accessors. The regression calls this native function from the transpiled test: public func getStandardUserDefaults() -> Any {
UserDefaults.standard
}With only The failing generated lookup is: Java_class.getMethodID(
name: "getUserDefaults",
sig: "()Lskip/foundation/UserDefaults;"
)!
Restoring |
|
Following up on my reply, here is the evidence from the saved local Android regression runs on October 24. The comparison used the regression in this PR against upstream base With the original internal property, this command from the generated Gradle root runs the reproducer: gradle :SkipAndroidBridgeSamples:connectedDebugAndroidTest \
'-Pandroid.testInstrumentationRunnerArguments.class=skip.android.bridge.samples.SkipAndroidBridgeSamplesTests#testUserDefaultsReturnedFromNativeSwift$SkipAndroidBridgeSamples'Its result was: Original crash-log excerpt, including the mangled Swift symbolsThese are selected original lines from that sample test process. Intermediate framework frames are omitted. After restoring The connected-test XML confirms the totals and the new test case: The logs directly establish the crash in the getter-method lookup and the successful run after restoring public visibility. The getter-name mismatch is the diagnosis from the generated JNI lookup and Kotlin visibility behavior; the log does not itself print the mangled getter name. |
Returning native
UserDefaults.standardto Kotlin throughAnycan trap in the generated JNI getter lookup. This is the object-projection path used byAndroidUserDefaults.toJavaObject; ordinary native reads and writes exercise different accessors.The generated bridge requests
getUserDefaults, while Kotlin mangles an internal property getter. Make the read-onlyUserDefaultsAccess.userDefaultsproperty public so the getter has the expected name.The regression returns the defaults object from native Swift, writes through the projected Kotlin object, reads the value from Swift, and removes its unique test key.
Validation
bfbb3c0, including host/Robolectric, iOS, and Android emulator steps.swift test --skip XCSkipTests: 20 tests, 9 expected platform skips, no failures.AndroidUserDefaults_Bridge.swift. Restoring it passes the full Android suite. Both runs used the same local generator with the separate harness changes in Run native Swift Testing on the Android main run loop skipstone#311.The saved crash excerpt, reproduction command, and passing test totals are included in the discussion.
Checklist
swift testand the Android checks described above.