We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
macOS Big Sur 11.1 Xcode Version 12.3 (12C33) Xcode Playground
md5: c0c448b173e2622f5ea7a112ce7273a6
Issue Description:
All the function calls that omit leading parameter with default do not compile:
see: https://forums.swift.org/t/swiftui-withanimation-first-param-has-default-value-so-why-withanimation-doit-doesnt-compile/43442/2
func ƒ(_: Int = 0, _: Bool) { } ƒ(false) // error: missing argument for parameter #​1 in call func ƒƒ(_: Int = 0, _: Int = 0, _: Bool) { } ƒƒ(false) // error: missing argument for parameter #​3 in call struct Foo { static func sƒ(_: Int = 0, _: Bool) { } func ƒ(_: Int = 0, _: Bool) { } } Foo.sƒ(false) // error: missing argument for parameter #​1 in call let foo = Foo() foo.ƒ(false) // error: missing argument for parameter #​1 in call
The text was updated successfully, but these errors were encountered:
@swift-ci create
Sorry, something went wrong.
I think this is intentional.
If you look at https://github.com/apple/swift-evolution/blob/master/proposals/0060-defaulted-parameter-order.md, it only mentions
Arbitrary labeled parameters with default arguments may still be elided
It doesn't say "arbitrary parameters", only "arbitrary labeled parameters".
There is also a forum thread discussing this issue here: https://forums.swift.org/t/ordering-of-unnamed-parameters-parameters-with-default-values/24153 . Here is the main part:
Type-checking occurs after arguments are matched to parameters.
No branches or pull requests
Environment
macOS Big Sur 11.1
Xcode Version 12.3 (12C33) Xcode Playground
Additional Detail from JIRA
md5: c0c448b173e2622f5ea7a112ce7273a6
Issue Description:
All the function calls that omit leading parameter with default do not compile:
see: https://forums.swift.org/t/swiftui-withanimation-first-param-has-default-value-so-why-withanimation-doit-doesnt-compile/43442/2
The text was updated successfully, but these errors were encountered: