Function

precondition(_:_:file:line:)

Checks a necessary condition for making forward progress.

Source
fun precondition(
   _ condition: Bool,
   _ message: String,
   file: String,
   line: Int
)

Parameters

condition

The condition to test.

message

A description of the error to write to the standard error of a hosted environment before terminating the program if the precondition fails. The default is an empty string.

file

The file name to print with message if the precondition fails. The default is the file where this function is called.

line

The line number to print along with message if the precondition fails. The default is the line where this function is called.