Replace assertions with proper error handling on errors #97

Open
opened 2023-01-29 13:41:52 +00:00 by deavmi · 3 comments
Owner

What is this?

When typechecking we sometimes do:

gprintln("Types do not match", DebugInfo.ERROR);
assert(false);

However, that should throw a typechecker error rather and not an assertion which is for debugging purposes and would not be compiled in a release build anyways.

Todo list

  • Typechecker (compiler/typecheck/core.d
    • Removing all non-testing assert()s and replacing them with some kind-of TypecheckException
## What is this? When typechecking we sometimes do: ```d gprintln("Types do not match", DebugInfo.ERROR); assert(false); ``` However, that should throw a typechecker error rather and not an assertion which is for debugging purposes and would not be compiled in a release build anyways. ## Todo list - [ ] Typechecker (`compiler/typecheck/core.d` * Removing all non-testing `assert()`s and replacing them with some kind-of `TypecheckException`
deavmi added the
typing
qol
labels 2023-01-29 13:42:00 +00:00
deavmi self-assigned this 2023-01-29 13:42:04 +00:00
deavmi added this to the Dependency tree, type-checking and codegen project 2023-01-29 13:42:11 +00:00
deavmi added this to the Basics milestone 2023-01-29 13:42:14 +00:00
deavmi added reference literal_encodings 2023-02-04 12:17:42 +00:00
Author
Owner

I have started work on this on the literal_encodings branch - starting with typechecking

I have started work on this on the `literal_encodings` branch - starting with typechecking
Author
Owner

A lot of this has been done on the type check branch but still more to be done

A lot of this has been done on the type check branch but still more to be done
deavmi added the due date 2023-02-12 2023-02-11 09:49:22 +00:00
Author
Owner

I have added some more replacements to the assert(false)s with TypeCheckerExceptions now.

I have added some more replacements to the `assert(false)`s with `TypeCheckerException`s now.
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

2023-02-12

Dependencies

No dependencies set.

Reference: tlang/tlang#97
No description provided.