Currently, we parse and create TypeDeclarationNodes whenever they are defined in the language, but we don't utilize these nodes yet. We need to implement a TypeChecker to validate types during compilation. The TypeChecker should ensure:
Variables are assigned values that match their declared types.
Functions return values that match their declared return types.
Function invocation arguments match the types specified in the function declaration.
Subtasks:
[x] Implement a basic TypeChecker class.
[x] Integrate TypeChecker into the compilation process.
[x] Implement type validation for variable assignments.
[x] Implement type validation for function return values.
[x] Implement type validation for function invocation arguments.
[x] Write unit tests for TypeChecker functionalities.
Currently, we parse and create
TypeDeclarationNode
s whenever they are defined in the language, but we don't utilize these nodes yet. We need to implement a TypeChecker to validate types during compilation. The TypeChecker should ensure:Subtasks: