www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5193] New: SList cannot have struct elements that have immutable members.

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

           Summary: SList cannot have struct elements that have immutable
                    members.
           Product: D
           Version: D2
          Platform: All
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: zan77137 nifty.com


--- Comment #0 from SHOO <zan77137 nifty.com> 2010-11-09 06:46:42 PST ---
I think this code should be able to work.

-------- main.d --------
import std.container;

struct Data
{
    const int val;
}
void main()
{
    SList!Data list;
}
-------- Result -------- 
$ dmd -run main
..\std\container.d(941): Error: can only initialize c
onst member _payload inside constructor
------------------------

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


chuck <chuck.sonic gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |chuck.sonic gmail.com


--- Comment #1 from chuck <chuck.sonic gmail.com> 2010-11-19 09:35:14 PST ---
WARNING: N00B ALERT! Similar issues with Array and/or SList initializer?

Similar but slightly different:

-------- main.d --------
import std.container;

void main() {
  auto aList = Array!string();
}
-------- Result -------- 
$ dmd -run main
/opt/dmd2/bin/../../src/phobos/std/container.d(1536): Error: this for _data
needs to be type Array not type Payload
/opt/dmd2/bin/../../src/phobos/std/container.d(1537): Error: this for _data
needs to be type Array not type Payload
/opt/dmd2/bin/../../src/phobos/std/container.d(1538): Error: this for _data
needs to be type Array not type Payload
------------------------


Different but slightly similar:

-------- main.d --------
import std.container;

void main() {
  auto s = SList!string("hello");
}
-------- Result -------- 
$ dmd -run main
main.d(5): Error: template std.container.SList!(string).SList.__ctor(U) if
(isImplicitlyConvertible!(U,T)) does not match any function template
declaration
main.d(5): Error: template std.container.SList!(string).SList.__ctor(U) if
(isImplicitlyConvertible!(U,T)) cannot deduce template function from argument
types !()(string)
------------------------

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


Andrei Alexandrescu <andrei metalanguage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |andrei metalanguage.com
         AssignedTo|nobody puremagic.com        |andrei metalanguage.com


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 09 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5193


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


--- Comment #2 from Kenji Hara <k.hara.pg gmail.com> 2011-10-28 07:44:22 PDT ---
https://github.com/D-Programming-Language/phobos/pull/306

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 28 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5193


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

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


--- Comment #3 from Kenji Hara <k.hara.pg gmail.com> 2011-12-03 07:03:30 PST ---
https://github.com/D-Programming-Language/phobos/commit/376361dd9ee171947c0dcc59197288ad54443c21

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 03 2011