www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9806] New: assertion failure in struct.c:668

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

           Summary: assertion failure in struct.c:668
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: ice
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: nilsbossung googlemail.com



---
Fails with v2.063-devel-618d827.
Compiles with v2.062.

---
cat > test.d <<code
struct S(alias x)
{
    alias S!0 N;
}
enum expr = 0 * 0;
alias S!expr T;
code
dmd -c -o- test.d
---
dmd: struct.c:668: virtual void StructDeclaration::semantic(Scope*): Assertion
`type->ty != Tstruct || ((TypeStruct *)type)->sym == this' failed.
Aborted (core dumped)
---

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 24 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9806


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

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



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

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




---
This slight variation still fails:

---
cat > test.d <<code
struct S(alias x)
{
    template Next()
    {
        enum expr = x + 1;
        alias S!expr Next;
    }
}
alias S!1 One;
alias S!0.Next!() OneAgain;
code
dmd -c -o- test.d
---
dmd: struct.c:722: virtual void StructDeclaration::semantic(Scope*): Assertion
`type->ty != Tstruct || ((TypeStruct *)type)->sym == this' failed.
Aborted (core dumped)
---

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





 This slight variation still fails:
 
 ---
 cat > test.d <<code
 struct S(alias x)
 {
     template Next()
     {
         enum expr = x + 1;
         alias S!expr Next;
     }
 }
 alias S!1 One;
 alias S!0.Next!() OneAgain;
 code
 dmd -c -o- test.d
 ---
 dmd: struct.c:722: virtual void StructDeclaration::semantic(Scope*): Assertion
 `type->ty != Tstruct || ((TypeStruct *)type)->sym == this' failed.
 Aborted (core dumped)
 ---
I updated my pull request to fix it. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 01 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9806




---
Still fails with a tuple parameter:

---
cat > test.d <<code
struct S(x ...)
{
    template Next()
    {
        enum expr = x[0] + 1;
        alias S!expr Next;
    }
}
alias S!1 One;
alias S!0.Next!() OneAgain;
code
dmd -c -o- test.d
---
dmd: struct.c:722: virtual void StructDeclaration::semantic(Scope*): Assertion
`type->ty != Tstruct || ((TypeStruct *)type)->sym == this' failed.
Aborted (core dumped)
---

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





 Still fails with a tuple parameter:
[snip] Updated. Thanks to good test cases. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 02 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9806




---
Alright, my code compiles again. You're the man, Kenji.

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




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/2cbe9b1b389f3617e70ffbdbe20f6b30aeac9d10
fix Issue 9806 - assertion failure in struct.c:668

- Save Scope object to resolve forward references
- Do constant folding in template value argument comparison

Additional:
Add assertions to check AST identity in `ClassDeclaration::semantic` and
`InterfaceDeclaration::semantic`.

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


[REG2.063a] Issue 9806 - assertion failure in struct.c:668

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


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED


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