hare

The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit b86c3b84705a830eb0dbf00928fe815a31725720
parent 737394608abf8c0a418b1c3725f9b05da8bef0f3
Author: Sebastian <sebastian@sebsite.pw>
Date:   Thu, 21 Apr 2022 15:52:16 -0400

hare::types: type assert instead of cast

Signed-off-by: Sebastian <sebastian@sebsite.pw>

Diffstat:
Mhare/types/class.ha | 9+++------
1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/hare/types/class.ha b/hare/types/class.ha @@ -6,8 +6,7 @@ export fn is_signed(ty: const *_type) bool = { match (ty.repr) { case let al: alias => - // TODO: al.secondary as *_type - return is_signed(al.secondary: const *_type); + return is_signed(al.secondary as const *_type); case let bi: builtin => switch (bi) { case builtin::F32, builtin::F64, builtin::I16, builtin::I32, @@ -33,8 +32,7 @@ export fn is_signed(ty: const *_type) bool = { export fn is_float(ty: const *_type) bool = { match (ty.repr) { case let al: alias => - // TODO: al.secondary as *_type - return is_float(al.secondary: const *_type); + return is_float(al.secondary as const *_type); case let bi: builtin => switch (bi) { case builtin::F32, builtin::F64 => @@ -51,8 +49,7 @@ export fn is_float(ty: const *_type) bool = { export fn is_integer(ty: const *_type) bool = { match (ty.repr) { case let al: alias => - // TODO: al.secondary as *_type - return is_integer(al.secondary: const *_type); + return is_integer(al.secondary as const *_type); case let bi: builtin => switch (bi) { case builtin::INT, builtin::UINT, builtin::I16,