File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -203,6 +203,8 @@ class Builder::Impl {
203203
204204 auto raw_numparam_stack = driver_->numparam_stack .stackCopy ();
205205
206+ auto opening_token = raw_numparam_stack.back ().opening_token ;
207+
206208 // ignore current block scope
207209 raw_numparam_stack.pop_back ();
208210
@@ -226,7 +228,11 @@ class Builder::Impl {
226228 }
227229
228230 driver_->lex .declare (name_str);
229- auto intro = make_unique<LVar>(node->loc , id->name );
231+
232+ // The LVar's location matches the non-zero length NumParams node. See `numparams()` for details.
233+ core::LocOffsets loc = tokLoc (opening_token).copyEndWithZeroLength ();
234+ auto intro = make_unique<LVar>(loc, id->name );
235+
230236 auto decls = driver_->alloc .node_list ();
231237 decls->emplace_back (toForeign (std::move (intro)));
232238 driver_->numparam_stack .regis (name_str[1 ] - ' 0' , std::move (decls));
You can’t perform that action at this time.
0 commit comments