mirror of
https://github.com/JonathanFleischmann/CompilerULTIMATE.git
synced 2024-12-28 17:08:03 +00:00
Update the typeCheck of TypedBlock
This commit is contained in:
parent
3b1161e97a
commit
2322d161e6
@ -98,18 +98,24 @@ public class TypedBlock implements TypedNode {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.typeCheck(clas);
|
this.typeCheck(clas);
|
||||||
|
System.out.println("TypedBlock: " + this.toString());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Type typeCheck(TypedClass clas) {
|
public Type typeCheck(TypedClass clas) {
|
||||||
|
Type chekType = null;
|
||||||
for (TypedStatement stmt : stmts) {
|
for (TypedStatement stmt : stmts) {
|
||||||
stmt.typeCheck(clas);
|
stmt.typeCheck(clas);
|
||||||
|
if(stmt instanceof TypedReturn returnStmt) {
|
||||||
|
chekType = returnStmt.getType();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: Type von Return zurückgeben
|
if(chekType == null) {
|
||||||
type = Type.VOID;
|
chekType = Type.VOID;
|
||||||
|
}
|
||||||
|
type = chekType;
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user