August 28 [Issue 24729] New: Can't declare global ref variable | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=24729 Issue ID: 24729 Summary: Can't declare global ref variable Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: enhancement Priority: P1 Component: dmd Assignee: nobody@puremagic.com Reporter: nick@geany.org 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. -- |
Copyright © 1999-2021 by the D Language Foundation