Files
swift-mirror/test/decl/protocol/protocol_with_default_args.swift
Chris Willmore ac86dc2ab2 Raise an error on declaring a protocol initializer with default args.
rdar://problem/18637242

Swift SVN r22853
2014-10-20 22:40:48 +00:00

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}}
}