I was curious, "now" that blizzard checks if branches, and if you dont have return in else branch, or outside of if code. However, they dont check return statement inside loop block, so code like
However, blizzard having at least a bit of foresight knew we would come up with another way to return bug, and they to make sure made it so that the thread crashes when the return statement is not reached at the end of function(even if a would return integer, it would still crash the thread).
This is nothing fancy, just thought I would share it
JASS:
function a takes nothing returns unit
return null //some unit
endfunction
function b takes integer newA returns integer
loop
call a()
exitwhen true
return newA
endloop
endfunction
function c takes nothing returns nothing
call BJDebugMsg(I2S(b(5)))
endfunction
However, blizzard having at least a bit of foresight knew we would come up with another way to return bug, and they to make sure made it so that the thread crashes when the return statement is not reached at the end of function(even if a would return integer, it would still crash the thread).
This is nothing fancy, just thought I would share it