You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this case, String is used as a reference to the static context of the java.lang.String class. The parser has no way of knowing that, the typeCheck can test this against all known variables and all known imports, but this should not be necessary to do in the bytecode generation.
My solution would be:
Create new AST Node StaticClassRef(className) that is not used by the AstBuilder
Once the TypeCheck encounters a VarRef towards an unknown variable that starts with an uppercase letter, it can convert it into a StaticClassRef
The Bytecode generation can then include a special case for accessing static class members via their static context
The text was updated successfully, but these errors were encountered:
In the case of static properties, the class identifier is wrongly detected as a VarRef. For example:
is currently evaluating the expression on the right as
In this case,
String
is used as a reference to the static context of thejava.lang.String
class. The parser has no way of knowing that, the typeCheck can test this against all known variables and all known imports, but this should not be necessary to do in the bytecode generation.My solution would be:
StaticClassRef(className)
that is not used by the AstBuilderVarRef
towards an unknown variable that starts with an uppercase letter, it can convert it into aStaticClassRef
The text was updated successfully, but these errors were encountered: