You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using parameter tags to call a function with "out-of-order" parameters, the refactoring action produces invalid code.
fnrefactors_okay(items){list.fold(items,from:0,with:fn(total,item){total+item})}fnbuggy(items){// now the starting point "0" comes firstlist.fold(0,over:items,with:fn(total,item){total+item})}// the above is valid gleam code but refactors to this invalid codefnbuggy_refactor(items){usetotal,item<-list.fold(0)// missing the "items" parametertotal+item}
I organically arrived at out of order parameters because I had
my_object.long_involved_constructor()|>list.fold(over:items,with:fn(a,b){todo})// then I used the "inline pipe" actionlist.fold(my_object.long_involved_constructor(),over:items,with:fn(a,b){todo})// then I used the "convert to use" actionusea,b<-list.fold(my_object.long_involved_constructor())todo// but now the "items" variable has gone missing
Gleam version 1.9.1
The text was updated successfully, but these errors were encountered:
CloserToTheCenter
changed the title
"convert to use" action - error handling different parameter orders
"convert to use" action - error when parameter are out of order
Apr 23, 2025
CloserToTheCenter
changed the title
"convert to use" action - error when parameter are out of order
"convert to use" action - error when parameters are out of order
Apr 23, 2025
Issue with "convert to use" refactoring action.
When using parameter tags to call a function with "out-of-order" parameters, the refactoring action produces invalid code.
I organically arrived at out of order parameters because I had
Gleam version 1.9.1
The text was updated successfully, but these errors were encountered: