Incremental=param on ExtendJ compares boolean and Circular

Issue #313 resolved
Emma Söderberg created an issue

Example error:

/home/emso/git/extendj/src/gen/org/extendj/ast/ error: bad operand types for binary operator '&&'
[javac] else if (attrID.equals("inStaticContext") && inStaticContext_computed) {
[javac] ^
[javac] first type: boolean
[javac] second type: Cycle

The inStaticContext_computed attribute is typically checked like this in the attribute implementation:

if (inStaticContext_computed == ASTNode$State.NON_CYCLE || inStaticContext_computed == state().cycle()) {
state().trace().cacheRead(this, "TypeDecl.inStaticContext()", "", inStaticContext_value);
return inStaticContext_value;

The incremental code needs to update how this code is generated.

Comments (3)

  1. Jesper Öqvist

    ExtendJ currently builds with JastAdd 2.3.0, but the error you describe has been fixed in 2.3.4.

    JastAdd 2.3.4 can be used by adding this to the build script inside the subprojects part:

    dependencies {
      jastadd2 "org.jastadd:jastadd:2.3.4"

    However, with JastAdd 2.3.4 there are still some code generation errors in ExtendJ with incremental=param, in cleanupListeners caused by NTA tokens.

    I wrote a minimal test for the former error in jastadd-test, it should not be too hard to fix.

  2. Log in to comment