www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11843] New: Template instantiated twice: failed semantic analysis

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

           Summary: Template instantiated twice: failed semantic analysis
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: dransic gmail.com



---

code:
---
struct Foo
{
    int x[string];
}

struct Bar(alias foo) {}  // line 6

enum bar1 = Bar!(Foo(["a": 1]))();
enum bar2 = Bar!(Foo(["a": 1]))();  // line 9

void main() {}
---

bug.d(6): Error: struct test.Bar!(Foo(["a":1])).Bar failed semantic analysis
bug.d(9): Error: template instance test.Bar!(Foo(["a":1])) error instantiating

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 29 2013
next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11843


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull, rejects-valid



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

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 30 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11843




---

 https://github.com/D-Programming-Language/dmd/pull/3049
I have tested your patch, but now bar1 and bar2 have the same type even if instantiated with two different symbol aliases. --- void main() { struct Foo { int x[string]; } struct Bar(alias foo) {} enum foo1 = Foo(["a": 1]); enum foo2 = Foo(["b": -1]); static assert(!__traits(isSame, foo1, foo2)); enum bar1 = Bar!foo1(); enum bar2 = Bar!foo2(); static assert(is(typeof(bar1) == typeof(bar2))); } --- -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Dec 30 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11843




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

https://github.com/D-Programming-Language/dmd/commit/21b8a4ad6f567fdec97ec4bd1894d9385576269b
fix Issue 11843 - Template instantiated twice: failed semantic analysis

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


Issue 11843 - Template instantiated twice: failed semantic analysis

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 30 2013
prev sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11843


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |yebblies gmail.com
         Resolution|                            |FIXED


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