mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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.
11 lines
533 B
Swift
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}}
|
|
}
|