Repository navigation
Commit 2a004bf
Enum case closure payloads are escaping
An associated value is stored in the enum, but a closure payload without `@escaping` (which Swift
doesn't allow, or need, there) was lowered as non-escaping: the case constructor's thunk captured the
call's JNI environment and local reference in the closure the enum keeps, which dangle once the call
returns, and which Swift 6 rejects for `@MainActor` closures. Case constructors now take closures as
escaping, like a property setter's `newValue`.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>1 parent 8d08945 commit 2a004bf
2 files changed
Lines changed: 10 additions & 2 deletions
File tree
- Sources/SwiftExtract/SwiftTypes
- Tests/JExtractSwiftTests/JNI
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| 174 | + | |
174 | 175 | | |
175 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
176 | 182 | | |
177 | 183 | | |
178 | 184 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
416 | 416 | | |
417 | 417 | | |
418 | 418 | | |
419 | | - | |
| 419 | + | |
420 | 420 | | |
421 | 421 | | |
422 | 422 | | |
| |||
430 | 430 | | |
431 | 431 | | |
432 | 432 | | |
| 433 | + | |
| 434 | + | |
433 | 435 | | |
434 | 436 | | |
435 | 437 | | |
| |||
0 commit comments