Compiling the following code results in this error: "Assertion failed! Aborting."
module ret;
void main() {
return
}
The problem with the code is that the semicolon is missing after the return statement, which does not have an argument. The code compiles without the semicolon when return has an argument.
// Compiles.
module ret;
int main() {
return 0
}
The compiler should say the error is due to invalid syntax.
Edit: Oops, I misdiagnosed the cause of the error at first. Fixed.
Compiling the following code results in this error: "Assertion failed! Aborting."
The problem with the code is that the semicolon is missing after the
return
statement, which does not have an argument. The code compiles without the semicolon whenreturn
has an argument.The compiler should say the error is due to invalid syntax.
Edit: Oops, I misdiagnosed the cause of the error at first. Fixed.