aboutsummaryrefslogtreecommitdiff
path: root/src/type
AgeCommit message (Collapse)Author
2025-08-04Added repl and some documentation. Improved error messages. Removed dead code.Joel Kronqvist
* Removed same_variant in parse::parsetree * Added SExp::multistep (for use of the repl) Improved error messages: * Added parenthesis around types * Changed how errors propagate inferring generics: added the error variant ArgumentsDontMatchGeneric, implemented the displaying of it, added tests for it. * Had to change some tests to match for the new changes
2025-08-04Implemented infer_type. Changed is_concrete tests and implemented it.Joel Kronqvist
Error messages still need improvement, maybe some new variants? is_concrete was changed to hold information on the first unbound variable through Result<(), String>.
2025-08-04Implemented generic substitution (tested) for use in inferring generics.Joel Kronqvist
2025-08-03Changed UndefinedType to VarType(String) for generics and added tests for ↵Joel Kronqvist
inferring them. Inferring is done by method Type::infer_generics. Whether it is executed is controlled by method Type::is_concrete. Also had to change the Display for Type and its tests, as the enum variants changed.
2025-08-03Implemented type_check, added method parts for SExpJoel Kronqvist
'parts' is different from 'into_vec', because it doesn't require flat structure and always succeeds
2025-08-02Added tests for type_check. Implemented std::fmt::Display for many enums. ↵Joel Kronqvist
Added type variants List(Type), and UndefinedType for use in error messages. Implemented type utility arr(a, b).
2025-08-01Added boilerplate for Type, TypeError and type_checkJoel Kronqvist
(small commit, had to sync between desktop and laptop)