Make comparison of non-serialisable types illegal.

Fixes #940.
This commit is contained in:
KtorZ
2024-05-14 10:45:15 +02:00
parent ff0407a245
commit 26ef25ba8d
3 changed files with 38 additions and 1 deletions

View File

@@ -185,6 +185,24 @@ fn illegal_inhabitants_nested() {
))
}
#[test]
fn illegal_function_comparison() {
let source_code = r#"
fn not(x: Bool) -> Bool {
todo
}
fn foo() -> Bool {
not == not
}
"#;
assert!(matches!(
dbg!(check_validator(parse(source_code))),
Err((_, Error::IllegalComparison { .. }))
))
}
#[test]
fn illegal_inhabitants_returned() {
let source_code = r#"