Files
swift-mirror/test/ClangImporter/protocol-member-renaming.swift
Allan Shortlidge 43ce0dfe5b Sema: Record a default witness for requirements with satisfied Obj-C siblings.
Rather than just skipping requirements with satisfied Obj-C siblings during
`resolveValueWitnesses()`, proactively record a default witness for these
requirements. This prevents lazy value witness resolution from giving the
skipped requirements a default witness after the conformance is already marked
complete, which causes an assertion to fail.

Resolves rdar://119435253
2024-03-11 14:46:19 -07:00

18 lines
641 B
Swift

// 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}}
}
class OptionalButUnavailableImpl : OptionalButUnavailable {
// Note the argument label that causes this not to match the requirement.
func doTheThing(object: Any) {} // no-warning
}