mirror of
https://github.com/apple/swift.git
synced 2026-06-27 12:25:55 +02:00
b67d5f0cf7
This converts the instances of the pattern for which we have a proper substitution in lit. This will make it easier to replace it appropriately with Windows equivalents.
19 lines
535 B
Swift
19 lines
535 B
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %target-swift-frontend -emit-module -module-name Foundation -o %t/Foundation.swiftmodule %S/Inputs/Foundation-with-NSError.swift
|
|
// RUN: %target-swift-frontend -I %t -typecheck -verify %s
|
|
// UNSUPPORTED: objc_interop
|
|
|
|
import Foundation
|
|
|
|
// Catching `as NSError` ought *not* to be exhaustive when ObjC interop is
|
|
// disabled. It's just another error type.
|
|
|
|
func bar() throws {}
|
|
|
|
func foo() {
|
|
do {
|
|
try bar() // expected-error{{enclosing catch is not exhaustive}}
|
|
} catch _ as NSError {
|
|
}
|
|
}
|