Skip to content

Commit 4dbb06c

Browse files
committed
[TypeChecker] Add a test-case for issue#59031 (crash in ConjunctionStep::resume)
1 parent 3ee8034 commit 4dbb06c

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// RUN: not %target-swift-frontend %s -typecheck
2+
3+
struct Data {
4+
// Type `Q` not declared yet.
5+
typealias ReturnType = Q
6+
7+
mutating func withContiguousMutableStorageIfAvailable<R>(
8+
_ body: () -> R
9+
// If you put "R" instead of "ReturnType", it doesn't crash.
10+
) -> ReturnType {
11+
fatalError()
12+
}
13+
}
14+
15+
func withUnsafeMutableBufferPointer<R>() -> R {
16+
var data = Data()
17+
return data.withContiguousMutableStorageIfAvailable {
18+
_ = Int.init
19+
return 2 as Any as R
20+
}
21+
}

0 commit comments

Comments
 (0)