tkobayas opened a new issue, #6696:
URL: https://github.com/apache/incubator-kie-drools/issues/6696
DRL10 currently rejects Java diamond operators in function bodies due to a
parser grammar gap;
```java
function List<String> testOfGenerics(String a) {
List<String> results = new ArrayList<>();
return results;
}
```
```
Unable to create KieModule, Errors Existed: [Message [id=1,
kieBase=KBase.xxxx, level=ERROR, path=snip.dslr, line=11, column=0
text=no viable alternative at input 'List<String> results = new
ArrayList<>'], Message [id=2, kieBase=KBase.xxx, level=ERROR, path=snip,
line=11, column=0
text=mismatched input '=' expecting '('], Message [id=3,
kieBase=KBase.xxxx, level=ERROR, path=snip, line=11, column=0
text=mismatched input '>' expecting {'unit', 'function', 'global',
'declare', 'trait', 'type', 'rule', 'query', 'when', 'then', 'end', 'and',
'or', 'exists', 'not', 'in', 'from', 'collect', 'accumulate', 'acc', 'init',
'action', 'reverse', 'result', 'entry-point', 'eval', 'forall', 'over',
'matches', 'memberOf', 'contains', 'excludes', 'soundslike', 'str', 'after',
'before', 'coincides', 'during', 'includes', 'finishes', 'finishedby', 'meets',
'metby', 'overlaps', 'overlappedby', 'starts', 'startedby', 'window',
'attributes', 'salience', 'enabled', 'no-loop', 'auto-focus', 'lock-on-active',
'activation-group', 'ruleflow-group', 'date-effective', 'date-expires',
'dialect', 'calendars', 'timer', 'duration', 'abstract', 'assert', 'boolean',
'break', 'byte', 'case', 'catch', 'char', 'class', 'const', 'continue',
'default', 'do', 'double', 'else', 'enum', 'extends', 'final', 'finally',
'float', 'for', 'if', 'goto', 'implements', 'import', 'instanceof', 'int',
'interface', 'long', 'n
ative', 'package', 'private', 'protected', 'public', 'return', 'short',
'static', 'strictfp', 'super', 'switch', 'synchronized', 'this', 'throw',
'throws', 'transient', 'try', 'void', 'volatile', 'while', 'module', 'open',
'requires', 'exports', 'opens', 'to', 'uses', 'provides', 'with', 'transitive',
'var', 'yield', 'record', 'sealed', 'permits', 'non-sealed', IDENTIFIER}],
Message [id=4, kieBase=KBase.xxx, level=ERROR, path=snip.dslr, line=11, column=0
text=mismatched input '(' expecting {'unit', 'function', 'global',
'declare', 'trait', 'type', 'rule', 'query', 'when', 'then', 'end', 'and',
'or', 'exists', 'not', 'in', 'from', 'collect', 'accumulate', 'acc', 'init',
'action', 'reverse', 'result', 'entry-point', 'eval', 'forall', 'over',
'matches', 'memberOf', 'contains', 'excludes', 'soundslike', 'str', 'after',
'before', 'coincides', 'during', 'includes', 'finishes', 'finishedby', 'meets',
'metby', 'overlaps', 'overlappedby', 'starts', 'startedby', 'window',
'attributes', 'salience', 'enabled', 'no-loop', 'auto-focus', 'lock-on-active',
'activation-group', 'ruleflow-group', 'date-effective', 'date-expires',
'dialect', 'calendars', 'timer', 'duration', 'abstract', 'assert', 'boolean',
'break', 'byte', 'case', 'catch', 'char', 'class', 'const', 'continue',
'default', 'do', 'double', 'else', 'enum', 'extends', 'final', 'finally',
'float', 'for', 'if', 'goto', 'implements', 'import', 'instanceof', 'int',
'interface', 'long', 'n
ative', 'package', 'private', 'protected', 'public', 'return', 'short',
'static', 'strictfp', 'super', 'switch', 'synchronized', 'this', 'throw',
'throws', 'transient', 'try', 'void', 'volatile', 'while', 'module', 'open',
'requires', 'exports', 'opens', 'to', 'uses', 'provides', 'with', 'transitive',
'var', 'yield', 'record', 'sealed', 'permits', 'non-sealed', IDENTIFIER}],
Message [id=5, kieBase=KBase.xxxx, level=ERROR, path=snip.dslr, line=11,
column=0
text=mismatched input ';' expecting '->']]
```
explicit type arguments are a valid workaround until the fix is released.
```java
function List<String> testOfGenerics(String a) {
List<String> results = new ArrayList<String>();
return results;
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]