Errors¶
Keel aims to have pretty (thanks Ariadne!) and helpful error messages. Currently, some error messages are more helpful than others. This is a work in progress, and error messages will continue to improve over time.
struct Point {
x:float,
y:float,
z:float
}
fn main() {
let origin = Point {x: 0.0, y: 0.0, z: 0.0};
origin.x = 10;
}
-- OUTPUT --
Error: Incompatible types
╭─[ testing/error.kl:2:7 ]
│
2 │ x:float,
│ ───┬──
│ ╰──── Field x in struct Point expects type float
│
9 │ origin.x = 10;
│ ─┬
│ ╰── This expression is of type int
│
│ Help: Try using the float() function
───╯
List of catchable errors¶
Misc¶
division_by_zeromodulo_by_zeroindex_out_of_boundsslice_out_of_boundsunknown_map_keyinteger_negative_exponent(will be available with the release of Keel 0.5)
Runtime parsing¶
invalid_floatinvalid_intinvalid_bool
File system¶
fs_already_existsfs_deadlockfs_file_too_largefs_interruptedfs_invalid_datafs_invalid_filenamefs_is_a_directoryfs_not_a_directoryfs_not_foundfs_permission_deniedfs_out_of_memoryfs_read_only_filesystemfs_storage_fullfs_timed_outfs_other(will be available with the release of Keel 0.5)
FFI¶
null_byte_in_stringinvalid_return_type