Type Error Change
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run

This commit is contained in:
i22035 2024-07-04 20:36:36 +02:00
parent 1de6add080
commit 6fa57cf319
2 changed files with 4 additions and 0 deletions

View File

@ -567,6 +567,10 @@ public class SemanticAnalyzer implements SemanticVisitor {
var type = currentFields.get(unary.identifier); var type = currentFields.get(unary.identifier);
unary.setType(type); unary.setType(type);
return new TypeCheckResult(valid,type ); return new TypeCheckResult(valid,type );
} else if (unary.value != null) {
var result = unary.value.accept(this);
unary.setType(result.getType());
return new TypeCheckResult(result.isValid(), result.getType());
} else if (unary.statement != null) { } else if (unary.statement != null) {
var result = unary.statement.accept(this); var result = unary.statement.accept(this);
unary.setType(result.getType()); unary.setType(result.getType());