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 (currentType == null) {
|
||||||
if (currentScope.getLocalVar(s) != null) {
|
if (currentScope.getLocalVar(s) != null) {
|
||||||
currentType = currentScope.getLocalVar(s);
|
currentType = currentScope.getLocalVar(s);
|
||||||
|
|
||||||
} else if (currentFields.get(s) != null) {
|
} else if (currentFields.get(s) != null) {
|
||||||
currentType = currentFields.get(s);
|
currentType = currentFields.get(s);
|
||||||
} else {
|
} else {
|
||||||
@ -648,7 +647,7 @@ public class SemanticAnalyzer implements SemanticVisitor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
memberAccessNode.setTypeNode(currentType);
|
||||||
return new TypeCheckResult(true, currentType);
|
return new TypeCheckResult(true, currentType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,10 +9,3 @@ public class Person {
|
|||||||
return this.age;
|
return this.age;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Person2 {
|
|
||||||
public void greet() {
|
|
||||||
Person person = new Person(10);
|
|
||||||
person.getAge();
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user