mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
15 lines
332 B
Swift
15 lines
332 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) {
|
|
}
|
|
}
|
|
|
|
protocol Q {
|
|
init(truth: Bool = false) // expected-error{{default argument not permitted in a protocol initializer}}
|
|
}
|