File tree Expand file tree Collapse file tree
data_static/expression2/tests/regressions
lua/entities/gmod_wire_expression2/base Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ## SHOULD_PASS:EXECUTE
2+
3+ function number test() {
4+ return 1
5+ }
6+
7+ "test"()
Original file line number Diff line number Diff line change @@ -1832,7 +1832,7 @@ local CompileVisitors = {
18321832 local fn = state .funcs [sig ] or state .funcs [meta_sig ]
18331833 if fn then -- first check if user defined any functions that match signature
18341834 local r = state .funcs_ret [sig ] or state .funcs_ret [meta_sig ]
1835- if r ~= ret_type then
1835+ if r ~= ret_type and not ( ret_type == nil or r == " " ) then
18361836 state :forceThrow ( " Mismatching return types. Got " .. (r or " void" ) .. " , expected " .. (ret_type or " void" ))
18371837 end
18381838
@@ -1841,7 +1841,7 @@ local CompileVisitors = {
18411841 fn = wire_expression2_funcs [sig ] or wire_expression2_funcs [meta_sig ]
18421842 if fn then
18431843 local r = fn [2 ]
1844- if r ~= ret_type and not (ret_type == nil and r == " " ) then
1844+ if r ~= ret_type and not (ret_type == nil or r == " " ) then
18451845 state :forceThrow ( " Mismatching return types. Got " .. (r or " void" ) .. " , expected " .. (ret_type or " void" ))
18461846 end
18471847
@@ -2132,4 +2132,4 @@ function Compiler:Process(ast)
21322132 end
21332133
21342134 return self :CompileStmt (ast )
2135- end
2135+ end
You can’t perform that action at this time.
0 commit comments