diff --git a/source/tlang/compiler/typecheck/core.d b/source/tlang/compiler/typecheck/core.d index 4519ac48..0dd78120 100644 --- a/source/tlang/compiler/typecheck/core.d +++ b/source/tlang/compiler/typecheck/core.d @@ -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;