@@ -19,11 +19,11 @@ func attributedInOutFunc(x: inout @convention(c) () -> Int32) {} // expected-not
19
19
attributedInOutFunc ( ) // expected-error {{missing argument for parameter 'x' in call}} {{21-21=x: &<#@convention(c) () -> Int32#>}}
20
20
21
21
func genericFunc1< T> ( x: T ) { } // expected-note * {{here}}
22
- genericFunc1 ( ) // expected-error {{missing argument for parameter 'x' in call}} {{14-14=x: <#T #>}}
22
+ genericFunc1 ( ) // expected-error {{missing argument for parameter 'x' in call}} {{14-14=x: <#Any #>}}
23
23
24
24
protocol P { }
25
25
func genericFunc2< T : P > ( x: T ) { } // expected-note * {{here}}
26
- genericFunc2 ( ) // expected-error {{missing argument for parameter 'x' in call}} {{14-14=x: <#T #>}}
26
+ genericFunc2 ( ) // expected-error {{missing argument for parameter 'x' in call}} {{14-14=x: <#Any #>}}
27
27
28
28
typealias MyInt = Int
29
29
func aliasedFunc( x: MyInt ) { } // expected-note * {{here}}
@@ -61,11 +61,10 @@ param2FuncNonNamed2("foo") // expected-error {{missing argument for parameter 'x
61
61
62
62
func param2FuncNonNamed3( _ x: Int , _ y: String ) { } // expected-note * {{here}}
63
63
param2FuncNonNamed3 ( 1 ) // expected-error {{missing argument for parameter #2 in call}} {{22-22=, <#String#>}}
64
- param2FuncNonNamed3 ( " foo " ) // expected-error {{missing argument for parameter #2 in call}} {{26-26=, <#String#>}}
65
- // FIXME: Bad diagnostic. Could this be #1?
64
+ param2FuncNonNamed3 ( " foo " ) // expected-error {{missing argument for parameter #1 in call}} {{21-21=<#Int#>, }}
66
65
67
66
func unlabeledParamFollowingVariadic( _: Any ... , _: Any , _: Any ) { } // expected-error {{a parameter following a variadic parameter requires a label}}; // expected-note {{here}}
68
- unlabeledParamFollowingVariadic ( 1 , 1 , 1 ) // expected-error {{missing argument for parameter #2 in call}} {{40-40=, <#Any#> }}
67
+ unlabeledParamFollowingVariadic ( 1 , 1 , 1 ) // expected-error {{missing arguments for parameters #2, #3 in call}}
69
68
70
69
func labeledParamFollowingVariadic( _: Any ... , label: Any , _: Any ) { }
71
70
labeledParamFollowingVariadic ( 1 , label: 1 , 1 )
@@ -97,55 +96,61 @@ _ = s1[x: 1, y: {1}] // Ok.
97
96
_ = s1 [ x: 1 ] { 1 } // Ok.
98
97
_ = s1 [ x: 1 ] // expected-error {{missing argument for parameter 'y' in call}} {{12-12=, y: <#() -> Int#>}}
99
98
_ = s1 [ y: { 1 } ] // expected-error {{missing argument for parameter 'x' in call}} {{8-8=x: <#Int#>, }}
100
- _ = s1 [ ] { 1 } // expected-error {{cannot convert value of type '() -> Int' to expected argument type '( x: Int, y: () -> Int)'}} {{none }}
99
+ _ = s1 [ ] { 1 } // expected-error {{missing argument for parameter 'x' in call}} {{8-8= x: <# Int#> }}
101
100
_ = s1 { 1 } // expected-error {{cannot call value of non-function type 'S1'}} {{none}}
102
- _ = s1 [ ] // expected-error {{missing argument for parameter 'x' in call}} {{8-8=x: <#Int#>}}
101
+ _ = s1 [ ] // expected-error {{missing arguments for parameters 'x', 'y' in call}} {{8-8=x: <#Int#>, y: <#() -> Int#>}}
103
102
s1 [ x: 1 , y: { 1 } ] = 1 // Ok.
104
103
s1 [ x: 1 ] { 1 } = 1 // Ok.
105
104
s1 [ x: 1 ] = 1 // expected-error {{missing argument for parameter 'y' in call}} {{8-8=, y: <#() -> Int#>}}
106
105
s1 [ y: { 1 } ] = 1 // expected-error {{missing argument for parameter 'x' in call}} {{4-4=x: <#Int#>, }}
107
- s1 [ ] { 1 } = 1 // expected-error {{cannot convert value of type '() -> Int' to expected argument type '( x: Int, y: () -> Int)'}} {{none }}
106
+ s1 [ ] { 1 } = 1 // expected-error {{missing argument for parameter 'x' in call}} {{4-4= x: <# Int#> }}
108
107
109
108
struct S2 {
110
109
subscript( x: Int , y: ( ) -> Int ) -> Int { get { return 1 } set { } } // expected-note * {{here}}
111
110
}
112
111
var s2 = S2 ( )
113
112
_ = s2 [ 1 , { 1 } ] // Ok.
114
113
_ = s2 [ 1 ] { 1 } // Ok.
115
- _ = s2 [ 1 ] // expected-error {{cannot convert value of type 'Int' to expected argument type '(Int, () -> Int)'}} {{none }}
116
- _ = s2 [ { 1 } ] // expected-error {{cannot convert value of type '() -> Int' to expected argument type '(Int, () -> Int)' }} {{none }}
117
- _ = s2 [ ] { 1 } // expected-error {{cannot convert value of type '() -> Int' to expected argument type '(Int, () -> Int)' }} {{none }}
114
+ _ = s2 [ 1 ] // expected-error {{missing argument for parameter #2 in call}} {{9-9=, <# () -> Int#> }}
115
+ _ = s2 [ { 1 } ] // expected-error {{missing argument for parameter #1 in call }} {{8-8=<#Int#>, }}
116
+ _ = s2 [ ] { 1 } // expected-error {{missing argument for parameter #1 in call }} {{8-8=<#Int#> }}
118
117
_ = s2 { 1 } // expected-error {{cannot call value of non-function type 'S2'}} {{none}}
119
- _ = s2 [ ] // expected-error {{missing argument for parameter #1 in call}} {{8-8=<#Int#>}}
118
+ _ = s2 [ ] // expected-error {{missing arguments for parameters #1, #2 in call}} {{8-8=<#Int#>, <#() -> Int#>}}
120
119
s2 [ 1 , { 1 } ] = 1 // Ok.
121
120
s2 [ 1 ] { 1 } = 1 // Ok.
122
- s2 [ 1 ] = 1 // expected-error {{cannot convert value of type 'Int' to expected argument type '(Int, () -> Int)'}} {{none }}
123
- s2 [ { 1 } ] = 1 // expected-error {{cannot convert value of type '() -> Int' to expected argument type '(Int, () -> Int)' }} {{none }}
124
- s2 [ ] { 1 } = 1 // expected-error {{cannot convert value of type '() -> Int' to expected argument type '(Int, () -> Int)' }} {{none }}
121
+ s2 [ 1 ] = 1 // expected-error {{missing argument for parameter #2 in call}} {{5-5=, <# () -> Int#> }}
122
+ s2 [ { 1 } ] = 1 // expected-error {{missing argument for parameter #1 in call }} {{4-4=<#Int#>, }}
123
+ s2 [ ] { 1 } = 1 // expected-error {{missing argument for parameter #1 in call }} {{4-4=<#Int#> }}
125
124
126
125
struct S3 {
127
126
subscript( x x: Int , y y: Int , z z: ( Int ) -> Int ) -> Int { get { return 1 } set { } } // expected-note * {{here}}
128
127
}
129
128
var s3 = S3 ( )
130
129
_ = s3 [ y: 1 ] { 1 } // expected-error {{missing argument for parameter 'x' in call}} {{8-8=x: <#Int#>, }}
130
+ // expected-error@-1 {{contextual type for closure argument list expects 1 argument, which cannot be implicitly ignored}} {{15-15= _ in}}
131
131
_ = s3 [ x: 1 ] { 1 } // expected-error {{missing argument for parameter 'y' in call}} {{12-12=, y: <#Int#>}}
132
+ // expected-error@-1 {{contextual type for closure argument list expects 1 argument, which cannot be implicitly ignored}} {{15-15= _ in}}
132
133
_ = s3 [ x: 1 , y: 1 ] // expected-error {{missing argument for parameter 'z' in call}} {{18-18=, z: <#(Int) -> Int#>}}
133
134
s3 [ y: 1 ] { 1 } = 1 // expected-error {{missing argument for parameter 'x' in call}} {{4-4=x: <#Int#>, }}
135
+ // expected-error@-1 {{contextual type for closure argument list expects 1 argument, which cannot be implicitly ignored}} {{11-11= _ in}}
134
136
s3 [ x: 1 ] { 1 } = 1 // expected-error {{missing argument for parameter 'y' in call}} {{8-8=, y: <#Int#>}}
137
+ // expected-error@-1 {{contextual type for closure argument list expects 1 argument, which cannot be implicitly ignored}} {{11-11= _ in}}
135
138
s3 [ x: 1 , y: 1 ] = 1 // expected-error {{missing argument for parameter 'z' in call}} {{14-14=, z: <#(Int) -> Int#>}}
136
139
137
140
struct S4 {
138
141
subscript( x: Int , y: Int , z: ( Int ) -> Int ) -> Int { get { return 1 } set { } } // expected-note * {{here}}
139
142
}
140
143
var s4 = S4 ( )
141
144
_ = s4 [ 1 ] { 1 } // expected-error {{missing argument for parameter #2 in call}} {{9-9=, <#Int#>}}
145
+ // expected-error@-1 {{contextual type for closure argument list expects 1 argument, which cannot be implicitly ignored}} {{12-12= _ in}}
142
146
_ = s4 [ 1 , 1 ] // expected-error {{missing argument for parameter #3 in call}} {{12-12=, <#(Int) -> Int#>}}
143
147
s4 [ 1 ] { 1 } = 1 // expected-error {{missing argument for parameter #2 in call}} {{5-5=, <#Int#>}}
148
+ // expected-error@-1 {{contextual type for closure argument list expects 1 argument, which cannot be implicitly ignored}} {{8-8= _ in}}
144
149
s4 [ 1 , 1 ] = 1 // expected-error {{missing argument for parameter #3 in call}} {{8-8=, <#(Int) -> Int#>}}
145
150
146
151
func multiLine( x: Int , y: Int , z: Int ) { } // expected-note * {{here}}
147
- multiLine (
148
- ) // expected-error {{missing argument for parameter 'x' in call}} {{1-1=x: <#Int#>}}
152
+ multiLine ( // expected-error {{missing arguments for parameters 'x', 'y', 'z' in call}} {{11-11=x: <#Int#>, y: <#Int#>, z: <#Int#>}}
153
+ )
149
154
multiLine (
150
155
y: 1 , // expected-error {{missing argument for parameter 'x' in call}} {{3-3=x: <#Int#>, }}
151
156
z: 1
0 commit comments