🐞️ isSameType: Add a base case (#8)

* Core

- Added a TODO where we are meant to insert the fallback check in `isSameType(Type t1, Type t2)`

* TypeChecker

- Added backported `isSameType(Type 1, Type t2)` fix for #114
This commit is contained in:
Tristan B. Velloza Kildaire 2023-04-21 15:23:24 +02:00 committed by GitHub
parent fe8e1403f0
commit dad185f96f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -316,6 +316,9 @@ public final class TypeChecker
{
bool same = false;
// NOTE: We compare actual types, then check which type
// ... the order is important due to type hierachy
/* Handling for pointers */
if(typeid(type1) == typeid(type2) && cast(Pointer)type1 !is null)
{
@ -341,6 +344,11 @@ public final class TypeChecker
same = false;
}
}
/* Handling for all other cases */
else if(typeid(type1) == typeid(type2))
{
return true;
}
gprintln("isSameType("~to!(string)(type1)~","~to!(string)(type2)~"): "~to!(string)(same), DebugType.ERROR);
return same;