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

Functions with wrapped parameters that omit argument labels cannot be referenced. #66046

Open
JessyCatterwaul opened this issue May 22, 2023 · 0 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels

Comments

@JessyCatterwaul
Copy link

JessyCatterwaul commented May 22, 2023

Supposedly…

If a wrapped parameter omits an argument label, the function can be referenced to take in the projected-value type using $_:

But that's not true. Given:

@propertyWrapper struct PropertyWrapper {
  var wrappedValue: Void { () }
  var projectedValue: Void { () }

  init(wrappedValue: Void) { }
  init(projectedValue: Void) { }
}

func ƒ(@PropertyWrapper _: Void) { }

These compile:

  ƒ(())
  ƒ($_: ())
  _ = ƒ(_:)

This does not:

_ = ƒ($_:) // Cannot find 'ƒ($_:)' in scope
@JessyCatterwaul JessyCatterwaul added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels labels May 22, 2023
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. triage needed This issue needs more specific labels
Projects
None yet
Development

No branches or pull requests

1 participant