@@ -324,6 +324,7 @@ f8(1.0) // expected-error {{cannot invoke 'f8' with an argument list of
324
324
class CurriedClass {
325
325
func method1( ) { }
326
326
func method2( a: Int ) ( b : Int ) { }
327
+ func method3( a: Int , b : Int ) { }
327
328
}
328
329
329
330
let c = CurriedClass ( )
@@ -345,8 +346,28 @@ CurriedClass.method1(2.0)(1) // expected-error {{cannot invoke 'method1' w
345
346
CurriedClass . method2 ( c) ( 32 ) ( b: 1 )
346
347
_ = CurriedClass . method2 ( c)
347
348
_ = CurriedClass . method2 ( c) ( 32 )
349
+ _ = CurriedClass . method2 ( 1 , 2 ) // expected-error {{extra argument in call}}
348
350
CurriedClass . method2 ( c) ( 1.0 ) ( b: 1 ) // expected-error {{cannot invoke value of type '(Int) -> (b: Int) -> ()' with argument list '(Double)'}}
349
351
CurriedClass . method2 ( c) ( 1 ) ( b: 1.0 ) // expected-error {{cannot invoke value of type '(b: Int) -> ()' with argument list '(b: Double)'}}
350
352
CurriedClass . method2 ( c) ( 2 ) ( c: 1.0 ) // expected-error {{cannot invoke value of type '(b: Int) -> ()' with argument list '(c: Double)'}}
351
353
352
354
355
+ CurriedClass . method3 ( c) ( 32 , b: 1 )
356
+ _ = CurriedClass . method3 ( c)
357
+ _ = CurriedClass . method3 ( c) ( 1 , 2 ) // expected-error {{missing argument label 'b:' in call}}
358
+ _ = CurriedClass . method3 ( c) ( 1 , b: 2 ) ( 32 ) // expected-error {{cannot call value of non-function type '()'}}
359
+ _ = CurriedClass . method3 ( 1 , 2 ) // expected-error {{extra argument in call}}
360
+ CurriedClass . method3 ( c) ( 1.0 , b: 1 ) // expected-error {{cannot invoke value of type '(Int, b: Int) -> ()' with argument list '(Double, b: Int)'}}
361
+ CurriedClass . method3 ( c) ( 1 ) // expected-error {{cannot invoke value of type '(Int, b: Int) -> ()' with argument list '(Int)'}}
362
+ CurriedClass . method3 ( c) ( c: 1.0 ) // expected-error {{missing argument for parameter 'b' in call}}
363
+
364
+
365
+ extension CurriedClass {
366
+ func f( ) {
367
+ method3 ( 1 , b: 2 )
368
+ method3 ( ) // expected-error {{missing argument for parameter #1 in call}}
369
+
370
+ method3 ( 42 ) // expected-error {{cannot invoke 'method3' with an argument list of type '(Int)'}}
371
+ method3 ( self ) // expected-error {{missing argument for parameter 'b' in call}}
372
+ }
373
+ }
0 commit comments