1
1
// RUN: %empty-directory(%t)
2
- // RUN: %target-swift-frontend -typecheck -module-name FunctionBuilders -emit-module-interface-path %t/FunctionBuilders .swiftinterface %s
3
- // RUN: %FileCheck %s < %t/FunctionBuilders .swiftinterface
2
+ // RUN: %target-swift-frontend -typecheck -module-name ResultBuilders -emit-module-interface-path %t/ResultBuilders .swiftinterface %s
3
+ // RUN: %FileCheck %s < %t/ResultBuilders .swiftinterface
4
4
// RUN: %target-swift-frontend -I %t -typecheck -verify %S/Inputs/result_builders_client.swift
5
- // RUN: %target-swift-frontend -compile-module-from-interface %t/FunctionBuilders.swiftinterface -o %t/FunctionBuilders.swiftmodule
5
+ // RUN: %target-swift-frontend -compile-module-from-interface %t/ResultBuilders.swiftinterface -o %t/ResultBuilders.swiftmodule
6
+ // RUN: %FileCheck %s < %t/ResultBuilders.swiftinterface
6
7
8
+ // CHECK: @_functionBuilder public struct TupleBuilder
7
9
@resultBuilder
8
10
public struct TupleBuilder {
9
11
public static func buildBlock< T1, T2> ( _ t1: T1 , _ t2: T2 ) -> ( T1 , T2 ) {
@@ -38,7 +40,7 @@ public struct TupleBuilder {
38
40
public static func buildIf< T> ( _ value: T ? ) -> T ? { return value }
39
41
}
40
42
41
- // CHECK-LABEL: public func tuplify<T>(_ cond: Swift.Bool, @FunctionBuilders .TupleBuilder body: (Swift.Bool) -> T)
43
+ // CHECK-LABEL: public func tuplify<T>(_ cond: Swift.Bool, @ResultBuilders .TupleBuilder body: (Swift.Bool) -> T)
42
44
public func tuplify< T> ( _ cond: Bool , @TupleBuilder body: ( Bool ) -> T ) {
43
45
print ( body ( cond) )
44
46
}
@@ -52,13 +54,13 @@ public struct UsesBuilderProperty {
52
54
" goodbye "
53
55
}
54
56
55
- // CHECK: public func myFunc(@FunctionBuilders .TupleBuilder fn: () -> ())
57
+ // CHECK: public func myFunc(@ResultBuilders .TupleBuilder fn: () -> ())
56
58
public func myFunc( @TupleBuilder fn: ( ) -> ( ) ) { }
57
59
}
58
60
59
61
public protocol ProtocolWithBuilderProperty {
60
62
associatedtype Assoc
61
-
62
- // CHECK: @FunctionBuilders .TupleBuilder var myVar: Self.Assoc { get }
63
+
64
+ // CHECK: @ResultBuilders .TupleBuilder var myVar: Self.Assoc { get }
63
65
@TupleBuilder var myVar : Assoc { get }
64
66
}
0 commit comments