Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[new-parser] Grouped accessors for nested objects broken #5706

Closed
yurloc opened this issue Feb 20, 2024 · 2 comments
Closed

[new-parser] Grouped accessors for nested objects broken #5706

yurloc opened this issue Feb 20, 2024 · 2 comments
Assignees

Comments

@yurloc
Copy link
Contributor

yurloc commented Feb 20, 2024

Parent issue

Failing tests

  • org.drools.model.codegen.execmodel.CompilerTest#testChainOfMethodCallInConstraintSub

Notes

  • PATTERN_DSL only.

Rule code snippet

  $p : Person( address.(city.startsWith("I") &&  city.length() == 5  ) )

Error output

### parse : ANTLR4_PARSER_ENABLED = true

java.lang.AssertionError: [Message [id=1, level=ERROR, path=src/main/java/defaultpkg/PFA/LambdaPredicateFAECF003FA1F7B02276D174B3E3A28E2.java, line=22, column=809
   text=Type mismatch: cannot convert from Address to boolean], Message [id=2, level=ERROR, path=src/main/java/defaultpkg/PFA/LambdaPredicateFAECF003FA1F7B02276D174B3E3A28E2.java, line=0, column=0
   text=Java source of src/main/java/defaultpkg/PFA/LambdaPredicateFAECF003FA1F7B02276D174B3E3A28E2.java in error:
package defaultpkg.PFA;


import static defaultpkg.Rules029EE342789B9ECE6C6C0AEA5F2505EC.*;
import org.drools.model.codegen.execmodel.domain.Person;
import defaultpkg.*;
import org.drools.modelcompiler.dsl.pattern.D;

@org.drools.compiler.kie.builder.MaterializedLambda()
public enum LambdaPredicateFAECF003FA1F7B02276D174B3E3A28E2 implements org.drools.model.functions.Predicate1<org.drools.model.codegen.execmodel.domain.Person>, org.drools.model.functions.HashedExpression {

    INSTANCE;

    public static final String EXPRESSION_HASH = "8D259D9F1DDB57E5CB829B926CC8A8B4";

    public java.lang.String getExpressionHash() {
        return EXPRESSION_HASH;
    }

    @Override()
    public boolean test(org.drools.model.codegen.execmodel.domain.Person _this) throws java.lang.Exception {
        return _this.getAddress();
    }

    @Override()
    public org.drools.model.functions.PredicateInformation predicateInformation() {
        org.drools.model.functions.PredicateInformation info = new org.drools.model.functions.PredicateInformation("address.(city.startsWith(\"I\") &&  city.length() == 5  )");
        info.addRuleNames("R", "r0.drl");
        return info;
    }
}
]]

	at org.drools.model.codegen.execmodel.BaseModelTest.createKieBuilder(BaseModelTest.java:157)
	at org.drools.model.codegen.execmodel.BaseModelTest.createKieBuilder(BaseModelTest.java:132)
	at org.drools.model.codegen.execmodel.BaseModelTest.getKieContainer(BaseModelTest.java:121)
	at org.drools.model.codegen.execmodel.BaseModelTest.getKieContainer(BaseModelTest.java:114)
	at org.drools.model.codegen.execmodel.BaseModelTest.getKieSession(BaseModelTest.java:110)
	at org.drools.model.codegen.execmodel.BaseModelTest.getKieSession(BaseModelTest.java:106)
	at org.drools.model.codegen.execmodel.CompilerTest.testChainOfMethodCallInConstraintSub(CompilerTest.java:990)
@tkobayas tkobayas self-assigned this Mar 15, 2024
@tkobayas
Copy link
Contributor

/take

@tkobayas
Copy link
Contributor

Fixed by #5790

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants