Files
swift-mirror/test/stmt/errors_objc.swift
Joe Groff d998692b60 Sema/SIL: NSError has no special powers without ObjC interop.
In particular, it doesn't "toll-free bridge" to the Error existential on non-ObjC-interop platforms, and we would miscompile as if it could. This should fix SR-585.
2017-02-25 09:20:24 -08:00

15 lines
295 B
Swift

// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck -verify %s
// REQUIRES: objc_interop
import Foundation
// Catching `as NSError` ought to be exhaustive when ObjC interop is enabled.
func bar() throws {}
func foo() {
do {
try bar()
} catch _ as NSError {
}
}