mirror of
https://github.com/JonathanFleischmann/CompilerULTIMATE.git
synced 2024-12-28 16:28:04 +00:00
Update the typeCheck of methods TypedAssignment
This commit is contained in:
parent
9e45c65ea3
commit
da4f962281
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user