digitalmars.D.bugs - [Issue 10536] New: std.typecons.wrap doesn't work with a class that defines opCast
- d-bugmail puremagic.com (45/45) Jul 04 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10536
- d-bugmail puremagic.com (10/10) Jul 04 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10536
- d-bugmail puremagic.com (12/12) Sep 26 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10536
- d-bugmail puremagic.com (10/10) Sep 26 2013 http://d.puremagic.com/issues/show_bug.cgi?id=10536
http://d.puremagic.com/issues/show_bug.cgi?id=10536 Summary: std.typecons.wrap doesn't work with a class that defines opCast Product: D Version: D2 Platform: All OS/Version: All Status: NEW Keywords: rejects-valid Severity: normal Priority: P2 Component: Phobos AssignedTo: nobody puremagic.com ReportedBy: k.hara.pg gmail.com std.typecons.wrap and unwrap internally uses cross-cast, but current implementation accidentally takes opCast member functions. Code: ---- import std.typecons; interface Interface { int foo(); } class Pluggable { int foo() { return 1; } disable void opCast(T, this X)(); // ! } void main() { Interface i = new Pluggable().wrap!Interface; assert(i.foo() == 1); } Output: ---- std\typecons.d(2780): Error: function test.Pluggable.opCast!(inout(Object), inout(Pluggable)).opCast is not callable because it is annotated with disable std\typecons.d(2780): Error: pure function 'std.typecons.wrap!(Interface).wrap!(Pluggable).Impl._wrap_getSource' cannot call impure function 'test.Pluggable.opCast!(inout(Object), inout(Pluggable)).opCast' std\typecons.d(2780): Error: cannot implicitly convert expression (this._wrap_source.opCast()) of type void to inout(Object) test.d(16): Error: template instance std.typecons.wrap!(Interface).wrap!(Pluggable) error instantiating ---- -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 04 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10536 Kenji Hara <k.hara.pg gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |pull https://github.com/D-Programming-Language/phobos/pull/1386 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 04 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10536 Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/830b6c1bd4cd465766c3d5b873c3c9838e16fc15 fix Issue 10536 - std.typecons.wrap doesn't work with a class that defines opCast https://github.com/D-Programming-Language/phobos/commit/36aa69b5ff06980dca4e31df046c122a50f75c22 Issue 10536 & 10538 - std.typecons.wrap/unwrap bug fix and improvement -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 26 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10536 Andrej Mitrovic <andrej.mitrovich gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |andrej.mitrovich gmail.com Resolution| |FIXED -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 26 2013