@@ -378,6 +378,11 @@ Statement = Transformer({
378378 if num_names == 1 and num_values == 1 then
379379 local first_value = values [1 ]
380380 local first_name = names [1 ]
381+ local first_type = ntype (first_value )
382+ if first_type == " chain" then
383+ first_value = Value :transform_once (self , first_value )
384+ first_type = ntype (first_value )
385+ end
381386 local _exp_0 = ntype (first_value )
382387 if " block_exp" == _exp_0 then
383388 local block_body = first_value [2 ]
@@ -397,6 +402,8 @@ Statement = Transformer({
397402 })
398403 elseif " comprehension" == _exp_0 or " tblcomprehension" == _exp_0 or " foreach" == _exp_0 or " for" == _exp_0 or " while" == _exp_0 then
399404 return build .assign_one (first_name , Value :transform_once (self , first_value ))
405+ else
406+ values [1 ] = first_value
400407 end
401408 end
402409 local transformed
@@ -1538,7 +1545,7 @@ Value = Transformer({
15381545 local base_name = NameProxy (" base" )
15391546 local fn_name = NameProxy (" fn" )
15401547 local is_super = ntype (node [2 ]) == " ref" and node [2 ][2 ] == " super"
1541- return self . transform . value ( build .block_exp ({
1548+ return build .block_exp ({
15421549 build .assign ({
15431550 names = {
15441551 base_name
@@ -1580,7 +1587,7 @@ Value = Transformer({
15801587 })
15811588 }
15821589 })
1583- }))
1590+ })
15841591 end
15851592 end ,
15861593 block_exp = function (self , node )
0 commit comments