I’m porting a null checking macro to 5 and I’m getting metadata with a const attached rather than an expression.
That’s “by design”, yeah. Roundtripping Expr → TypedExpr → Expr is generally not safe, because for example foo.bar becomes foo.get_bar() for properties and then fails due to private field access.
So when the compiler needs to do that for whatever reason (typically static extension macros) it does what’s also exposed in Context.storeTypedExpr, which puts the TypedExpr into some lookup table under a new id and returns that, so when it gets typed again, it can just retrieve it.
What you probably wanna do is Context.typeExpr which will give you the TypedExpr and then you’ll have to operate on that, rather than untyped expressions ![]()
This is my tinkering with thx.core and 5 alpha for something I want to use, and the null check macros have been failing, specifically.
Other than changing over to native lambdas, there’s not much to do, afaict.