Bug description
The C backend of the ASPL compiler generates so-called "wrapper functions" for the invocation of callbacks; however, these functions are currently only generated for callbacks that are actually instantiated at least once in the codebase and not for callbacks that are only ever used as types. And while these wrapper functions are not really needed in the sense that they can never be called if the callback is never instantiated anyway, they are actually necessary for the C code output to compile, as the C compiler cannot know that they can never legally be called.
Reproducing instructions
The above explanation of the bug was very abstract, yet reproducing (and understanding) it is actually quite straight-forward:
var callback? cb = null
if(cb != null){
cb?!.()
}
Expected behaviour
The above code should compile and run without any problems.
Environment
No response
Additional context
No response
Contributing guidelines
Bug description
The C backend of the ASPL compiler generates so-called "wrapper functions" for the invocation of callbacks; however, these functions are currently only generated for callbacks that are actually instantiated at least once in the codebase and not for callbacks that are only ever used as types. And while these wrapper functions are not really needed in the sense that they can never be called if the callback is never instantiated anyway, they are actually necessary for the C code output to compile, as the C compiler cannot know that they can never legally be called.
Reproducing instructions
The above explanation of the bug was very abstract, yet reproducing (and understanding) it is actually quite straight-forward:
Expected behaviour
The above code should compile and run without any problems.
Environment
No response
Additional context
No response
Contributing guidelines