[Issue 19127] UDAs seem to be raw AST nodes rather than expressions

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jul 30 02:49:22 UTC 2018


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

--- Comment #3 from | <dhasenan at gmail.com> ---
Oh hey, more fun:

---
module test2;
import std.stdio;
struct S
{
    this(int i) { writeln(i); }
}
size_t print(string s = "hello world")
{
    writeln(s);
    return s.length;
}
size_t x(size_t i) { return i + 1; }
struct A { static uint x; }
string s = "";
int i;

@(std.stdio)
@(new Object)
@(x(4))
@(S(1))
@(A.x)
@(A.x++)
@print
int j;
pragma(msg, __traits(getAttributes, j).stringof);
---

With the pragma(msg), this compiles. Without, it doesn't. Weee!

--


More information about the Digitalmars-d-bugs mailing list