Standard library assertion functions still default to #file rather than #fileID even though SE-0285 is stated as implemented

swift-evolution/0285-ease-pound-file-transition.md at main · apple/swift-evolution · GitHub states the following:

Standard library assertion functions like assert , precondition , and fatalError will switch from #file to #fileID . When a filename is included in a compiler-generated trap, such as a force unwrap, it will also emit a literal equivalent to using #fileID .

But in Swift 5.6, and on the main branch, these functions still have a default argument of #file: swift/Assert.swift at main · apple/swift · GitHub

Is this an oversight or is it intentional - and instead this change will simply be realized with the change of behaviour of #file in a Swift 6 compiler mode?

1 Like

The standard library is using a compiler flag, to alias #file as #fileID.

I presume that standard library APIs can now be updated.
Or we could wait until Swift 6, as you suggested.