incubator-kie-drools icon indicating copy to clipboard operation
incubator-kie-drools copied to clipboard

[new-parser] Parser errors do not have line numbers

Open yurloc opened this issue 1 year ago • 0 comments

Parent issue

  • #5678

Failing tests

  • org.drools.model.codegen.execmodel.CompilationFailuresTest#testMaxIntegerResultOnDoublePatternShouldntCompile

Notes

  • Both STANDARD_FROM_DRL and PATTERN_DSL.

Rule code snippet

$max : Double() from accumulate ( $num : Integer(); max($num) )

Error output

### parse : ANTLR4_PARSER_ENABLED = true
21:45:12.129 [main] ERROR o.d.c.k.b.impl.AbstractKieProject.buildKnowledgePackages:280 - Unable to build KieBaseModel:defaultKieBase
InvalidExpressionErrorResult: Pattern of type: '[ClassObjectType class=java.lang.Double]' on rule 'X' is not compatible with type java.lang.Integer returned by accumulate function.

The parser fails correctly, but the error message's line property is unset (-1).

yurloc avatar Feb 21 '24 08:02 yurloc