1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

ast: fix TypeSymbol.is_primitive, add TypeSymbol.is_bool (#17106)

This commit is contained in:
walking devel 2023-01-25 06:38:59 +00:00 committed by GitHub
parent 0874376db0
commit b34c55ffd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -854,9 +854,14 @@ pub fn (t &TypeSymbol) is_number() bool {
return t.is_int() || t.is_float()
}
[inline]
pub fn (t &TypeSymbol) is_bool() bool {
return t.kind == .bool
}
[inline]
pub fn (t &TypeSymbol) is_primitive() bool {
return t.is_number() || t.is_pointer() || t.is_string()
return t.is_number() || t.is_pointer() || t.is_string() || t.is_bool()
}
[inline]