Skip to content

[Property Wrappers] Fix handling of properties that are default initialized via property wrapper #31949

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 2 commits into from
May 22, 2020

Conversation

hborla
Copy link
Member

@hborla hborla commented May 21, 2020

  • In ParamDecl::getDefaultValueStringRepresentation , only attempt to extract the text for an initial wrapped value if the property has a wrapped value placeholder in the initializer call. Otherwise, the compiler will crash when serializing the memberwise initializer.
  • For properties that are implicitly default initialized via property wrapper (without () on the property wrapper attribute), mark the init call as implicit. There are assertions elsewhere (e.g. in SemaAnnotator::handleCustomAttributes) that expect an explicit argument on the custom attribute if the initializer is not implicit.

Resolves: rdar://problem/59471019

hborla added 2 commits May 21, 2020 14:21
to return a string representing default initialization when a
property is default initialized via property wrapper.
…lized

via property wrapper, mark the init call as implicit.
@hborla hborla requested a review from DougGregor May 21, 2020 21:38
@hborla
Copy link
Member Author

hborla commented May 21, 2020

@swift-ci please smoke test

@hborla
Copy link
Member Author

hborla commented May 21, 2020

@swift-ci please smoke test OS X Platform

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@hborla hborla merged commit a97bbf9 into swiftlang:master May 22, 2020
@hborla hborla deleted the property-wrapper-default-init branch May 22, 2020 01:01
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.

2 participants