Implemented boolean literals

This commit is contained in:
2025-02-26 14:33:41 +01:00
parent 91f34bc88f
commit 5f46a6f14e
11 changed files with 69 additions and 13 deletions

View File

@ -4,6 +4,7 @@ var (
Any = &Base{name: "any", size: 0}
AnyArray = &Array{Of: Any}
AnyPointer = &Pointer{To: Any}
Bool = &Base{name: "bool", size: 1}
Int64 = &Base{name: "int64", size: 8}
Int32 = &Base{name: "int32", size: 4}
Int16 = &Base{name: "int16", size: 2}
@ -14,7 +15,6 @@ var (
)
var (
Bool = Int
Byte = UInt8
Int = Int64
Float = Float64

View File

@ -25,8 +25,12 @@ func Is(a Type, b Type) bool {
return true
}
// Temporary hack for implicit casts
if a.Size() > b.Size() {
// Temporary hacks
if a == Int32 && b == Int64 {
return true
}
if a == Int64 && b == Int32 {
return true
}