Keep the get read accessor for function-typed @Model properties on Swift 6.4 - #75
Merged
Merged
Conversation
…Swift 6.4
The 6.3 IRGen crash (`ScalarPairTypeInfo<FuncTypeInfo,…>::loadAsTake` when a
`_read` coroutine yields a closure whose signature carries an indirectly-passed
struct) is not fixed in Swift 6.4 / Xcode 27.0: `@Model struct M { var make:
@sendable (String) -> SixFieldStruct }` still SIGSEGVs swift-frontend in a debug
build. The `#if compiler(>=6.4)` gate that re-enabled `_read` for function types
therefore turned every such client into a compile failure on the new toolchain.
Drop the gate so the `get` carve-out applies on every compiler, un-gate the
macro snapshot test, and add the CHANGELOG entry.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ScalarPairTypeInfo<FuncTypeInfo,…>::loadAsTakewhen a_readcoroutine yields a closure whose signature carries an indirectly-passed struct, >4 fields) is not fixed in Swift 6.4 / Xcode 27.0. The#if compiler(>=6.4)gate inModelTrackedMacro.makeGetSetre-enabled_readfor function-typed properties on 6.4, so any debug build of a client with e.g.var make: @Sendable (String) -> SixFieldStructSIGSEGVs swift-frontend.getcarve-out now applies on every compiler version. Observation is unchanged (same_$modelSource[read:]subscript); the_modifywrite path never had the problem.testModelClosureProperty), update the doc comments, add the CHANGELOG entry.Verification
@Model struct M { var make: @Sendable (String) -> SixFieldStruct }) crashes swift-frontend 6.4 againstmain; compiles with this branch.SwiftModelMacroTests29/29..package(path:)override (reported by the parallel-apple session).Note: the suite itself does not compile on Swift 6.4 yet (
sending-closure region-isolation errors in a few test files) — separate, unrelated to this change.🤖 Generated with Claude Code