-
Notifications
You must be signed in to change notification settings - Fork 35
Description
Steps to Reproduce:
- Define a Rune function that attempts to concatenate multiple lists using a list literal and the
flattenoperator:func TestListFunction: inputs: list1 number (1..*) list2 number (1..*) output: result number (1..*) set result: [list1, list2] flatten - Generate code passing first through Rune validation
Expected Result:
Validation should succeed. The compiler should recognize that a ListLiteral containing multiple multi-cardinality elements results in a list of lists, which is the required input type for the flatten operator.
Actual Result:
Validation fails with the error:
List flatten only allowed for list of lists.
This occurs because CardinalityProvider.safeIsOutputListOfLists in rune-dsl lacks a specific case for ListLiteral, causing it to return false even when the literal effectively wraps multiple lists.
Environment:
- Project:
rune-dsl/rune-python-generator - OS: Mac
- Runtime: Java 17
Additional Context:
The standard pattern for list concatenation is wrapping inputs in a collection and applying flatten. While the validator allows flatten on a single attribute that is explicitly defined as a list-of-lists, it fails to "see through" a ListLiteral used to group multiple lists for concatenation. This prevents the most common use case for flatten in functional expressions.