Files
swift-mirror/test/Constraints/result_builder_opaque_result.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

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"
}