mirror of
https://github.com/JonathanFleischmann/CompilerULTIMATE.git
synced 2024-12-28 15:38:03 +00:00
updated the checkType in TypedFieldVarAccess
This commit is contained in:
parent
048aff5996
commit
8e9ce8caa4
@ -36,31 +36,37 @@ public class TypedFieldVarAccess implements TypedExpression {
|
|||||||
if (clas.isThereField(name)) {
|
if (clas.isThereField(name)) {
|
||||||
type = clas.getFieldType(name);
|
type = clas.getFieldType(name);
|
||||||
return clas.getFieldType(name);
|
return clas.getFieldType(name);
|
||||||
|
}else{
|
||||||
|
throw new RuntimeException("Field " + name + " not declared ");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (clas.isThereField(name)) {
|
if (clas.isThereField(name)) {
|
||||||
type = clas.getFieldType(name);
|
type = clas.getFieldType(name);
|
||||||
return clas.getFieldType(name);
|
return type;
|
||||||
} else if (clas.isCurrentConstructorPresent()) {
|
} else if (clas.isCurrentConstructorPresent()) {
|
||||||
if (clas.isParameterNameInCurrentConstructor(name)) {
|
if (clas.isParameterNameInCurrentConstructor(name)) {
|
||||||
type = clas.getParameterTypeInCurrentConstructor(name);
|
type = clas.getParameterTypeInCurrentConstructor(name);
|
||||||
return clas.getParameterTypeInCurrentConstructor(name);
|
return type;
|
||||||
|
} else if (clas.getCurrentConstructor().isLocalVariablePresent(name)) {
|
||||||
|
type = clas.getCurrentConstructor().getLocalVariableType(name);
|
||||||
|
return type;
|
||||||
|
} else {
|
||||||
|
throw new RuntimeException("Variable " + name + " not declared ");
|
||||||
}
|
}
|
||||||
} else if (clas.isCurrentMethodPresent()) {
|
} else if (clas.isCurrentMethodPresent()) {
|
||||||
if (clas.isParameterWitNameInMethod(name)) {
|
if (clas.isParameterWitNameInMethod(name)) {
|
||||||
type = clas.getParameterTypeInCurrentMethod(name);
|
type = clas.getParameterTypeInCurrentMethod(name);
|
||||||
return clas.getParameterTypeInCurrentMethod(name);
|
return clas.getParameterTypeInCurrentMethod(name);
|
||||||
}
|
} else if (clas.getCurrentMethod().isLocalVariablePresent(name)) {
|
||||||
}/*
|
type = clas.getCurrentMethod().getLocalVariableType(name);
|
||||||
if (localVar.containsKey(name)) {
|
return type;
|
||||||
type = localVar.get(name);
|
} else {
|
||||||
return localVar.get(name);
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new RuntimeException("Variable " + name + " not declared ");
|
throw new RuntimeException("Variable " + name + " not declared ");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
throw new RuntimeException("Variable " + name + " not declared ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void codeGen(MethodVisitor mv, MethodContext ctx) {
|
public void codeGen(MethodVisitor mv, MethodContext ctx) {
|
||||||
|
Loading…
Reference in New Issue
Block a user