mirror of
https://github.com/zaphar/ucg.git
synced 2025-07-21 18:10:42 -04:00
FIX: NULL equality should be useable with any type.
This commit is contained in:
parent
98323eabbd
commit
599ed31414
@ -168,4 +168,14 @@ assert {
|
||||
assert {
|
||||
ok = "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,
|
||||
pos,
|
||||
)),
|
||||
// EMPTY is always comparable for equality.
|
||||
(&Val::Empty, _) => Ok(false),
|
||||
(_, &Val::Empty) => Ok(false),
|
||||
(me, tgt) => Err(error::BuildError::new(
|
||||
format!("Types differ for {}, {}", me, tgt),
|
||||
error::ErrorType::TypeFail,
|
||||
|
Loading…
x
Reference in New Issue
Block a user