Skip to content

Commit

Permalink
Match Sorbet's latest support for implicit rest nodes
Browse files Browse the repository at this point in the history
Reference: sorbet#8549
  • Loading branch information
st0012 committed Feb 14, 2025
1 parent acaaf66 commit a75c68f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions parser/prism/Translator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -690,8 +690,8 @@ unique_ptr<parser::Node> Translator::translate(pm_node_t *node) {
return translate(implicitNode->value);
}
case PM_IMPLICIT_REST_NODE: { // An implicit splat, like the `,` in `a, = 1, 2, 3`
unreachable("PM_IMPLICIT_REST_NODE is handled separately as part of PM_MULTI_WRITE_NODE and "
"PM_MULTI_TARGET_NODE, see their implementations for details.");
auto restLoc = core::LocOffsets{location.beginLoc + 1, location.beginLoc + 1};
return make_unique<parser::Restarg>(restLoc, core::Names::restargs(), restLoc);
}
case PM_INDEX_AND_WRITE_NODE: { // And-assignment to an index, e.g. `a[i] &&= false`
return translateOpAssignment<pm_index_and_write_node, parser::AndAsgn, void>(node);
Expand Down

0 comments on commit a75c68f

Please sign in to comment.