blob: 594d28f3e2bcc6a2cf6ead108ab09da70148401c [file] [log] [blame]
// RUN: %target-swift-frontend -typecheck -import-objc-header %S/Inputs/protocol-member-renaming.h -verify %s
// REQUIRES: objc_interop
class Modern : NSObject, FooDelegate {
func foo(_ foo: Foo, willConsume object: Any) {}
}
class PreMigration : NSObject, FooDelegate {
func foo(_ foo: Foo, willConsumeObject object: Any) {}
// expected-error@-1 {{'foo(_:willConsumeObject:)' has been renamed to 'foo(_:willConsume:)'}} {{24-41=willConsume}}
// expected-error@-2 {{method 'foo(_:willConsumeObject:)' has different argument labels from those required by protocol 'FooDelegate' ('foo(_:willConsume:)')}} {{24-41=willConsume}}
}
class OptionalButUnavailableImpl : OptionalButUnavailable {
// Note the argument label that causes this not to match the requirement.
func doTheThing(object: Any) {} // no-warning
}