Files
swift-mirror/test/decl/protocol/objc_error_convention_conflict.swift
Joe Groff 90062f1839 Sema: Infer error convention from @objc protocol requirements.
When a Swift declaration witnesses an ObjC protocol requirement, its error convention needs to
match the requirement. Furthermore, if there are different protocol requirements that the
Swift method can witness, with different error conventions, we need to bail out because we
can't simultaneously match all of them. Fixes rdar://problem/59496036 | SR-12201.
2020-04-01 18:26:38 -07:00

11 lines
533 B
Swift

// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -verify %s -import-objc-header %S/Inputs/objc_error_convention_conflict.h
// REQUIRES: objc_interop
class CallerXYImpl: CallerX, CallerY {
func use(_ x: Int, error callback: @escaping () -> ()) throws { } // expected-error {{incompatible error argument conventions}}
}
class CallerXDerivedY: CallerBaseY, CallerX {
override func use(_ x: Int, error callback: @escaping () -> ()) throws { } // expected-error {{incompatible error argument conventions}}
}