Why in Swift is this legal...
assert( false, "Unexpected diagnosis: \(diagnosis)" );
let assertString = "Unexpected diagnosis: \(diagnosis)"
assert( false, assertString );
Cannot invoke 'assert' with an argument list of type '(BooleanLiteralConvertible, String)
Second paramter of assert is declared as either
message: @autoclosure () -> Str or
_ message: StaticString. I guess
"Unexpected diagnosis: \(diagnosis)" is treated as expression and picked up by
assertString is simply a
String variable that cannot be converted to closure or
StaticString can be made only with:
static func convertFromExtendedGraphemeClusterLiteral(value: StaticString) -> StaticString static func convertFromStringLiteral(value: StaticString) -> StaticString
I guess this explains why swift manual has note that you cannot use string interpolation in
assert() as there is no support for