Skip to content

[Observation] Switch to peer instead of arbitrary macros #67289

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 21, 2023

Conversation

natecook1000
Copy link
Member

This adopts @attached(peer) for generating an observable type's underscored storage when expanding the @ObservationTracked macro, instead of using arbitrary with the member macro on the observable type.

rdar://110327683

This adopts `@attached(peer)` for generating an observable type's
underscored storage when expanding the `@ObservationTracked` macro,
instead of using `arbitrary` with the member macro on the
observable type.
@natecook1000 natecook1000 requested review from phausler and hborla July 13, 2023 19:32
@natecook1000
Copy link
Member Author

Tests are currently crashing with this error, even if only instantiating an @Observable-annotated type:

stderr>>> Assertion failed: (dependentIvars->Count == numFields), function initObjCClass, file Metadata.cpp, line 3396.

@natecook1000
Copy link
Member Author

@swift-ci Please test

Copy link
Contributor

@phausler phausler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Provided we can alleviate the compiler crash, this seems correct to me

@hborla
Copy link
Member

hborla commented Jul 18, 2023

@swift-ci please test

@natecook1000
Copy link
Member Author

@swift-ci Please test

@natecook1000
Copy link
Member Author

@swift-ci Please test and merge

@natecook1000 natecook1000 force-pushed the observation_peer_macros branch from 8e9cca1 to e68395c Compare July 21, 2023 14:29
@natecook1000
Copy link
Member Author

@swift-ci Please test and merge

@swift-ci swift-ci merged commit 64ba7ff into swiftlang:main Jul 21, 2023
natecook1000 pushed a commit to natecook1000/swift that referenced this pull request Jul 24, 2023
…_macros

[Observation] Switch to peer instead of arbitrary macros
natecook1000 added a commit that referenced this pull request Jul 25, 2023
…67484)

[Observation] Switch to peer instead of arbitrary macros

Co-authored-by: swift-ci <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants