From 32c1bbc3f3d4e7752b6fbd93db10b7ff3248d70d Mon Sep 17 00:00:00 2001 From: Tristan Martinuson Date: Tue, 24 Jun 2025 21:13:11 +0000 Subject: [PATCH] Fix integer types to use go int primitives --- types/types.go | 14 +++++++++++--- v2/types/types.go | 14 +++++++++++--- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/types/types.go b/types/types.go index 77650255..2f95c2dc 100644 --- a/types/types.go +++ b/types/types.go @@ -456,6 +456,10 @@ var ( Name: Name{Name: "int16"}, Kind: Builtin, } + Int8 = &Type{ + Name: Name{Name: "int8"}, + Kind: Builtin, + } Int = &Type{ Name: Name{Name: "int"}, Kind: Builtin, @@ -472,6 +476,10 @@ var ( Name: Name{Name: "uint16"}, Kind: Builtin, } + Uint8 = &Type{ + Name: Name{Name: "uint8"}, + Kind: Builtin, + } Uint = &Type{ Name: Name{Name: "uint"}, Kind: Builtin, @@ -509,12 +517,12 @@ var ( "int64": Int64, "int32": Int32, "int16": Int16, - "int8": Byte, + "int8": Int8, "uint": Uint, "uint64": Uint64, "uint32": Uint32, "uint16": Uint16, - "uint8": Byte, + "uint8": Uint8, "uintptr": Uintptr, "byte": Byte, "float": Float, @@ -529,7 +537,7 @@ var ( func IsInteger(t *Type) bool { switch t { - case Int, Int64, Int32, Int16, Uint, Uint64, Uint32, Uint16, Byte: + case Int, Int64, Int32, Int16, Int8, Uint, Uint64, Uint32, Uint16, Uint8, Byte: return true default: return false diff --git a/v2/types/types.go b/v2/types/types.go index dab11d96..2102cf38 100644 --- a/v2/types/types.go +++ b/v2/types/types.go @@ -483,6 +483,10 @@ var ( Name: Name{Name: "int16"}, Kind: Builtin, } + Int8 = &Type{ + Name: Name{Name: "int8"}, + Kind: Builtin, + } Int = &Type{ Name: Name{Name: "int"}, Kind: Builtin, @@ -499,6 +503,10 @@ var ( Name: Name{Name: "uint16"}, Kind: Builtin, } + Uint8 = &Type{ + Name: Name{Name: "uint8"}, + Kind: Builtin, + } Uint = &Type{ Name: Name{Name: "uint"}, Kind: Builtin, @@ -537,12 +545,12 @@ var ( "int64": Int64, "int32": Int32, "int16": Int16, - "int8": Byte, + "int8": Int8, "uint": Uint, "uint64": Uint64, "uint32": Uint32, "uint16": Uint16, - "uint8": Byte, + "uint8": Uint8, "uintptr": Uintptr, "byte": Byte, "float": Float, @@ -567,7 +575,7 @@ func PointerTo(t *Type) *Type { func IsInteger(t *Type) bool { switch t { - case Int, Int64, Int32, Int16, Uint, Uint64, Uint32, Uint16, Byte: + case Int, Int64, Int32, Int16, Int8, Uint, Uint64, Uint32, Uint16, Uint8, Byte: return true default: return false