digitalmars.D.bugs - [Issue 9363] New: Array slice initialization with implicitly castable type
- d-bugmail puremagic.com (39/39) Jan 20 2013 http://d.puremagic.com/issues/show_bug.cgi?id=9363
- d-bugmail puremagic.com (16/16) Jan 21 2013 http://d.puremagic.com/issues/show_bug.cgi?id=9363
- d-bugmail puremagic.com (7/8) Jan 21 2013 http://d.puremagic.com/issues/show_bug.cgi?id=9363
- d-bugmail puremagic.com (8/10) Jan 21 2013 http://d.puremagic.com/issues/show_bug.cgi?id=9363
http://d.puremagic.com/issues/show_bug.cgi?id=9363 Summary: Array slice initialization with implicitly castable type Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: bearophile_hugs eml.cc This code works: import std.typecons: Typedef; alias Typedef!(int[]) MyArray; void main() { MyArray arr; arr.length = 10; arr[] = 0; } While this: import std.typecons: Typedef; alias Typedef!(ubyte[]) MyArray; void main() { MyArray arr; arr.length = 10; arr[] = 0; } Gives (dmd 2.062alpha): ...\dmd2\src\phobos\std\typecons.d(2811): Error: cannot implicitly convert expression (v) of type int to ubyte[] temp.d(6): Error: template instance std.typecons.Typedef!(ubyte[], null).Typedef.Proxy!(Typedef_payload).opSliceAssign!(Typedef!(ubyte[], null), int) error instantiating -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 20 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9363 Andrej Mitrovic <andrej.mitrovich gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrej.mitrovich gmail.com Platform|x86 |All OS/Version|Windows |All 07:36:05 PST --- std.typecons.Proxy is really poorly designed. Essentially every possible operator is shoved in there without doing any sort of check on what is being wrapper (except for the one check for classes). Btw please don't use the Platform field unless it's a platform-specific bug, thanks. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 21 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9363 07:36:32 PST ---wrapperI mean wrapped. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 21 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9363Btw please don't use the Platform field unless it's a platform-specific bug, thanks.The Platform tag was set to Windows because the error message that I have put here comes from Windows. It doesn't mean it's a Windows-only problem. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 21 2013