mirror of
https://github.com/zaphar/ucg.git
synced 2025-07-22 18:19:54 -04:00
FIX: NULL equality should be useable with any type.
This commit is contained in:
parent
98323eabbd
commit
599ed31414
@ -169,3 +169,13 @@ assert {
|
|||||||
ok = "foo" !~ "bar",
|
ok = "foo" !~ "bar",
|
||||||
desc = "\"foo\" !~ \"bar\"",
|
desc = "\"foo\" !~ \"bar\"",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
assert {
|
||||||
|
ok = NULL != 1,
|
||||||
|
desc = "Integers are comparable to null",
|
||||||
|
};
|
||||||
|
|
||||||
|
assert {
|
||||||
|
ok = NULL != "string",
|
||||||
|
desc = "Strings are comparable to null",
|
||||||
|
};
|
@ -109,6 +109,9 @@ impl Val {
|
|||||||
error::ErrorType::TypeFail,
|
error::ErrorType::TypeFail,
|
||||||
pos,
|
pos,
|
||||||
)),
|
)),
|
||||||
|
// EMPTY is always comparable for equality.
|
||||||
|
(&Val::Empty, _) => Ok(false),
|
||||||
|
(_, &Val::Empty) => Ok(false),
|
||||||
(me, tgt) => Err(error::BuildError::new(
|
(me, tgt) => Err(error::BuildError::new(
|
||||||
format!("Types differ for {}, {}", me, tgt),
|
format!("Types differ for {}, {}", me, tgt),
|
||||||
error::ErrorType::TypeFail,
|
error::ErrorType::TypeFail,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user