Skip to content

Commit

Permalink
TypeChecker
Browse files Browse the repository at this point in the history
- Disallow the operands of ANY binary operator expression to both be pointer types
  • Loading branch information
deavmi committed May 19, 2024
1 parent ebefcd5 commit 3a10a1a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions source/tlang/compiler/typecheck/core.d
Original file line number Diff line number Diff line change
Expand Up @@ -1821,10 +1821,16 @@ public final class TypeChecker
}
}
}
// If both left and right operands are pointers
else if(isPointerType(vLhsType) && isPointerType(vRhsType)) // <a> is Pointer, <b> is Pointer
{
expect("Both left hand side and right hand side cannot be pointers in any arithmetic operation");
}
else
{
// See issue #141: Binary Operators support for non-Integer types (https://deavmi.assigned.network/git/tlang/tlang/issues/141)
ERROR("FIXME: We need to add support for this, class equality, and others like floats");
assert(false);
}


Expand Down

0 comments on commit 3a10a1a

Please sign in to comment.