mirror of
https://github.com/JonathanFleischmann/CompilerULTIMATE.git
synced 2024-12-28 16:48:03 +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)){
|
} else if(typedProgram.getCurrentClass().isThereField(name)){
|
||||||
type = typedProgram.getCurrentClass().getFieldType(name);
|
type = typedProgram.getCurrentClass().getFieldType(name);
|
||||||
return type;
|
return type;
|
||||||
|
} else if(recursiveOwnerChain instanceof TypedFieldVarAccess typedFieldVarAccess){
|
||||||
|
type = typedProgram.getCurrentClass().getFieldType(typedFieldVarAccess.getName());
|
||||||
|
return type;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
throw new RuntimeException("Variable " + name + " not declared in constructor");
|
throw new RuntimeException("Variable " + name + " not declared in constructor");
|
||||||
@ -67,6 +70,9 @@ public class TypedFieldVarAccess implements TypedExpression {
|
|||||||
} else if(typedProgram.getCurrentClass().isThereField(name)){
|
} else if(typedProgram.getCurrentClass().isThereField(name)){
|
||||||
type = typedProgram.getCurrentClass().getFieldType(name);
|
type = typedProgram.getCurrentClass().getFieldType(name);
|
||||||
return type;
|
return type;
|
||||||
|
} else if(recursiveOwnerChain instanceof TypedFieldVarAccess typedFieldVarAccess){
|
||||||
|
type = typedProgram.getCurrentClass().getFieldType(typedFieldVarAccess.getName());
|
||||||
|
return type;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
throw new RuntimeException("Variable " + name + " not declared in method");
|
throw new RuntimeException("Variable " + name + " not declared in method");
|
||||||
|
Loading…
Reference in New Issue
Block a user