Closed djehuti closed 6 months ago
I think I know, what could cause it?
void = call(workFunc)
technically, the correct syntax for ignoring a return value from a single return value function is this:
void call(workFunc)
void =
syntax wasn't a thing until multi-return syntax was added recently, and I guess the handling of void =
for regular functions wasn't added, so stuff happen.
But that's just my thesis.
Yup, that fixes it. That's a fine workaround for me! (I'm used to that syntax.)
I'll let you ( @irmen ) decide whether to keep this open to handle that or just close it.
yeah, let desertfish see it, so he can add a proper error message
With -target virtual, it also crashes, but with a different error
Exception in thread "main" java.lang.IllegalArgumentException: node prog8.code.ast.PtFunctionCall@ccd1bc3 name is not scoped: call at prog8.codegen.intermediate.IRCodeGen.verifyNameScoping$verifyPtNode(IRCodeGen.kt:65) at prog8.codegen.intermediate.IRCodeGen.verifyNameScoping$verifyPtNode(IRCodeGen.kt:79) at prog8.codegen.intermediate.IRCodeGen.verifyNameScoping$verifyPtNode(IRCodeGen.kt:79) at prog8.codegen.intermediate.IRCodeGen.verifyNameScoping$verifyPtNode(IRCodeGen.kt:79) at prog8.codegen.intermediate.IRCodeGen.verifyNameScoping(IRCodeGen.kt:90) at prog8.codegen.intermediate.IRCodeGen.generate(IRCodeGen.kt:26)
Minimal reproduction:
main {
sub start() {
void = call($2000)
}
}
related compiler crash:
main {
sub start() {
void = 123
}
}
The following PR exhibits the issue. When building the target repo with this PR: