The 2.111 pending changelog says:
> ref and auto ref can now be applied to local, static, extern, and global variables
https://dlang.org/changelog/pending.html#dmd.reflocal
But globals don't seem to work:
struct Foo
{
int a;
}
Foo foo;
ref f = foo; // Error: static variable `foo` cannot be read at compile time
ref a = foo.a; // Error: static variable `foo` cannot be read at compile time
`f` could be just an alias so to be useful, `a` needs to be supported. Assuming ref globals are supposed to work.
The only ref variable tests I found are in test/runnable/declaration.d, and none are global variables.
Comment #1 by robert.schadek — 2024-12-13T19:37:06Z