mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 23:04:08 +10:00
Null values are always allowed
This commit is contained in:
@@ -33,6 +33,11 @@ static bool checkType(Literal typeLiteral, Literal value) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//always allow null values
|
||||||
|
if (IS_NULL(value)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
//for each type, if a mismatch is found, return false
|
//for each type, if a mismatch is found, return false
|
||||||
if (AS_TYPE(typeLiteral).typeOf == LITERAL_BOOLEAN && !IS_BOOLEAN(value)) {
|
if (AS_TYPE(typeLiteral).typeOf == LITERAL_BOOLEAN && !IS_BOOLEAN(value)) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user