Thread overview
[Issue 7426] New: Inner struct "no size yet for forward reference" when using .tupleof inside it.
Feb 02, 2012
kennytm@gmail.com
Feb 05, 2012
kennytm@gmail.com
Feb 06, 2012
David Simcha
Feb 06, 2012
kennytm@gmail.com
Feb 07, 2012
Walter Bright
Feb 07, 2012
David Simcha
Feb 08, 2012
David Simcha
February 02, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7426

           Summary: Inner struct "no size yet for forward reference" when
                    using .tupleof inside it.
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: kennytm@gmail.com


--- Comment #0 from kennytm@gmail.com 2012-02-02 12:06:40 PST ---
Test case:

------------------
struct S7426
{
    static struct Inner
    {
        int x;
        alias typeof(Inner.tupleof) T;
    }
}
------------------

Compile with 'dmd -c test7426.d', expecting to pass silently, but fails with:

test7426.d(4): Error: struct test7426.S7426.Inner no size yet for forward
reference

The regression is introduced in commit f2635c912999f819f6f99f46373a768df7f5abfa when fixing bug 7190.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 05, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7426


kennytm@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull


--- Comment #1 from kennytm@gmail.com 2012-02-05 00:47:28 PST ---
Pull #696.

https://github.com/D-Programming-Language/dmd/pull/696

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 06, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7426


David Simcha <dsimcha@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dsimcha@yahoo.com


--- Comment #2 from David Simcha <dsimcha@yahoo.com> 2012-02-05 20:13:36 PST ---
Probably related test case:

struct S {
    static if(hasIndirections!(typeof(this))) {}
}

template hasIndirections(T)
{
    enum hasIndirections = hasIndirectionsImpl!(T.tupleof);
}

template hasIndirectionsImpl(T...)
{
    static if (!T.length)
    {
        enum hasIndirectionsImpl = false;
    }
    else
    {
        enum hasIndirectionsImpl = true;
    }
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 06, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7426



--- Comment #3 from kennytm@gmail.com 2012-02-05 23:45:05 PST ---
(In reply to comment #2)
> Probably related test case:
> 
> struct S {
>     static if(hasIndirections!(typeof(this))) {}
> }
> 
> template hasIndirections(T)
> {
>     enum hasIndirections = hasIndirectionsImpl!(T.tupleof);
> }
> 
> template hasIndirectionsImpl(T...)
> {
>     static if (!T.length)
>     {
>         enum hasIndirectionsImpl = false;
>     }
>     else
>     {
>         enum hasIndirectionsImpl = true;
>     }
> }

Pull #696 removed the 'no size yet for forward reference' in this test case,
but DMD will complain 'template instance test.hasIndirectionsImpl!(tuple())
error instantiating' anyway.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 07, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7426



--- Comment #4 from github-bugzilla@puremagic.com 2012-02-06 19:37:15 PST ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/7cd2d8b81cd52002665cb61c04109dc6c6d97b7a Issue 7426

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 07, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7426


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com
           Severity|regression                  |normal


--- Comment #5 from Walter Bright <bugzilla@digitalmars.com> 2012-02-06 19:38:15 PST ---
This isn't a regression, it never really did work right. But the partial fix at least makes it work correctly for the original bug report.

It may not be completely fixable.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 07, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7426



--- Comment #6 from David Simcha <dsimcha@yahoo.com> 2012-02-06 19:47:50 PST ---
Still broken with my test case.  Where do we draw the line between regressions and non-regressions?  2.058 has a lot of borderline cases where internal changes in the compiler make pre-existing bugs affect code they didn't used to affect.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 08, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7426


David Simcha <dsimcha@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


--- Comment #7 from David Simcha <dsimcha@yahoo.com> 2012-02-08 08:49:24 PST ---
(In reply to comment #6)
> Still broken with my test case.  Where do we draw the line between regressions and non-regressions?  2.058 has a lot of borderline cases where internal changes in the compiler make pre-existing bugs affect code they didn't used to affect.

From discussion on the Phobos newsgroup, my test case shouldn't work because X.tupleof shouldn't be defined, if X is not fully defined yet.  I'll close this bug report as fixed but start a new one requesting a decent error message so it's clearer that this is why it doesn't work.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------