Skip to content

Commit cfea0d3

Browse files
committed
[TypeChecker] NFC: Add XFAIL'ed test-case for #67363
1 parent eae1466 commit cfea0d3

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

test/expr/closure/multi_statement.swift

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,3 +694,28 @@ func test_recursive_var_reference_in_multistatement_closure() {
694694
}
695695
}
696696
}
697+
698+
// https://github.com/apple/swift/issues/67363
699+
func test_result_builder_in_member_chaining() {
700+
@resultBuilder
701+
struct Builder {
702+
static func buildBlock<T>(_: T) -> Int { 42 }
703+
}
704+
705+
struct Test {
706+
static func test<T>(fn: () -> T) -> T {
707+
fn()
708+
}
709+
710+
func builder(@Builder _: () -> Int) {}
711+
}
712+
713+
Test.test {
714+
let test = Test()
715+
return test
716+
// FIXME: This call should type-check, currently closure is resolved before overload of `builder` is picked.
717+
}.builder { // expected-error {{cannot convert value of type '()' to closure result type 'Int'}}
718+
let result = ""
719+
result
720+
}
721+
}

0 commit comments

Comments
 (0)