mirror of
https://github.com/JonathanFleischmann/CompilerULTIMATE.git
synced 2024-12-27 08:58:02 +00:00
update typeCheck of TypedFieldVarAccess
This commit is contained in:
parent
aaa8a27ff9
commit
7979aece64
@ -52,6 +52,9 @@ public class TypedFieldVarAccess implements TypedExpression {
|
||||
} else if(typedProgram.getCurrentClass().isThereField(name)){
|
||||
type = typedProgram.getCurrentClass().getFieldType(name);
|
||||
return type;
|
||||
} else if(recursiveOwnerChain instanceof TypedFieldVarAccess typedFieldVarAccess){
|
||||
type = typedProgram.getCurrentClass().getFieldType(typedFieldVarAccess.getName());
|
||||
return type;
|
||||
}
|
||||
else {
|
||||
throw new RuntimeException("Variable " + name + " not declared in constructor");
|
||||
@ -67,6 +70,9 @@ public class TypedFieldVarAccess implements TypedExpression {
|
||||
} else if(typedProgram.getCurrentClass().isThereField(name)){
|
||||
type = typedProgram.getCurrentClass().getFieldType(name);
|
||||
return type;
|
||||
} else if(recursiveOwnerChain instanceof TypedFieldVarAccess typedFieldVarAccess){
|
||||
type = typedProgram.getCurrentClass().getFieldType(typedFieldVarAccess.getName());
|
||||
return type;
|
||||
}
|
||||
else {
|
||||
throw new RuntimeException("Variable " + name + " not declared in method");
|
||||
|
Loading…
Reference in New Issue
Block a user