digitalmars.D.bugs - [Issue 9147] New: Implicit conversion to struct with alias this does not work
- d-bugmail puremagic.com (34/34) Dec 13 2012 http://d.puremagic.com/issues/show_bug.cgi?id=9147
- d-bugmail puremagic.com (12/12) Jan 13 2013 http://d.puremagic.com/issues/show_bug.cgi?id=9147
http://d.puremagic.com/issues/show_bug.cgi?id=9147 Summary: Implicit conversion to struct with alias this does not work Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: critical Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: simen.kjaras gmail.com PST --- struct bbyte { byte b; alias b this; } void bar(bbyte b) {} bbyte baz() { byte b; return b; // cannot implicitly convert expression (b) of type byte to bbyte } void main() { byte b; bar(b); // function bar (bbyte b) is not callable using argument types (byte) } The above code fails on the marked lines as it's trying to convert the byte to a bbyte. Ref discussion: http://forum.dlang.org/thread/mailman.2599.1355228650.5162.digitalmars-d puremagic.com?page=3#post-mailman.2632.1355345407.5162.digitalmars-d:40puremagic.com -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Dec 13 2012
http://d.puremagic.com/issues/show_bug.cgi?id=9147 yebblies <yebblies gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |yebblies gmail.com Severity|critical |enhancement This is not a bug, it's working as intended. D does not support implicit construction like this. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 13 2013