Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐞️ Bugfix: Binary Operators support for non-Integer types #52

Open
wants to merge 6 commits into
base: vardec_varass_dependency
Choose a base branch
from

Conversation

deavmi
Copy link
Contributor

@deavmi deavmi commented May 19, 2024

Please see this.

- Disallow the operands of ANY binary operator expression to both be pointer types
- When transforming a `CastedValueInstructionA` ensure that we wrap the expression being-casted in `(<expr>)` (parenthesis) because otherwise C is unhappy and in cases, like binary operator expressions, it will cause the C compiler to attempt casting the left-hand operand not the resultant of the binary operator expression
- When doing an emit for `BinaryOperatorExpression`, ignore the case whereby ether left or right-hand side operand s a pointer type and ONLY when) the operatr is `SymbolType.EQUALS`
- Do allow `SymbolType.EQUALS` with two pointer operands
- Removed false assertion in exhaustive case
- If thebinary operator is `SymbolType.EQUALS` then set `chosenType` to `ubyte`
- Added `simple_binops_ptr_bad.t` and `simple_binbops_ptr.t`
- Added `simple_binops_ptr_bad.t` for the typechecking case
- Added `simple_binopts_ptr.t` for emit case
- Added `source/tlang/testing/typecheck/simple_binops_ptr_bad.t`
- Added `source/tlang/testing/simple_binops_ptr.t`
@deavmi deavmi self-assigned this May 19, 2024
@deavmi deavmi added the bug Something isn't working label May 19, 2024
@deavmi deavmi changed the title TypeChecker 🐞️ Bugfix: Binary Operators support for non-Integer types May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant