[Issue 4860] Taking delegates to a member function broken if method is also aliased in from a base class
http://d.puremagic.com/issues/show_bug.cgi?id=4860 yebblies yebbl...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED CC||yebbl...@gmail.com Resolution||DUPLICATE --- Comment #10 from yebblies yebbl...@gmail.com 2012-02-12 16:01:05 EST --- This is a symptom of issue 3359 - overload sets are not searched properly in some cases. *** This issue has been marked as a duplicate of issue 3359 *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4860] Taking delegates to a member function broken if method is also aliased in from a base class
http://d.puremagic.com/issues/show_bug.cgi?id=4860 --- Comment #11 from yebblies yebbl...@gmail.com 2012-02-12 16:01:49 EST --- This is a symptom of issue 3559 - overload sets are not searched properly in some cases. *** This issue has been marked as a duplicate of issue 3559 *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4860] Taking delegates to a member function broken if method is also aliased in from a base class
http://d.puremagic.com/issues/show_bug.cgi?id=4860 Walter Bright bugzi...@digitalmars.com changed: What|Removed |Added CC||bugzi...@digitalmars.com --- Comment #8 from Walter Bright bugzi...@digitalmars.com 2010-12-27 18:00:27 PST --- Don's mitigation patch: http://www.dsource.org/projects/dmd/changeset/824 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4860] Taking delegates to a member function broken if method is also aliased in from a base class
http://d.puremagic.com/issues/show_bug.cgi?id=4860 Don clugd...@yahoo.com.au changed: What|Removed |Added Keywords|wrong-code |rejects-valid Platform|x86_64 |All OS/Version|Mac OS X|All --- Comment #9 from Don clugd...@yahoo.com.au 2010-12-27 22:04:25 PST --- Downgrading to rejects-valid, now that the patch is in place. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4860] Taking delegates to a member function broken if method is also aliased in from a base class
http://d.puremagic.com/issues/show_bug.cgi?id=4860 --- Comment #7 from Don clugd...@yahoo.com.au 2010-11-19 22:16:42 PST --- That patch was a bit too early in the function. Should be e2ir.c, line 3308. Still in DelegateExp::toElem(). { // Get pointer to function out of virtual table unsigned vindex; assert(ethis); ep = el_same(ethis); ep = el_una(OPind, TYnptr, ep); vindex = func-vtblIndex; +if (vindex 0) +error(Internal compiler error: malformed delegate. See Bugzilla 4860); // Build *(ep + vindex * 4) ep = el_bin(OPadd,TYnptr,ep,el_long(TYsize_t, vindex * 4)); ep = el_una(OPind,TYnptr,ep); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4860] Taking delegates to a member function broken if method is also aliased in from a base class
http://d.puremagic.com/issues/show_bug.cgi?id=4860 Don clugd...@yahoo.com.au changed: What|Removed |Added CC||clugd...@yahoo.com.au --- Comment #6 from Don clugd...@yahoo.com.au 2010-09-15 12:44:27 PDT --- Wrong-code bugs are always important. Here's a mitigation patch to turn it into a rejects-valid bug. Haven't tracked down the root cause yet, but there certainly should be an assert in this function -- if it's a virtual function, it should have a non-negative vtable index, not -1. e2ir.c, line 3275. DelegateExp::toElem() Symbol *sfunc; int directcall = 0; printf(DelegateExp::toElem() '%s'\n, toChars()); +if (func-isVirtual() func-vtblIndex 0) +error(Internal compiler error: malformed delegate. See Bugzilla 4860); sfunc = func-toSymbol(); if (func-isNested()) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4860] Taking delegates to a member function broken if method is also aliased in from a base class
http://d.puremagic.com/issues/show_bug.cgi?id=4860 --- Comment #1 from klickverbot c...@klickverbot.at 2010-09-13 14:23:03 PDT --- Iain pointed out on #d that the example above works if you put the alias directive *after* the last overload: --- import std.stdio; class Base { void foo() { } } class Derived : Base { override void foo() { } alias Base.foo foo; } void main() { auto d = new Derived(); void delegate() dg = d.foo; writefln(dg: (%s, %s), dg.ptr, dg.funcptr); } --- -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4860] Taking delegates to a member function broken if method is also aliased in from a base class
http://d.puremagic.com/issues/show_bug.cgi?id=4860 Steven Schveighoffer schvei...@yahoo.com changed: What|Removed |Added CC||schvei...@yahoo.com --- Comment #2 from Steven Schveighoffer schvei...@yahoo.com 2010-09-13 14:31:07 PDT --- In order to make this bug report valid, you should cite a better example. In your example, you are overriding the base function, and then also aliasing it. Yes, in the case you reference, it's valid, but your trivial example is nonsensical -- you get nothing by aliasing Base.foo in this case. I am pretty sure you have a better example :) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4860] Taking delegates to a member function broken if method is also aliased in from a base class
http://d.puremagic.com/issues/show_bug.cgi?id=4860 --- Comment #3 from klickverbot c...@klickverbot.at 2010-09-13 14:37:15 PDT --- Steven, I am not quite sure if I see why a non-minimal code snippet in a bug report would be useful, but here you go: --- import std.stdio; class Base { void foo( int i ) {} void foo( string s ) {} } class Derived : Base { alias Base.foo foo; override void foo( int i ) {} } void main() { auto d = new Derived(); void delegate( int ) dg = d.foo; writefln(dg: (%s, %s), dg.ptr, dg.funcptr); } --- Feel free to reduce that to the above test case again. ;) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4860] Taking delegates to a member function broken if method is also aliased in from a base class
http://d.puremagic.com/issues/show_bug.cgi?id=4860 --- Comment #4 from Steven Schveighoffer schvei...@yahoo.com 2010-09-13 14:46:31 PDT --- (In reply to comment #3) Steven, I am not quite sure if I see why a non-minimal code snippet in a bug report would be useful Because it avoids an argument against fixing the bug because the use case is completely useless. Your new example is perfect, thanks! -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4860] Taking delegates to a member function broken if method is also aliased in from a base class
http://d.puremagic.com/issues/show_bug.cgi?id=4860 nfx...@gmail.com changed: What|Removed |Added CC||nfx...@gmail.com --- Comment #5 from nfx...@gmail.com 2010-09-13 19:07:55 PDT --- What? A bug is a bug, it doesn't matter if the code causing it is nonsensical. A code snippet reproducing a bug should be as minimal as possible. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---