mirror of
https://github.com/JonathanFleischmann/CompilerULTIMATE.git
synced 2024-12-27 17:58:03 +00:00
corrected TypedLocalVariable
This commit is contained in:
parent
50b6a821bb
commit
a9bebece45
@ -32,12 +32,14 @@ public final class TypedLocalVariable implements TypedNode {
|
|||||||
if (typedProgram.getCurrentClass().getCurrentMethod().isLocalVariableInMethod(name)) {
|
if (typedProgram.getCurrentClass().getCurrentMethod().isLocalVariableInMethod(name)) {
|
||||||
throw new RuntimeException("Variable " + name + " already declared");
|
throw new RuntimeException("Variable " + name + " already declared");
|
||||||
}
|
}
|
||||||
|
typedProgram.getCurrentClass().getCurrentMethod().getLocalVariables().add(this);
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
if (!typedProgram.getCurrentClass().isCurrentMethodPresent() && typedProgram.getCurrentClass().isCurrentConstructorPresent()) {
|
if (!typedProgram.getCurrentClass().isCurrentMethodPresent() && typedProgram.getCurrentClass().isCurrentConstructorPresent()) {
|
||||||
if (typedProgram.getCurrentClass().getCurrentConstructor().isLocalVariableInConstructor(name)) {
|
if (typedProgram.getCurrentClass().getCurrentConstructor().isLocalVariableInConstructor(name)) {
|
||||||
throw new RuntimeException("Variable " + name + " already declared");
|
throw new RuntimeException("Variable " + name + " already declared");
|
||||||
}
|
}
|
||||||
|
typedProgram.getCurrentClass().getCurrentConstructor().getLocalVariables().add(this);
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
throw new RuntimeException("not found method or constructor in class");
|
throw new RuntimeException("not found method or constructor in class");
|
||||||
|
Loading…
Reference in New Issue
Block a user