We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3ee8034 commit 321b741Copy full SHA for 321b741
validation-test/Sema/type_checker_crashers_fixed/issue59031.swift
@@ -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