By default, Swift assertions are much more informative than C++ assertions:
// (1) C++: we get a non-interpolatable assertion message, by default. assert(type->isEqual(otherType) && "Types are not equal")
// (2) Swift: we can interpolate anything easily into the assertion message. precondition(type == otherType, "Types \(type) and \(otherType) are not equal")
Can we add something like (2) as a utility/mini-library within the Swift compiler implementation?
I think refactoring to a mini-library would be great. I've wanted to use informative assertions basically any time I hack on the compiler. Designing performant informative assertions and measuring their performance would be interesting.