Thread overview
[Issue 17911] UDA to scope cause Error
May 17, 2018
Walter Bright
May 17, 2018
Mike Franklin
May 17, 2018
Andrea Fontana
May 17, 2018
Andrea Fontana
May 17, 2018
Mike Franklin
May 17, 2018
Timoses
Dec 16, 2018
Walter Bright
[Issue 17911] Add { } block attributes for local variables
Dec 16, 2018
Walter Bright
Jun 13, 2020
Basile-z
May 17, 2018
https://issues.dlang.org/show_bug.cgi?id=17911

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com

--- Comment #1 from Walter Bright <bugzilla@digitalmars.com> ---
Why is this marked as a regression? Which compiler version did it work on?

--
May 17, 2018
https://issues.dlang.org/show_bug.cgi?id=17911

Mike Franklin <slavo5150@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |slavo5150@yahoo.com
         Resolution|---                         |WORKSFORME

--- Comment #2 from Mike Franklin <slavo5150@yahoo.com> ---
I cannot reproduce this in either Linux (2.080) or Windows (2.079).

You can also see that it works fine at https://run.dlang.io/is/v6SW8Q

Please reopen and supply a complete module with precise compiler flags to reproduce the symptoms if the problem persists.

--
May 17, 2018
https://issues.dlang.org/show_bug.cgi?id=17911

Andrea Fontana <trikkuz@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |trikkuz@gmail.com

--- Comment #3 from Andrea Fontana <trikkuz@gmail.com> ---
Probably this is the problem he found:

https://run.dlang.io/is/zim8Z0

--
May 17, 2018
https://issues.dlang.org/show_bug.cgi?id=17911

Andrea Fontana <trikkuz@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WORKSFORME                  |---

--
May 17, 2018
https://issues.dlang.org/show_bug.cgi?id=17911

Mike Franklin <slavo5150@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Hardware|x86_64                      |All
                 OS|Windows                     |All

--
May 17, 2018
https://issues.dlang.org/show_bug.cgi?id=17911

--- Comment #4 from Timoses <timosesu@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.

--
December 16, 2018
https://issues.dlang.org/show_bug.cgi?id=17911

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|regression                  |enhancement

--- Comment #5 from Walter Bright <bugzilla@digitalmars.com> ---
The { } attribute syntax is not supported for local variables:

void bar()
{
    const { int a = 3; }
}

It's never been supported, so it's not a regression. Marked as enhancement request.

--
December 16, 2018
https://issues.dlang.org/show_bug.cgi?id=17911

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|UDA to scope cause Error    |Add { } block attributes
                   |                            |for local variables

--
June 13, 2020
https://issues.dlang.org/show_bug.cgi?id=17911

Basile-z <b2.temp@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
                 CC|                            |b2.temp@gmx.com
         Resolution|---                         |DUPLICATE

--- Comment #6 from Basile-z <b2.temp@gmx.com> ---


*** This issue has been marked as a duplicate of issue 11064 ***

--