Skip to content
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

[SR-9899] [5.0] error: add () to forward @autoclosure parameter #52305

Open
shahmishal opened this issue Feb 11, 2019 · 4 comments
Open

[SR-9899] [5.0] error: add () to forward @autoclosure parameter #52305

shahmishal opened this issue Feb 11, 2019 · 4 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself source compatibility

Comments

@shahmishal
Copy link
Member

Previous ID SR-9899
Radar None
Original Reporter @shahmishal
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, SourceCompatibility
Assignee @clackary
Priority Medium

Watchers: @shahmishal

md5: 1fab4f7aa8a0022604a387983da5d548

Issue Description:

Failures:
  FAIL: ProcedureKit, 5.0, 94193d, ProcedureKitCloud, platform=macOS
  FAIL: ProcedureKit, 5.0, 94193d, ProcedureKit, generic/platform=tvOS
  FAIL: ProcedureKit, 5.0, 94193d, ProcedureKit, generic/platform=iOS
  FAIL: ProcedureKit, 5.0, 94193d, ProcedureKit, platform=macOS
  FAIL: CoreStore, 5.0, 286360, CoreStore watchOS, generic/platform=watchOS
  FAIL: CoreStore, 5.0, 286360, CoreStore tvOS, generic/platform=tvOS
  FAIL: CoreStore, 5.0, 286360, CoreStore OSX, generic/platform=macOS
  FAIL: CoreStore, 5.0, 286360, CoreStore iOS, generic/platform=iOS
swift-source-compat-suite/project_cache/ProcedureKit/Sources/ProcedureKit/Repeat.swift:218:49: error: add () to forward @autoclosure parameter
            let result = self._addNextOperation(shouldAddNext)
                                                ^~~~~~~~~~~~~
                                                             ()

swift-source-compat-suite/project_cache/CoreStore/Sources/Relationship.swift:755:37: error: add () to forward @autoclosure parameter
                affectedByKeyPaths: affectedByKeyPaths
                                    ^~~~~~~~~~~~~~~~~~
                                                      ()

Toolchain:

swift-DEVELOPMENT-SNAPSHOT-2019-02-03-a-osx.pkg

Command:

./runner.py --swift-branch master --projects projects.json --include-actions 'action.startswith("Build")' --swiftc /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2019-02-03-a.xctoolchain/usr/bin/swiftc --include-repos 'path == "CoreStore"'
@belkadan
Copy link
Contributor

This is correct behavior for Swift 5 mode, which nothing in the source compat suite should be using yet because Swift 5 hasn't GMed yet.

@swift-ci
Copy link
Collaborator

Comment by Jason B (JIRA)

Does this mean we need to add () to get the compiler to forward the value as an autoclosure? Or does it mean it will invoke the value right away.

@belkadan
Copy link
Contributor

Yep, add the (). Like any autoclosure parameter, the expression will be captured instead of immediately being evaluated.

@clackary
Copy link
Contributor

The last source compatibility project that still is xfailed because of this is Deferred, which is taken care of in this PR: apple/swift-source-compat-suite#370

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
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. compiler The Swift compiler in itself source compatibility
Projects
None yet
Development

No branches or pull requests

4 participants