Skip to content

Commit 3ffbcfd

Browse files
Merge pull request #84886 from swiftlang/jepa-main2
[test] Add crasher for #84884
2 parents 808640d + 1ea58c4 commit 3ffbcfd

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// https://github.com/swiftlang/swift/issues/84884
2+
// RUN: not --crash %target-swift-frontend -typecheck %s
3+
4+
protocol Proto<Assoc> {
5+
associatedtype Assoc
6+
}
7+
8+
struct Generic<Assoc>: Proto {
9+
static func foo(_: Generic<Assoc>) -> Generic<Assoc> {}
10+
static func bar(_: some Proto<Assoc>) -> Generic<Assoc> {}
11+
}
12+
13+
struct S1 {}
14+
struct S2 {}
15+
16+
extension Proto {
17+
func overload() -> some Proto<S1> where Assoc == S1 {
18+
Generic()
19+
}
20+
func overload() -> some Proto<S1> where Assoc == Generic<Generic<S1>> {
21+
Generic()
22+
}
23+
}
24+
25+
struct Struct: Proto {
26+
typealias Assoc = Generic<Generic<S2>>
27+
init(_: Int) {}
28+
}
29+
30+
func test() {
31+
let _ = Generic.foo(Generic.bar(Struct(0).overload())
32+
}

0 commit comments

Comments
 (0)