[Issue 8704] Invalid nested struct constructions should be detected

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Apr 11 05:14:25 PDT 2014


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

Kenji Hara <k.hara.pg at gmail.com> changed:

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

--- Comment #4 from Kenji Hara <k.hara.pg at gmail.com> ---
(In reply to yebblies from comment #3)
> The pull request wasn't merged, but both cases now error.

The opening test case still does not cause front-end errors (no error occur
with -o- switch).

And T t; should also be rejected if T is nested struct. Updated test case is:

void check(T)()
{
    // nested struct constructions outside valid frame scope
    T t0;       // new!
    T t1 = T();
    T t2 = T(1);
}

void main()
{
    struct S
    {
        int n;
        void foo(){}
    }
    check!S();
}

(In reply to Kenji Hara from comment #1)
> https://github.com/D-Programming-Language/dmd/pull/1133

I reopened the pull request to fix this issue perfectly.

--


More information about the Digitalmars-d-bugs mailing list