Implements a typing system #4

Closed
jbwdevries wants to merge 0 commits from type3 into master
Owner

Prior to this MR, the type checking would be done during parsing, and was
very weak.

This MR implements a proper constraint generator and checker after parsing.

Also, this MR re-orderd and extends the tests.

Prior to this MR, the type checking would be done during parsing, and was very weak. This MR implements a proper constraint generator and checker after parsing. Also, this MR re-orderd and extends the tests.
jbwdevries added 47 commits 2022-12-26 12:21:57 +00:00
This breaks test_addition[u32], which is a good thing to chase next.
bytes, static array, tuple and struct.
They are now better organized and easier to extend, I hope.
Removed the separate ModuleConstantRef since you can tell by the variable
property of VariableReference. We'll also add local variables there later
on.
Also naming fix, buildin => builtin.

Removes the use of ConstantStaticArray, as this was context dependent
Also, fix issue with f64 being parsed as f32
Division by zero is a trap on most runtimes, following
the Let it Crash philosophy
- Tuple wasn't an applied type yet
- phasm_type3 would re-order type IDs between prints
- AppliedType3 wouldn't store the args for iterators
-
- Removed unused _str types
- Tested with untyped function arguments, seems to work a bit
- Moved the three ConstraintBase functions into one, as it was
  giving trouble calculating everything
- Gave each constraint the option to have a comment
- SameTypeConstraint now can have multiple arguments
- Redid the infinite loop detection
- Implemented some more basic operators
- Redid the division by zero for floats, it wasn't giving the
  right results.
- Also postponed the updating the AST type3 until afterwards
- Various linting fixes
Re-implementing some things that were broken.

Also, if a typing error is found, and we detect an
infinite loop, we return the errors instead, as that's
probably what causing the loop anyhow.
What could possibly go wrong.

All struct tests seem to pass.
Probably not 100% type checked yet.

Also, fixed logical right shift; standard says the type
is different.
jbwdevries added 1 commit 2022-12-26 12:35:32 +00:00
jbwdevries added 1 commit 2022-12-31 13:40:55 +00:00
jbwdevries added 1 commit 2022-12-31 13:52:24 +00:00
jbwdevries added 2 commits 2023-01-01 14:02:53 +00:00
Also, some fixes of things that were broken on structs
due to the tuple changes
jbwdevries added 1 commit 2023-01-01 15:00:25 +00:00
Typing is getting ugly again
jbwdevries force-pushed type3 from 6231c6b279 to da6e306fad 2023-01-01 15:05:01 +00:00 Compare
jbwdevries added 1 commit 2023-01-06 14:59:32 +00:00
jbwdevries added 1 commit 2023-01-07 15:20:45 +00:00
jbwdevries force-pushed type3 from 14b8065974 to 205897101f 2023-01-07 15:30:11 +00:00 Compare
Author
Owner

Merged via CLI

Merged via CLI
jbwdevries closed this pull request 2023-01-07 15:31:34 +00:00
jbwdevries deleted branch type3 2023-01-07 15:31:37 +00:00

Pull request closed

Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jbwdevries/phasm#4
No description provided.