bcc icon indicating copy to clipboard operation
bcc copied to clipboard

"exit" inside functions not always caught by bcc

Open GWRon opened this issue 1 year ago • 0 comments

This code:

SuperStrict
Framework Brl.StandardIO

Function CallFunc()
	exit
End Function

Correctly results in:

[  9%] Processing:local_subfunc.bmx
Compile Error: Exit statement must appear inside a loop.
[/Testcodes/bmx_tests/local_subfunc.bmx;5;0]
Compilation failed.

While this code here:

SuperStrict
Framework Brl.StandardIO


For local i:int = 0 until 100
	CallFunc()
Next

Function CallFunc()
	exit
End Function

results in:

[  9%] Processing:local_subfunc.bmx
[ 91%] Compiling:local_subfunc.bmx.console.release.linux.x64.c
/Testcodes/bmx_tests/.bmx/local_subfunc.bmx.console.release.linux.x64.c: In function ‘_m_local_subfunc_CallFunc’:
/Testcodes/bmx_tests/.bmx/local_subfunc.bmx.console.release.linux.x64.c:3:9: error: break statement not within loop or switch
    3 |         break;
      |         ^~~~~
Compilation failed.
Build Error: failed to compile (256) 

GWRon avatar Aug 28 '23 11:08 GWRon