www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4225] New: mangle.c:81: char* mangle(Declaration*): Assertion `fd && fd->inferRetType' failed.

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4225

           Summary: mangle.c:81: char* mangle(Declaration*): Assertion `fd
                    && fd->inferRetType' failed.
           Product: D
           Version: 1.057
          Platform: Other
        OS/Version: All
            Status: NEW
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: nfxjfg gmail.com



$ cat bla.d 
struct Foo {
    const x = Foo();

    static Foo opCall() {
        return Foo.init;
    }
}

$ dmd bla.d
::mangle(x)
dmd: mangle.c:81: char* mangle(Declaration*): Assertion `fd &&
fd->inferRetType' failed.
Aborted

Tested with dmd 1.061, where I removed the commented printf() in mangle.c line
37.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 23 2010
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4225


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug yahoo.com.au



Probably related to bug 2080, since both involve type inference.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 23 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4225


nfxjfg gmail.com changed:

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


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 06 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4225


Brad Roberts <braddr puremagic.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |braddr puremagic.com
         Resolution|WONTFIX                     |


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 06 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4225


Walter Bright <bugzilla digitalmars.com> changed:

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



21:16:38 PDT ---
A partial fix:

https://github.com/D-Programming-Language/dmd/commit/1fc2fdb5fa9831eee2e1cae518ad350d517717c4

The error message is now:

test.d(2): Error: cannot implicitly convert expression (opCall()) of type Foo
to Foo

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 10 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4225


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|ice                         |rejects-valid
                 CC|                            |yebblies gmail.com
           Platform|Other                       |All
            Version|1.057                       |D2



Compiles without error on D1 (1.072)

Give a forward reference error with D2 (2.058)

struct Foo {
    enum x = Foo();

    static Foo opCall() {
        return Foo.init;
    }
}

testx.d(5): Error: forward reference to type Foo
testx.d(5): Error: cannot implicitly convert expression (Foo()) of type Foo to
Foo

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