Feature request: compile time assertions #47898
Labels
area-vm
Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
vm-aot-code-size
Related to improvements in AOT code size
I would really like to be able to write code like this:
I would like this annotation to be able to be applied to methods, constructors, fields, getters/setters, or class definitions. I am not really concerned with whether it is a pragma or its own annotation.
I would like this annotation to do nothing at runtime, but trigger a compile time error if annotated code ended up in the final binary (e.g. after the VM optimizer pass in gen_snapshot). Ideally, it would also show the call graph(s) that led to that code being retained.
This is a similar request to #28113, but I want this to trigger compilation errors, not analysis warnings.
This is a similar request to #35303, but I want this to trigger compilation errors, since I should never be referring to this code at all in release mode and I don't even want placeholder objects.
These errors should be ignorable in cases where a library writer has annotated something but an application author decides to explicitly invoke it in the forbidden mode anyway.
The text was updated successfully, but these errors were encountered: