[Issue 20945] alias x = ref y compiles

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jun 18 12:37:01 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=20945

--- Comment #3 from Stanislav Blinov <stanislav.blinov at gmail.com> ---
All of these compile:

alias st = static int;
alias au = auto int;
alias sc = scope int;
alias ov = override int;
alias ab = abstract int;
alias sy = synchronized int;
alias nt = nothrow int;
alias pu = pure int;
alias re = ref int;

And none of them should, ideally with a message such as:

`ref` is not allowed in `alias` declaration.

(Currently, `out` and `lazy` don't compile, but the message is not that
succinct, as it falls through multiple parsing attemts).

--


More information about the Digitalmars-d-bugs mailing list