mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
A parse-only option is needed for parse performance tracking and the current option also includes semantic analysis.
15 lines
342 B
Swift
15 lines
342 B
Swift
// RUN: %target-typecheck-verify-swift
|
|
|
|
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}}
|
|
}
|