Fixed MemberAccess Type
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
This commit is contained in:
parent
4bee432294
commit
240913d422
@ -624,7 +624,6 @@ public class SemanticAnalyzer implements SemanticVisitor {
|
||||
if (currentType == null) {
|
||||
if (currentScope.getLocalVar(s) != null) {
|
||||
currentType = currentScope.getLocalVar(s);
|
||||
|
||||
} else if (currentFields.get(s) != null) {
|
||||
currentType = currentFields.get(s);
|
||||
} else {
|
||||
@ -648,7 +647,7 @@ public class SemanticAnalyzer implements SemanticVisitor {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
memberAccessNode.setTypeNode(currentType);
|
||||
return new TypeCheckResult(true, currentType);
|
||||
}
|
||||
|
||||
|
@ -8,11 +8,4 @@ public class Person {
|
||||
public int getAge() {
|
||||
return this.age;
|
||||
}
|
||||
}
|
||||
|
||||
public class Person2 {
|
||||
public void greet() {
|
||||
Person person = new Person(10);
|
||||
person.getAge();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user