[Issue 11632] New: Old alias syntax accepts "ref"
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Nov 28 07:29:23 PST 2013
https://d.puremagic.com/issues/show_bug.cgi?id=11632
Summary: Old alias syntax accepts "ref"
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: public at dicebot.lv
--- Comment #0 from Dicebot <public at dicebot.lv> 2013-11-28 07:29:22 PST ---
When using old alias form, `ref` is both accepted and not making any effect:
-----------
alias ref int RefInt;
void foo(RefInt x)
{
x = 42;
}
void main()
{
int x;
foo(x);
import std.stdio : writeln;
writeln(x);
}
-----------
0
-----------
`alias RefInt = ref int` is rejected with "Error: basic type expected, not ref"
so I assume it should be the same here.
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list