Skip to content

Commit 0c05f63

Browse files
committed
Update test cherry-picked from master
1 parent 9316191 commit 0c05f63

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

test/Constraints/function_builder_diags.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ struct TupleP<U> : P {
144144

145145
@_functionBuilder
146146
struct Builder {
147-
static func buildBlock<S0, S1>(_ stmt1: S0, _ stmt2: S1) // expected-note {{where 'S1' = 'Label<Any>.Type'}}
147+
static func buildBlock<S0, S1>(_ stmt1: S0, _ stmt2: S1)
148148
-> TupleP<(S0, S1)> where S0: P, S1: P {
149149
return TupleP((stmt1, stmt2))
150150
}
@@ -166,7 +166,7 @@ struct Label<L> : P where L : P { // expected-note {{'L' declared as parameter t
166166
}
167167

168168
func test_51167632() -> some P {
169-
AnyP(G { // expected-error {{static method 'buildBlock' requires that 'Label<Any>.Type' conform to 'P'}}
169+
AnyP(G {
170170
Text("hello")
171171
Label // expected-error {{generic parameter 'L' could not be inferred}}
172172
// expected-note@-1 {{explicitly specify the generic arguments to fix this issue}} {{10-10=<<#L: P#>>}}

test/decl/var/function_builders.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,18 @@ var globalWithEmptyImplicitGetter: Int {}
2727
// FIXME: extra diagnostics
2828
@Maker
2929
var globalWithEmptyExplicitGetter: Int { get {} } // expected-error{{type 'Maker' has no member 'buildBlock'}}
30-
// expected-error@-1 {{cannot convert return expression of type 'Any' to return type 'Int'}}
3130

3231
@Maker
3332
var globalWithSingleGetter: Int { 0 } // expected-error {{ype 'Maker' has no member 'buildBlock'}}
34-
// expected-error@-1 {{cannot convert return expression of type 'Any' to return type 'Int'}}
3533

3634
@Maker
3735
var globalWithMultiGetter: Int { 0; 0 } // expected-error {{ype 'Maker' has no member 'buildBlock'}}
38-
// expected-error@-1 {{cannot convert return expression of type 'Any' to return type 'Int'}}
3936

4037
@Maker
4138
func globalFunction() {} // expected-error {{ype 'Maker' has no member 'buildBlock'}}
42-
// expected-error@-1 {{unexpected non-void return value in void function}}
4339

4440
@Maker
4541
func globalFunctionWithFunctionParam(fn: () -> ()) {} // expected-error {{ype 'Maker' has no member 'buildBlock'}}
46-
// expected-error@-1 {{unexpected non-void return value in void function}}
4742

4843
func makerParam(@Maker
4944
fn: () -> ()) {}

0 commit comments

Comments
 (0)