@@ -261,24 +261,32 @@ internal func _debugPrecondition(
261261 _ condition: @autoclosure ( ) -> Bool , _ message: StaticString = StaticString ( ) ,
262262 file: StaticString = #file, line: UInt = #line
263263) {
264+ #if SWIFT_STDLIB_ENABLE_DEBUG_PRECONDITIONS_IN_RELEASE
265+ _precondition ( condition ( ) , message, file: file, line: line)
266+ #else
264267 // Only check in debug mode.
265268 if _slowPath ( _isDebugAssertConfiguration ( ) ) {
266269 if !_fastPath( condition ( ) ) {
267270 _fatalErrorMessage ( " Fatal error " , message, file: file, line: line,
268271 flags: _fatalErrorFlags ( ) )
269272 }
270273 }
274+ #endif
271275}
272276
273277@usableFromInline @_transparent
274278internal func _debugPreconditionFailure(
275279 _ message: StaticString = StaticString ( ) ,
276280 file: StaticString = #file, line: UInt = #line
277281) -> Never {
282+ #if SWIFT_STDLIB_ENABLE_DEBUG_PRECONDITIONS_IN_RELEASE
283+ _preconditionFailure ( message, file: file, line: line)
284+ #else
278285 if _slowPath ( _isDebugAssertConfiguration ( ) ) {
279286 _precondition ( false , message, file: file, line: line)
280287 }
281288 _conditionallyUnreachable ( )
289+ #endif
282290}
283291
284292/// Internal checks.
0 commit comments