feat: basic type checker skeleton

This commit is contained in:
Jonny
2025-02-06 17:07:55 +00:00
committed by Gleb Koval
parent 2fb520d891
commit 88ec08a023
2 changed files with 79 additions and 0 deletions

View File

@@ -1,8 +1,14 @@
package wacc
import wacc.ast.Expr
enum Error {
case DuplicateDeclaration(ident: ast.Ident)
case UndefinedIdentifier(ident: ast.Ident, identType: renamer.IdentType)
case FunctionParamsMismatch(expected: Int, got: Int)
case TypeMismatch(expected: types.SemType, got: types.SemType)
case InvalidArrayAccess(ty: types.SemType)
case InvalidPairAccess(ty: types.SemType)
case ReturnTypeMismatch(expected: types.SemType, got: types.SemType)
case NonBooleanCondition(expr: Expr)
}