This is an automated email from the ASF dual-hosted git repository.

thiagoelg pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-tools.git


The following commit(s) were added to refs/heads/main by this push:
     new 268a7ee4010 kie-issues#2310: KIE DMN editor crash on items[1].score 
with Any-typed list (#3576)
268a7ee4010 is described below

commit 268a7ee4010b0a933d562e9dc17c81ea3207f5b2
Author: Thiago Lugli <[email protected]>
AuthorDate: Thu May 14 11:37:22 2026 -0300

    kie-issues#2310: KIE DMN editor crash on items[1].score with Any-typed list 
(#3576)
---
 .../src/parser/grammar/visitor/FeelVisitorImpl.ts          | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git 
a/packages/dmn-feel-antlr4-parser/src/parser/grammar/visitor/FeelVisitorImpl.ts 
b/packages/dmn-feel-antlr4-parser/src/parser/grammar/visitor/FeelVisitorImpl.ts
index c9efb61092f..d9fb1d6a9c5 100644
--- 
a/packages/dmn-feel-antlr4-parser/src/parser/grammar/visitor/FeelVisitorImpl.ts
+++ 
b/packages/dmn-feel-antlr4-parser/src/parser/grammar/visitor/FeelVisitorImpl.ts
@@ -135,7 +135,7 @@ export class FeelVisitorImpl extends 
FEEL_1_1Visitor<VisitorResult | undefined>
     const afterDot = this.resolveNames(ctx.qualifiedName());
 
     // Here, we care about the first result after dot
-    if (beforeDot && beforeDot.dataType.properties.has(afterDot[0].text)) {
+    if (afterDot?.length > 0 && 
beforeDot?.dataType.properties.has(afterDot[0].text)) {
       const startIndex = ctx.qualifiedName().start.start - 1;
       this._semanticTokens.push(
         new SemanticToken({
@@ -179,7 +179,10 @@ export class FeelVisitorImpl extends 
FEEL_1_1Visitor<VisitorResult | undefined>
       }
     }
 
-    return new VisitorResult({ text: ctx.getText(), dataType: 
beforeDot?.dataType.properties.get(afterDot[0].text) });
+    return new VisitorResult({
+      text: ctx.getText(),
+      dataType: afterDot?.length > 0 ? 
beforeDot?.dataType.properties.get(afterDot[0].text) : undefined,
+    });
   };
 
   public override visitPrimaryParens = (ctx: PrimaryParensContext) => {
@@ -233,7 +236,7 @@ export class FeelVisitorImpl extends 
FEEL_1_1Visitor<VisitorResult | undefined>
     const afterDot = this.resolveNames(ctx.qualifiedName());
 
     // Here, we care about the first result after dot
-    if (beforeDot?.dataType.properties.has(afterDot[0].text)) {
+    if (afterDot?.length > 0 && 
beforeDot?.dataType.properties.has(afterDot[0].text)) {
       const startIndex = ctx.qualifiedName().start.start - 1;
       this._semanticTokens.push(
         new SemanticToken({
@@ -248,7 +251,10 @@ export class FeelVisitorImpl extends 
FEEL_1_1Visitor<VisitorResult | undefined>
       );
     }
 
-    return new VisitorResult({ text: ctx.getText(), dataType: 
beforeDot?.dataType.properties.get(afterDot[0].text) });
+    return new VisitorResult({
+      text: ctx.getText(),
+      dataType: afterDot?.length > 0 ? 
beforeDot?.dataType.properties.get(afterDot[0].text) : undefined,
+    });
   };
 
   public override visitFnInvocation = (ctx: FnInvocationContext) => {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to