mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
If you want to make the parameter and argument label the same in
places where you don't get the argument label for free (i.e., the
first parameter of a function or a parameter of a subscript),
double-up the identifier:
func translate(dx dx: Int, dy: Int) { }
Make this a warning with Fix-Its to ease migration. Part of
rdar://problem/17218256.
Swift SVN r27715
10 lines
242 B
Swift
10 lines
242 B
Swift
// RUN: %target-parse-verify-swift
|
|
|
|
func foo(x x: Int = 0) {}
|
|
let bar = foo
|
|
bar() // expected-error {{missing argument for parameter 'x'}}
|
|
|
|
func foo2(x: Int = 0) {}
|
|
let baz = foo2
|
|
baz() // expected-error {{missing argument for parameter #1}}
|