[Issue 17911] UDA to scope cause Error

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu May 17 13:15:04 UTC 2018


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

--- Comment #4 from Timoses <timosesu at gmail.com> ---
I apologize in case I have reported the bug incorrectly.


Indeed, I mean Andrea Fontana's version.

The following clarifies a bit more perhaps:

------------------------------------------------------
struct F 
{
    @(1) // works!
    {
        @(2) int a;         // has UDA's (1, 2)
        @("string") int b;  // has UDA's (1, "string")
    }
}

void func() 
{
    @(1) // compilation error
    {
        @(2) int a;         // has UDA's (1, 2)
        @("string") int b;  // has UDA's (1, "string")
    }
}

void main() 
{ 

    struct G 
    {
        @(1) // works!
        {
            @(2) int a;         // has UDA's (1, 2)
            @("string") int b;  // has UDA's (1, "string")
        }
    }
}
-----------------------------------------------------

I'm not sure whether attribution of local variables makes any sense anyhow.
Does it? If that were the case the error message coule be more descriptive.

--


More information about the Digitalmars-d-bugs mailing list