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


--- Comment #0 from Nicolas Sicard <dransic gmail.com> 2013-12-29 19:42:21 PST
---
I thought this would be issue #11767, but the error is still there with this
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


--- Comment #1 from Kenji Hara <k.hara.pg gmail.com> 2013-12-30 00:50:54 PST ---
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



--- Comment #2 from Nicolas Sicard <dransic gmail.com> 2013-12-30 03:48:06 PST
---
(In reply to comment #1)
 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



--- Comment #3 from github-bugzilla puremagic.com 2013-12-30 06:22:42 PST ---
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
Merge pull request #3049 from 9rnsr/fix11843

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