mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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.
22 lines
499 B
Swift
22 lines
499 B
Swift
// RUN: %target-swift-frontend -target %target-swift-5.1-abi-triple -typecheck -verify %s
|
|
|
|
protocol Taggable {}
|
|
extension String: Taggable {}
|
|
|
|
@resultBuilder
|
|
struct TaggableBuilder {
|
|
static func buildBlock(_ params: Taggable...) -> String {
|
|
return "Your tags weren't worth keeping anyway"
|
|
}
|
|
}
|
|
|
|
@TaggableBuilder
|
|
func testFuncWithOpaqueResult() -> some Taggable {
|
|
"This is an amazing tag"
|
|
}
|
|
|
|
@TaggableBuilder
|
|
var testGetterWithOpaqueResult: some Taggable {
|
|
"This is also an amazing tag"
|
|
}
|