feat: type checker without satisfies implemented

Co-Authored-By: jt2622
This commit is contained in:
2025-02-06 20:26:15 +00:00
parent 88ec08a023
commit 6548d895d5
4 changed files with 277 additions and 121 deletions

View File

@@ -1,14 +1,13 @@
package wacc
import wacc.ast.Expr
import wacc.ast.Position
import wacc.types._
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)
case FunctionParamsMismatch(expected: Int, got: Int) // TODO not fine
case TypeMismatch(pos: Position, expected: SemType, got: SemType, msg: String)
case InternalError(pos: Position, msg: String)
}