-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Compile Time Constant Extraction] Add extraction of property wrappers #62555
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
[Compile Time Constant Extraction] Add extraction of property wrappers #62555
Conversation
@swift-ci test |
8614aa3
to
8684a1f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great.
// CHECK-NEXT: "kind": "struct", | ||
// CHECK-NEXT: "properties": [ | ||
// CHECK-NEXT: { | ||
// CHECK-NEXT: "label": "_propertyWrapper1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't necessarily a comment on this, and the current output actually captures what we do to the AST to de-sugar property-wrapped properties.
But I wonder if its best to leave this as-is and let clients figure out how to connect a property with an attribute to its corresponding underlying _
and $
properties, or if we can bundle them up here somehow. Wdyt @jPaolantonio?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a really great question, and one I don't quite have the answer for yet.
I briefly considered omitting _
and $
prefaced properties until we determined if they should be represented differently, but decided against it.
I think leaving them as-is for now to match the AST seems reasonable, but open to other ideas.
8684a1f
to
c30c78a
Compare
@swift-ci test |
Add compile-time extraction for variables attributed with property wrappers.