Skip to content

Allow function builder attrs on vars without bodies in interfaces #29165

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

Conversation

harlanhaskins
Copy link
Contributor

The check for whether or not we can use a function builder on a property
checked whether the attached getter had a body, which is not always true for
module interfaces. Just disable that part of the check when compiling a
module interface.

rdar://58535753

The check for whether or not we can use a function builder on a property
checked whether the attached getter had a body, which is not always true for
module interfaces. Just disable that part of the check when compiling a
module interface.

rdar://58535753
@harlanhaskins
Copy link
Contributor Author

@swift-ci please smoke test

@slavapestov
Copy link
Contributor

Does the function builder actually change the interface of the VarDecl? What if we skipped printing it altogether?

@harlanhaskins
Copy link
Contributor Author

Also totally an option, and honestly, probably the better one.

@harlanhaskins
Copy link
Contributor Author

Chatted with Slava offline, since we also need to support existing, shipped interfaces, this is the best option now.

Copy link
Contributor

@slavapestov slavapestov left a comment

Choose a reason for hiding this comment

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

Ok, approved. Can you file a radar to not print the attribute on definitions, only function parameters, since it's apparently unnecessary? And yeah, since this shipped in 5.1, it appears we have to support existing interfaces either way.

@harlanhaskins
Copy link
Contributor Author

Yep! rdar://58544718

@harlanhaskins harlanhaskins merged commit e23e77b into swiftlang:master Jan 13, 2020
@harlanhaskins
Copy link
Contributor Author

I’ll cherry pick this to 5.2 later today

harlanhaskins pushed a commit to harlanhaskins/swift that referenced this pull request Jan 14, 2020
…iftlang#29165)

The check for whether or not we can use a function builder on a property
checked whether the attached getter had a body, which is not always true for
module interfaces. Just disable that part of the check when compiling a
module interface.

rdar://58535753
harlanhaskins pushed a commit that referenced this pull request Jan 14, 2020
…9165) (#29177)

The check for whether or not we can use a function builder on a property
checked whether the attached getter had a body, which is not always true for
module interfaces. Just disable that part of the check when compiling a
module interface.

rdar://58535753
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