Update the typeCheck of methods TypedAssignment

This commit is contained in:
ahmad 2024-05-11 13:53:21 +02:00
parent 9e45c65ea3
commit da4f962281

View File

@ -35,7 +35,12 @@ public class TypedAssignment implements TypedStatement {
if (!localVar.containsKey(varName)) { if (!localVar.containsKey(varName)) {
if(clas.isThereField(varName)){ if(clas.isThereField(varName)){
typeLeft = clas.getFieldType(varName); typeLeft = clas.getFieldType(varName);
}else { }else if(clas.isParameterWitNameInMethod(varName)) {
typeLeft = clas.getParameterTypeInCurrentMethod(varName);
}else if(clas.isParameterNameInCurrentConstructor(varName)) {
typeLeft = clas.getParameterTypeInCurrentConstructor(varName);
}
else{
throw new RuntimeException("Variable not declared"); throw new RuntimeException("Variable not declared");
} }
} else { } else {