Files
swift-mirror/test/Interpreter/moveonly_generics_opaque.swift
Allan Shortlidge 6f55aa4170 Tests: Remove -disable-availability-checking in tests that use opaque types.
Use the `%target-swift-5.1-abi-triple` substitution to compile the tests for
deployment to the minimum OS versions required for use of opaque types, instead
of disabling availability checking.
2024-10-19 19:39:18 -07:00

30 lines
772 B
Swift

// RUN: %target-run-simple-swift(-target %target-swift-5.1-abi-triple) | %FileCheck %s
// RUN: %target-run-simple-swift(-target %target-swift-5.1-abi-triple -O) | %FileCheck %s
// REQUIRES: executable_test
// UNSUPPORTED: use_os_stdlib
// UNSUPPORTED: back_deployment_runtime
protocol Marked {
func announce()
}
extension Marked {
func announce() { print("\(Self.self) is Marked") }
}
struct ConcreteWrapper<Wrapped> {}
extension ConcreteWrapper: Marked where Wrapped: Marked {}
struct Hello<T: ~Copyable> {}
extension Hello: Marked {}
func makeWrapper<P>(wrapping _: P.Type) -> some Marked {
ConcreteWrapper<Hello<P>>()
}
do {
let markedVal = makeWrapper(wrapping: String.self)
markedVal.announce() // CHECK: ConcreteWrapper<Hello<String>> is Marked
}