mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
22 lines
496 B
Swift
22 lines
496 B
Swift
// RUN: %target-swift-frontend -disable-availability-checking -typecheck -verify %s
|
|
|
|
protocol Taggable {}
|
|
extension String: Taggable {}
|
|
|
|
@_functionBuilder
|
|
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"
|
|
}
|