Skip to content

fix feature guards in swiftinterface for eff. props #37190

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 1 commit into from
May 3, 2021

Conversation

kavon
Copy link
Member

@kavon kavon commented Apr 30, 2021

Effectful properties were not being properly guarded for feature availability in the swiftinterface file. Previously it was only being guarded if the property was async and not just simply throws, plus, the guards were around the accessor like this:

var x: T {
#if ...
  get async
#endif
}

instead of around the whole decl like this

#if ...
var x: T {
  get async
}
#endif

So, this patch adds two things

  1. A new feature in Features.def for Effectful Properties (currently set to be enabled only when -enable-experimental-concurrency is passed since I haven't enabled it by default yet).
  2. A fix for the printing of these guards, to not put them around an accessor, so that it ends up being printed around the enclosing decl instead.

This finishes the resolution to rdar://77324796

@kavon kavon added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. concurrency Feature: umbrella label for concurrency language features labels Apr 30, 2021
@kavon
Copy link
Member Author

kavon commented May 1, 2021

@swift-ci please test and merge

@kavon
Copy link
Member Author

kavon commented May 1, 2021

@swift-ci please test

@kavon kavon force-pushed the eff-prop-swiftinterface-ifguard-fix branch from 8498195 to c5ec5bf Compare May 1, 2021 00:07
@kavon
Copy link
Member Author

kavon commented May 1, 2021

@swift-ci please test

@kavon
Copy link
Member Author

kavon commented May 1, 2021

@swift-ci please smoke test

@compnerd
Copy link
Member

compnerd commented May 1, 2021

@swift-ci please test Windows platform

@swift-ci
Copy link
Contributor

swift-ci commented May 1, 2021

Build failed
Swift Test OS X Platform
Git Sha - c5ec5bf

@xymus
Copy link
Contributor

xymus commented May 1, 2021

@swift-ci Please smoke test macOS

@xymus
Copy link
Contributor

xymus commented May 1, 2021

@swift-ci Please test macOS

@kavon kavon merged commit 1bdf006 into swiftlang:main May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. concurrency Feature: umbrella label for concurrency language features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants