You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Function builders] Add stubs for missing buildBlock and buildLimitedAvailability
The lack of these functions in a function builder is diagnosed in
different places in the type checker. Extend these diagnostics to
provide stubs in the function builder.
Thanks to Suyash for the suggestion!
Copy file name to clipboardexpand all lines: test/Constraints/function_builder_availability.swift
+1-1
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ enum Either<T,U> {
8
8
}
9
9
10
10
@_functionBuilder
11
-
structTupleBuilder{
11
+
structTupleBuilder{ // expected-note{{add 'buildLimitedAvailability(_:)' to the function builder 'TupleBuilder' to erase type information for less-available types}}{{22-22=\n static func buildLimitedAvailability(_ component: <#Component#>) -> <#Component#> {\n <#code#>\n \}}}
Copy file name to clipboardexpand all lines: test/decl/var/function_builders.swift
+1-1
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ var globalBuilder: Int
7
7
func globalBuilderFunction()->Int{return0}
8
8
9
9
@_functionBuilder
10
-
structMaker{} // expected-error {{function builder must provide at least one static 'buildBlock' method}}
10
+
structMaker{} // expected-error {{function builder must provide at least one static 'buildBlock' method}}{{15-15=\n static func buildBlock(_ components: <#Component#>...) -> <#Component#> {\n <#code#>\n \}}}
11
11
12
12
@_functionBuilder
13
13
classInventor{} // expected-error {{function builder must provide at least one static 'buildBlock' method}}
0 commit comments