@@ -302,14 +302,21 @@ func _diagnoseUnexpectedNilOptional(_filenameStart: Builtin.RawPointer,
302302 _isImplicitUnwrap: Builtin . Int1 ) {
303303 // Cannot use _preconditionFailure as the file and line info would not be
304304 // printed.
305- preconditionFailure (
306- Bool ( _isImplicitUnwrap)
307- ? " Unexpectedly found nil while implicitly unwrapping an Optional value "
308- : " Unexpectedly found nil while unwrapping an Optional value " ,
309- file: StaticString ( _start: _filenameStart,
310- utf8CodeUnitCount: _filenameLength,
311- isASCII: _filenameIsASCII) ,
312- line: UInt ( _line) )
305+ if Bool ( _isImplicitUnwrap) {
306+ _preconditionFailure (
307+ " Unexpectedly found nil while implicitly unwrapping an Optional value " ,
308+ file: StaticString ( _start: _filenameStart,
309+ utf8CodeUnitCount: _filenameLength,
310+ isASCII: _filenameIsASCII) ,
311+ line: UInt ( _line) )
312+ } else {
313+ _preconditionFailure (
314+ " Unexpectedly found nil while unwrapping an Optional value " ,
315+ file: StaticString ( _start: _filenameStart,
316+ utf8CodeUnitCount: _filenameLength,
317+ isASCII: _filenameIsASCII) ,
318+ line: UInt ( _line) )
319+ }
313320}
314321
315322extension Optional : Equatable where Wrapped : Equatable {
0 commit comments