Avatar
@swift-5.1.5 -frontend -c -enable-experimental-static-assert func isOne(_ x: Int) -> Bool { return x == 1 } func test_assertionSuccess() { #assert(isOne(1)) #assert(isOne(1), "1 is not 1") } func test_assertionFailure() { #assert(isOne(2)) // expected-error{{assertion failed}} #assert(isOne(2), "2 is not 1") // expected-error{{2 is not 1}} }