Skip to content

Commit cba7029

Browse files
[NFC] Correcting test case for SR-11535 and adding a explanation comment
1 parent 65db86b commit cba7029

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/decl/enum/enumtest.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,10 @@ let _: GenericEnumWithStaticNone<Int>? = .none // expected-warning {{assuming yo
510510
// expected-note@-1 {{explicitly specify 'Optional' to silence this warning}}{{42-42=Optional}}
511511
// expected-note@-2 {{use 'GenericEnumWithStaticNone<Int>.none' instead}}{{42-42=GenericEnumWithStaticNone<Int>}}
512512
let _: GenericEnumWithStaticNone<String>? = .none // Okay
513-
let _: GenericEnumWithStaticNone? = .none // FIXME(SR-11535): This should be diagnosed
513+
514+
let _: GenericEnumWithStaticNone? = .none // Okay
515+
// Base can only be inferred as static member `none` since `Optional.none` overload does not
516+
// provide a valid solution because the struct's generic argument `T` cannot be infered in this context.
514517

515518
enum GenericEnumWithoutNone<T> {
516519
case a

0 commit comments

Comments
 (0)