[SR-11506] terrible diagnostic (ambiguous expression type) when required parameter is omitted #53907
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
diagnostics QoI
Bug: Diagnostics Quality of Implementation
Attachment: Download
Additional Detail from JIRA
md5: 65c83ea8b5fa11034876c35b34e4ba5a
Issue Description:
The following program
has one problem: The call to
Klazz.init(foo: "", bar: nil)
is missing the requiredbar
parameter. But instead of telling us that, the compiler claims there's an ambiguity:In this example, this is rather easy to see what's wrong. But in a real-world example we had
and the call-site in a test was
where Xcode literally only shows
(see screenshot). When using the complete build output or SwiftPM, the message is slightly longer (at least showing the "ambiguity" candidates) but still incredibly unhelpful:
This is Xcode 11.0/Swift 5.1
The text was updated successfully, but these errors were encountered: