Description
We are using void *
for all parameters that pass AST nodes around. This gives us no type safety and makes it really easy to e.g. pass an Expr
to a parameter that takes a Decl
.
We have two options to fix this:
- Use C++ interop to pass around the actual AST node types
- For every C++ AST node, define a C struct that wraps the
void *
, e.g.BridgedExpr { void *expr }
and then mark the parameter as taking aBridgedExpr
instead ofvoid *