mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
29 lines
580 B
Swift
29 lines
580 B
Swift
// RUN: %target-parse-verify-swift
|
|
|
|
// REQUIRES: objc_interop
|
|
|
|
import Foundation
|
|
|
|
func acceptBridgeableNSError<E : _ObjectiveCBridgeableErrorProtocol>(e: E) { }
|
|
|
|
@objc enum E1 : Int, ErrorProtocol, _BridgedNSError {
|
|
case A = 1
|
|
}
|
|
|
|
acceptBridgeableNSError(E1.A)
|
|
|
|
@objc enum E2 : Int, ErrorProtocol {
|
|
case A = 1
|
|
}
|
|
|
|
acceptBridgeableNSError(E2.A)
|
|
|
|
|
|
@objc enum E3 : Int {
|
|
case A = 1
|
|
}
|
|
|
|
acceptBridgeableNSError(E3.A)
|
|
// expected-error@-1{{cannot invoke 'acceptBridgeableNSError' with an argument list of type '(E3)'}}
|
|
// expected-note@-2{{expected an argument list of type '(E)'}}
|