[SR-4270] Useless diagnostic when passing expression of wrong type to function #46853
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
type checker
Area → compiler: Semantic analysis
Environment
Swift version 3.0.2 (swiftlang-800.0.63 clang-800.0.42.1)
Swift version 4.0 (swiftlang-900.0.59 clang-900.0.34.2)
Additional Detail from JIRA
md5: 5fb54fccdf2077876f40a43fd14ae467
Issue Description:
Code:
Result:
error: repl.swift:8:13: error: result values in '? :' expression have mismatching types '' and ''
f(x ? .a(a) : .b)
~~~~~ ^ ~~
This is a reduction of a case I saw in my code. In the real code I got "Int1 is not convertible to 'Bool'", but I'm not sure why that was different, other than the fact that it's inside of a closure inside of another closure...
The text was updated successfully, but these errors were encountered: