Skip to content

Commit cdf5c5c

Browse files
Add more tests
1 parent 1844578 commit cdf5c5c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

test/Constraints/optional.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,7 @@ func sr_12309() {
438438
_ = nil! // expected-error {{'nil' literal cannot be force unwrapped}}
439439
_ = (nil!) // expected-error {{'nil' literal cannot be force unwrapped}}
440440
_ = (nil)! // expected-error {{'nil' literal cannot be force unwrapped}}
441+
_ = ((nil))! // expected-error {{'nil' literal cannot be force unwrapped}}
441442
_ = nil? // expected-error {{value of optional type 'Optional<_>' must be unwrapped to a value of type '_'}}
442443
// expected-note@-1 {{coalesce using '??' to provide a default when the optional value contains 'nil'}}
443444
// expected-note@-2 {{force-unwrap using '!' to abort execution if the optional value contains 'nil'}}

0 commit comments

Comments
 (0)