mirror of
https://github.com/apple/swift.git
synced 2026-02-27 18:26:24 +01:00
Before: ``` Total Discovered Tests: 255 Unsupported : 100 (39.22%) Passed : 154 (60.39%) Expectedly Failed: 1 (0.39%) ``` After: ``` Total Discovered Tests: 255 Unsupported : 41 (16.08%) Passed : 210 (82.35%) Expectedly Failed: 4 (1.57%) ``` Work in progress on https://github.com/swiftlang/swift/issues/83482. rdar://157304207
36 lines
891 B
Swift
36 lines
891 B
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %{python} %utils/split_file.py -o %t %s
|
|
|
|
// RUN: %target-swift-frontend -emit-module -o %t/MyModule.swiftmodule %t/MyModule.swift -enable-experimental-feature Embedded -parse-as-library
|
|
// RUN: %target-swift-frontend -c -I %t %t/Main.swift -enable-experimental-feature Embedded -verify -verify-ignore-unrelated -o /dev/null
|
|
|
|
// REQUIRES: OS=macosx || OS=linux-gnu || OS=wasip1
|
|
// REQUIRES: swift_feature_Embedded
|
|
|
|
// BEGIN MyModule.swift
|
|
|
|
public struct MyError: Error {
|
|
}
|
|
|
|
@inline(never)
|
|
public func foo<T>(_ t: T) throws {
|
|
throw MyError() // expected-error {{cannot use a value of protocol type 'any Error' in embedded Swift}}
|
|
}
|
|
|
|
@inline(never)
|
|
public func callit<T>(_ t: T) {
|
|
do {
|
|
try foo(t)
|
|
} catch {
|
|
}
|
|
}
|
|
|
|
// BEGIN Main.swift
|
|
|
|
import MyModule
|
|
|
|
public func testit() {
|
|
callit(27) // expected-note {{generic specialization called here}}
|
|
}
|
|
|