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.
2 parents c14d868 + b92f09f commit aec582bCopy full SHA for aec582b
test/SourceKit/CursorInfo/result_test.swift
@@ -0,0 +1,24 @@
1
+// Checks that SourceKit does not crash for enum patterns in generics.
2
+// RUN: %sourcekitd-test -req cursor -pos 18:15 %s -- %s | FileCheck %s
3
+// CHECK: source.lang.swift.ref.enumelement (12:10-12:17)
4
+
5
+public protocol MyErrorType {
6
+}
7
8
+enum MyErrorEnum: MyErrorType {
9
10
11
+public enum ResultTest<Value, Error: MyErrorType> {
12
+ case Success(Value)
13
+ case Failure(Error)
14
15
+ /// Returns `true` if the result is a success, `false` otherwise.
16
+ public var isSuccess: Bool {
17
+ switch self {
18
+ case .Success:
19
+ return true
20
+ case .Failure:
21
+ return false
22
+ }
23
24
0 commit comments