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-11547] Specially type-checked functions don't have their argument labels removed by compound references #53948

Open
hamishknight opened this issue Sep 30, 2019 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself type checker Area → compiler: Semantic analysis

Comments

@hamishknight
Copy link
Collaborator

Previous ID SR-11547
Radar None
Original Reporter @hamishknight
Type Bug
Environment

Swift version 5.1-dev (LLVM c5340df2d1, Swift 3eb5a16c05)
Target: x86_64-apple-darwin18.5.0

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, TypeChecker
Assignee None
Priority Medium

md5: c2c9a09c6640b14591a6d1b0ea908099

Issue Description:

The following incorrectly produces errors:

type(of:)(5) // error: Missing argument label 'of:' in call

func foo(_ fn: () -> Void) {
  withoutActuallyEscaping(_:do:)(fn, { fn in }) // error: Missing argument label 'do:' in call
}

and the following incorrectly compile:

type(of:)(of: 5)

func foo(_ fn: () -> Void) {
  withoutActuallyEscaping(_:do:)(fn, do: { fn in })
}

We should be stripping the argument labels from compound references to type(of:) and withoutActuallyEscaping(_:do:), like we would for other functions.

@hamishknight
Copy link
Collaborator Author

This also appears to be the case with _openExistential(_:do:).

@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 type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

1 participant