Skip to content

Remove unused code path from trailing_block methods#2419

Closed
st0012 wants to merge 1 commit intoruby:masterfrom
Shopify:remove-unused-type-handling
Closed

Remove unused code path from trailing_block methods#2419
st0012 wants to merge 1 commit intoruby:masterfrom
Shopify:remove-unused-type-handling

Conversation

@st0012
Copy link
Copy Markdown
Member

@st0012 st0012 commented Apr 18, 2025

The trailing_block! method is only called in one place:

end_loc = node.rparen_loc || node.parameters&.location || node.name_loc

And all three possible values for end_loc are of type Prism::Location, so the trailing_block! method's implementation and signature can be simplified to only handle Prism::Location.

The `trailing_block!` method is only called in one place:

```
end_loc = node.rparen_loc || node.parameters&.location || node.name_loc
```

And all three possible values for `end_loc` are of type `Prism::Location`,
so the `trailing_block!` method's implementation and signature can be
simplified to only handle `Prism::Location`.
@st0012
Copy link
Copy Markdown
Member Author

st0012 commented Apr 19, 2025

Turns out @soutaro plans to use it for nodes later! So closing now 😄

@st0012 st0012 closed this Apr 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant