mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
We were never handling this correctly, and default arguments are checked along with the method body. In some cases where no further validation was necessary (such as when the default argument was a literal value), the compiler would let this slip through but in others this would cause a crash. (rdar://problem/16476405) Swift SVN r15736
11 lines
210 B
Swift
11 lines
210 B
Swift
// RUN: %swift -parse -verify %s
|
|
|
|
protocol P {
|
|
func foo(truth: Bool = false) // expected-error{{default argument not permitted in a protocol method}}
|
|
}
|
|
|
|
struct X : P {
|
|
func foo(truth: Bool = false) {
|
|
}
|
|
}
|