Commit 8d89149
committed
feat: complete type checker and multi-paradigm type system
- Phase 0: Convert debug eprintln! to log::trace! across ssa.rs,
lowering.rs, cranelift_backend.rs (209 lines noise → 4 lines)
- Phase 1: Implement 15 unimplemented expression type checks (Array,
Tuple, Struct, Lambda, Match, If, Cast, Try, Reference, Dereference,
Range, Block, ListComprehension, Slice, Await)
- Phase 2: Replace pattern checking stub with comprehensive validation
for all pattern variants (Wildcard, Identifier, Literal, Tuple,
Struct, Enum, Array, Or, Guard, Rest, Reference, Box)
- Phase 3: Add generic type parameter substitution in TypeRegistry
and wire into field access and method return types
- Phase 4: Implement trait method resolution with 3-stage lookup
(inherent → trait defs → impl methods), trait bound verification,
and optional parameter arity with varargs support
- Phase 5: Wire multi-paradigm checkers into main TypeChecker with
paradigm fields, lazy-loaded sub-checkers, structural compatibility,
linear type pass; fix todo!() panics in multi_paradigm_checker;
complete nominal subtype checking with variance and widening
- Phase 6: Eliminate all 17 todo!() panics in constraint_solver for
Type::Interface, Type::Struct, Type::Trait handling in substitution,
formatting, associated type resolution, and self-type substitution;
add TypeKind member resolution for Atomic, Class, Function, Array1 parent 6460ce8 commit 8d89149
9 files changed
Lines changed: 1619 additions & 334 deletions
File tree
- crates
- compiler/src
- typed_ast/src
- zynml/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
371 | 371 | | |
372 | 372 | | |
373 | 373 | | |
374 | | - | |
| 374 | + | |
375 | 375 | | |
376 | 376 | | |
377 | 377 | | |
| |||
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
| 399 | + | |
403 | 400 | | |
404 | 401 | | |
405 | 402 | | |
| |||
732 | 729 | | |
733 | 730 | | |
734 | 731 | | |
735 | | - | |
| 732 | + | |
736 | 733 | | |
737 | 734 | | |
738 | 735 | | |
739 | | - | |
740 | | - | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
741 | 740 | | |
742 | 741 | | |
743 | 742 | | |
744 | 743 | | |
745 | 744 | | |
746 | | - | |
747 | | - | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
748 | 749 | | |
749 | 750 | | |
750 | 751 | | |
| |||
1149 | 1150 | | |
1150 | 1151 | | |
1151 | 1152 | | |
1152 | | - | |
| 1153 | + | |
1153 | 1154 | | |
1154 | | - | |
| 1155 | + | |
| 1156 | + | |
1155 | 1157 | | |
1156 | 1158 | | |
1157 | 1159 | | |
| |||
2361 | 2363 | | |
2362 | 2364 | | |
2363 | 2365 | | |
2364 | | - | |
| 2366 | + | |
2365 | 2367 | | |
2366 | 2368 | | |
2367 | 2369 | | |
| |||
3782 | 3784 | | |
3783 | 3785 | | |
3784 | 3786 | | |
3785 | | - | |
| 3787 | + | |
3786 | 3788 | | |
3787 | 3789 | | |
3788 | 3790 | | |
| |||
4093 | 4095 | | |
4094 | 4096 | | |
4095 | 4097 | | |
4096 | | - | |
4097 | | - | |
4098 | | - | |
| 4098 | + | |
| 4099 | + | |
| 4100 | + | |
4099 | 4101 | | |
4100 | | - | |
4101 | | - | |
4102 | 4102 | | |
4103 | 4103 | | |
4104 | 4104 | | |
| |||
5950 | 5950 | | |
5951 | 5951 | | |
5952 | 5952 | | |
5953 | | - | |
| 5953 | + | |
5954 | 5954 | | |
5955 | | - | |
| 5955 | + | |
| 5956 | + | |
| 5957 | + | |
5956 | 5958 | | |
5957 | 5959 | | |
5958 | 5960 | | |
5959 | 5961 | | |
5960 | 5962 | | |
5961 | 5963 | | |
5962 | 5964 | | |
5963 | | - | |
| 5965 | + | |
5964 | 5966 | | |
5965 | 5967 | | |
5966 | 5968 | | |
5967 | 5969 | | |
5968 | 5970 | | |
5969 | 5971 | | |
5970 | 5972 | | |
5971 | | - | |
5972 | | - | |
5973 | | - | |
5974 | | - | |
5975 | | - | |
5976 | | - | |
5977 | | - | |
5978 | | - | |
5979 | | - | |
| 5973 | + | |
5980 | 5974 | | |
5981 | 5975 | | |
5982 | 5976 | | |
| |||
0 commit comments