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 5ff6fe2 commit 1844578Copy full SHA for 1844578
test/Constraints/optional.swift
@@ -436,6 +436,8 @@ func sr_12309() {
436
437
_ = S(foo: nil!) // expected-error {{'nil' literal cannot be force unwrapped}}
438
_ = nil! // expected-error {{'nil' literal cannot be force unwrapped}}
439
+ _ = (nil!) // expected-error {{'nil' literal cannot be force unwrapped}}
440
+ _ = (nil)! // expected-error {{'nil' literal cannot be force unwrapped}}
441
_ = nil? // expected-error {{value of optional type 'Optional<_>' must be unwrapped to a value of type '_'}}
442
// expected-note@-1 {{coalesce using '??' to provide a default when the optional value contains 'nil'}}
443
// expected-note@-2 {{force-unwrap using '!' to abort execution if the optional value contains 'nil'}}
0 commit comments