added MemberAccess to Assignable
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
3996082fa7
commit
f7338a06b3
@ -50,7 +50,7 @@ public class MethodCodeGen implements bytecode.visitor.MethodVisitor {
|
||||
@Override
|
||||
public void visit(ConstructorNode constructorNode) {
|
||||
methodVisitor =
|
||||
classWriter.visitMethod(mapper.mapAccessTypeToOpcode(constructorNode.accessType),
|
||||
classWriter.visitMethod(mapper.mapAccessTypeToOpcode(constructorNode.accesModifier),
|
||||
"<init>",
|
||||
mapper.generateMethodDescriptor(new BaseType(TypeEnum.VOID), constructorNode.parameters),
|
||||
null,
|
||||
|
@ -246,6 +246,9 @@ public class SemanticAnalyzer implements SemanticVisitor {
|
||||
if (currentFields.get(toCheck.identifier) != null) {
|
||||
var type = currentFields.get(toCheck.identifier);
|
||||
toCheck.setTypeNode(type);
|
||||
MemberAccessNode memberAccessNode = new MemberAccessNode(false);
|
||||
memberAccessNode.identifiers.add(currentClass.identifier);
|
||||
toCheck.memberAccess = memberAccessNode;
|
||||
return new TypeCheckResult(true, type);
|
||||
} else if (currentScope.getLocalVar(toCheck.identifier) != null) {
|
||||
var type = currentScope.getLocalVar(toCheck.identifier);
|
||||
|
@ -0,0 +1,10 @@
|
||||
// @expected: TypeMismatchException
|
||||
public class AllFeaturesClassExample {
|
||||
int x;
|
||||
|
||||
public boolean test(boolean x){
|
||||
return this.x;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2,8 +2,8 @@
|
||||
public class AllFeaturesClassExample {
|
||||
int x;
|
||||
|
||||
public boolean test(boolean x){
|
||||
return x;
|
||||
public void test(){
|
||||
x = 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user