Skip to content

Commit a6fec42

Browse files
committed
[TypeChecker] NFC: Add a test-case for rdar://problem/50869732
(cherry picked from commit 4fdc9ff)
1 parent 123eeff commit a6fec42

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// RUN: %target-typecheck-verify-swift
2+
3+
protocol P {
4+
associatedtype T : P
5+
}
6+
7+
struct Generic<T> {
8+
init(_ value: T) {}
9+
}
10+
11+
@_functionBuilder
12+
struct Builder {
13+
static func buildBlock<C0, C1>(_ c0: C0, _ c1: C1)
14+
-> Generic<(C0, C1)> where C0 : P, C1 : P {
15+
return Generic((c0, c1))
16+
}
17+
}
18+
19+
struct G<C> {
20+
init(@Builder _: () -> C) {}
21+
}
22+
23+
struct Empty {
24+
init() {}
25+
}
26+
27+
struct Test<T> where T : P {
28+
init(@Builder _: () -> T) {}
29+
}
30+
31+
let x = G {
32+
Empty()
33+
Test { <#code#> } // expected-error {{editor placeholder in source file}}
34+
}

0 commit comments

Comments
 (0)