[BUG REPORT] return statement outside function definition
roysti10 opened this issue · comments
Royston E Tauro commented
Describe the bug
Simc allows for return function to be outside function definition scope
To Reproduce
simc code:
fun a(){
print("hello world")
}
return 1
MAIN
a()
END_MAIN
c code generated:
#include <stdio.h>
int a(void) {
printf("hello world");
}
return 1;
int main() {
a();
return 0;
}
Expected behavior
should give error stating return function used outside function definition
Desktop (please complete the following information):
- OS: Ubuntu Linux
Yashodhan commented
I would like to work on this
Siddhartha Dhar Choudhury commented
Yashodhan commented
Is one allowed to give custom return statement in main function or not?
Siddhartha Dhar Choudhury commented
It is not part of the current version, you are welcome to add that @YJDoc2.
Siddhartha Dhar Choudhury commented
Merged, thanks for your contribution @YJDoc2.