www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8945] New: Can't call static struct initializer or constructor without qualifier for templated inner struct

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

           Summary: Can't call static struct initializer or constructor
                    without qualifier for templated inner struct
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: verylonglogin.reg gmail.com


--- Comment #0 from Denis Shelomovskij <verylonglogin.reg gmail.com> 2012-11-02
21:01:28 MSK ---
---
struct S // or `class`, or `union`
{
    struct S0(T) { int i; }
    struct S1(T) { this(int){} }
}

void main()
{
    auto cs01 = const S.S0!int();  // ok
    auto cs02 = const S.S0!int(1); // ok
    auto cs1  = const S.S1!int(1); // ok

    auto s01 = S.S0!int();  // Error: struct S0 does not overload ()
    auto s02 = S.S0!int(1); // Error: struct S0 does not overload ()
    auto s1  = S.S1!int(1); // Error: struct S1 does not overload ()
}
---

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


Denis Shelomovskij <verylonglogin.reg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |minor


--- Comment #1 from Denis Shelomovskij <verylonglogin.reg gmail.com> 2012-11-02
21:04:45 MSK ---
An easy workaround:
---
auto s01 = S.S0!int.init;
auto s02 = cast(S.S0!int) 1;
auto s1  = cast(S.S1!int) 1;
---

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


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

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


--- Comment #2 from Kenji Hara <k.hara.pg gmail.com> 2012-11-02 21:04:09 PDT ---
https://github.com/D-Programming-Language/dmd/pull/1250

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



--- Comment #3 from github-bugzilla puremagic.com 2013-03-06 09:13:43 PST ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/156606d44c49ae5bc32db390caee3942aef3e002
fix Issue 8945 - Can't call static struct initializer or constructor without
qualifier for templated inner struct

https://github.com/D-Programming-Language/dmd/commit/1819a3018b49e6e494338aec8ea95b38fb9c409e
Merge pull request #1250 from 9rnsr/fix8945

Issue 8945 - Can't call static struct initializer or constructor without
qualifier for templated inner struct

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


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: -------
Mar 06 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8945



--- Comment #4 from github-bugzilla puremagic.com 2013-03-24 20:57:28 PDT ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/1819a3018b49e6e494338aec8ea95b38fb9c409e
Merge pull request #1250 from 9rnsr/fix8945

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