File tree Expand file tree Collapse file tree 4 files changed +17
-2
lines changed
Expand file tree Collapse file tree 4 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -1228,6 +1228,10 @@ implicitly_return = function(scope)
12281228 local fn
12291229 fn = function (stm )
12301230 local t = ntype (stm )
1231+ if t == " decorated" then
1232+ stm = scope .transform .statement (stm )
1233+ t = ntype (stm )
1234+ end
12311235 if types .manual_return [t ] or not types .is_value (stm ) then
12321236 if is_top and t == " return" and stm [2 ] == " " then
12331237 return nil
Original file line number Diff line number Diff line change @@ -627,6 +627,12 @@ implicitly_return = (scope) ->
627627 is_top = true
628628 fn = ( stm) ->
629629 t = ntype stm
630+
631+ -- expand decorated
632+ if t == " decorated"
633+ stm = scope. transform. statement stm
634+ t = ntype stm
635+
630636 if types. manual_return[ t] or not types. is_value stm
631637 -- remove blank return statement
632638 if is_top and t == " return" and stm[ 2 ] == " "
Original file line number Diff line number Diff line change @@ -57,5 +57,5 @@ y -> return 1
5757z -> return 1 , " hello" , " world"
5858k -> if yes then return else return
5959
60-
60+ -> real_name if something
6161
Original file line number Diff line number Diff line change @@ -107,4 +107,9 @@ k(function()
107107 else
108108 return
109109 end
110- end )
110+ end )
111+ _ = function ()
112+ if something then
113+ return real_name
114+ end
115+ end
You can’t perform that action at this time.
0 commit comments