I'm proposing two changes:
First, rename AssertVariableIsOfType to StaticAssertVariableIsOfType.
The current name suggests that it is a run-time assertion (like
"Assert"), but it's not. The name change makes that clearer.
I doubt that the current name is used in many extensions, but if
necessary, extension code could adapt to this quite easily with
something like
#if PG_VERSION_NUM < ...
#define StaticAssertVariableIsOfType(x, y) AssertVariableIsOfType(x, y)
#endif
Second, change the underlying implementation of
StaticAssertVariableIsOfType to use StaticAssertDecl instead of
StaticAssertStmt. This makes StaticAssertVariableIsOfType behave more
like a normal static assertion, and in many cases we can move the
current instances to a more natural position at file scope. This is
similar to previous commits like 493eb0da31b.