www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9883] New: Error on using property as new dynamic array size

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

           Summary: Error on using property as new dynamic array size
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: verylonglogin.reg gmail.com



17:16:11 MSD ---
---
struct S
{
     property size_t p(T)()
    { return 0; }
}

 property size_t p(T)()
{ return 0; }

void main()
{
    S s;
    auto n1 = p!int; // OK
    auto n2 = s.p!int; // OK
    auto a1 = new int[p!int]; // Error: need size of rightmost array, not type
p!(int)
    auto a2 = new int[s.p!int]; // Error: no property 'p!(int)' for type 'S'
}
---

Workaround:
Put property in parantheses: `new int[(p!int)]`.

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




22:09:04 MSD ---
Looks like the second case is fixed with Issue 9946.

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


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

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



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

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




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

https://github.com/D-Programming-Language/dmd/commit/08e07564a879bf7abd904ddcc989eb2fff34fd54
fix Issue 9883 - Error on using property as new dynamic array size

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


Issue 9883 - Error on using property as new dynamic array size

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


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

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


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