[Issue 9318] New: stack overflow if struct have alias this to this.init and has function, in which compare itself with init

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jan 14 07:57:30 PST 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9318

           Summary: stack overflow if struct have alias this to this.init
                    and has function,in which compare itself with init
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: zheny at list.ru


--- Comment #0 from Zhenya Chapovsky <zheny at list.ru> 2013-01-14 07:57:29 PST ---
import std.stdio;

struct Bar
{
    bool checkState()
    {
        return this == Bar.init;//if comment it all right
    }
    static @property Bar m_init()
    {
        return Bar.init;
    }
    alias m_init this;
}

void main()
{
}

This fails to compile with message "Stack overflow"

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


More information about the Digitalmars-d-bugs mailing list