-
Notifications
You must be signed in to change notification settings - Fork 79
Open
Description
There might be a bug with formatter, specifically the addition of an extraneous return statement to particular kind of do ... end statements, such as map / mapreduce -- e.g. this:
function somescope()
...
# seems like perfectly good code, but...
need_this = map(arr) do a
util(...)
end
return val
endis changed by formatter into code with a problem like this:
function somescope()
...
need_this = map(arr) do a
# oops, now there is a return that does not belong
return util(...)
end
return val
endThis extraneous return now terminates the somescope prematurely. I haven't used Juliaformatter that much yet but hope this example shows the potential issue well enough. My guess is the logic for formatting a localized scope begin ... end statement (i.e. checking for return) is maybe over zealous on something like the map do example.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels