Safe-DS / DSL

Statically checked Data Science programs.
https://dsl.safeds.com
MIT License
14 stars 0 forks source link

Code generator: `RangeError: Invalid array length` #975

Closed lars-reimann closed 8 months ago

lars-reimann commented 8 months ago

Describe the bug

Assigning the result of a constructor call seems to lead to errors in the code generator:

RangeError: Invalid array length
    at SafeDsPythonGenerator.generateAssignment (C:\Users\Lars\Repositories\safe-ds-org\DSL\packages\safe-ds-lang\src\language\generation\safe-ds-python-generator.ts:637:48)
    at SafeDsPythonGenerator.generateStatement (C:\Users\Lars\Repositories\safe-ds-org\DSL\packages\safe-ds-lang\src\language\generation\safe-ds-python-generator.ts:597:39)
    at __vite_ssr_import_1__.joinTracedToNode.separator (C:\Users\Lars\Repositories\safe-ds-org\DSL\packages\safe-ds-lang\src\language\generation\safe-ds-python-generator.ts:517:28)
    at file:///C:/Users/Lars/Repositories/safe-ds-org/DSL/node_modules/langium/src/generate/node-joiner.ts:226:108
    at file:///C:/Users/Lars/Repositories/safe-ds-org/DSL/node_modules/langium/src/generate/node-joiner.ts:113:25
    at reduceWithIsLast (file:///C:/Users/Lars/Repositories/safe-ds-org/DSL/node_modules/langium/src/generate/node-joiner.ts:354:18)
    at joinToNode (file:///C:/Users/Lars/Repositories/safe-ds-org/DSL/node_modules/langium/src/generate/node-joiner.ts:109:12)
    at file:///C:/Users/Lars/Repositories/safe-ds-org/DSL/node_modules/langium/src/generate/node-joiner.ts:224:13
    at SafeDsPythonGenerator.generateBlock (C:\Users\Lars\Repositories\safe-ds-org\DSL\packages\safe-ds-lang\src\language\generation\safe-ds-python-generator.ts:515:52)
    at SafeDsPythonGenerator.generatePipeline (C:\Users\Lars\Repositories\safe-ds-org\DSL\packages\safe-ds-lang\src\language\generation\safe-ds-python-generator.ts:463:47)

To Reproduce

Generate Python code for this:

package test

pipeline myPipeline {
    val table = Table();
}

Expected behavior

No error.

Screenshots (optional)

No response

Additional Context (optional)

No response

lars-reimann commented 7 months ago

:tada: This issue has been resolved in version 0.10.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: