mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Fix <rdar://problem/23550816> QoI: Poor diagnostic in argument list of "print" (varargs related)
When passing a contextual type to a call, if we have a scalar element initializing a varargs parameter list, we need to use the varargs element type contextually. Fixing this improves some confusing diagnostics.
This commit is contained in:
@@ -762,7 +762,7 @@ func inoutTests(inout arr: Int) {
|
||||
func takeAny(x: Any) {}
|
||||
takeAny(&x) // expected-error{{'&' used with non-inout argument of type 'Any'}}
|
||||
func takeManyAny(x: Any...) {}
|
||||
takeManyAny(&x) // expected-error{{'&' used with non-inout argument of type '[Any]'}}
|
||||
takeManyAny(&x) // expected-error{{'&' used with non-inout argument of type 'Any' (aka 'protocol<>')}}
|
||||
takeManyAny(1, &x) // expected-error{{'&' used with non-inout argument of type 'Any'}}
|
||||
func takeIntAndAny(x: Int, _ y: Any) {}
|
||||
takeIntAndAny(1, &x) // expected-error{{'&' used with non-inout argument of type 'Any'}}
|
||||
|
||||
Reference in New Issue
Block a user