enso-org / enso

Hybrid visual and textual functional programming.
https://enso.org
Apache License 2.0
7.34k stars 323 forks source link

Collapsing a node creates a function with 2 arguments with the same name #9405

Closed radeusgd closed 6 months ago

radeusgd commented 6 months ago

https://github.com/enso-org/enso/assets/1436948/d66945b9-e58c-45f8-a1a3-f328eae49b61

As shown on the video, I managed to create a graph that starts from a single starting node and after collapsing it contains that node as 2 duplicated arguments.

Expected behaviour

This graph has only 1 input node, so it should have just 1 argument after collapsing.

Actual behaviour

The following function is created:

collapsed1 operator83051 operator83051 = 
    operator65576 = operator83051 + 100
    operator4146 = operator83051 - 100
    operator85317 = operator65576 * 10
    operator11588 = operator4146 / 2
    operator6332 = [operator11588, operator85317]
    operator6332

Curiously, while the warning is not showing up in the GUI code editor, if I run such code in CLI, I get:

X:\NBO\enso\foo.enso:3:12: warning: Unused function argument operator83051.
    3 | collapsed1 operator83051 operator83051 =
      |            ^~~~~~~~~~~~~
X:\NBO\enso\foo.enso:3:12: warning: The argument 'operator83051' is shadowed by another one with the same name.
    3 | collapsed1 operator83051 operator83051 =
      |            ^~~~~~~~~~~~~
[-49.0, 1020]
farmaazon commented 6 months ago

Duplicate of #9159