digitalmars.D.bugs - [Issue 4818] New: Taking address of shared member function -> unshared delegate
- d-bugmail puremagic.com (44/44) Sep 05 2010 http://d.puremagic.com/issues/show_bug.cgi?id=4818
- d-bugmail puremagic.com (16/16) Jun 16 2011 http://d.puremagic.com/issues/show_bug.cgi?id=4818
http://d.puremagic.com/issues/show_bug.cgi?id=4818 Summary: Taking address of shared member function -> unshared delegate Product: D Version: D2 Platform: Other OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: dsimcha yahoo.com class Foo { shared void bar() {} } void main() { shared(void delegate()) d; auto foo = new Foo; d = &foo.bar; } class Foo { shared void bar() {} } void main() { shared(void delegate()) d; auto foo = new Foo; d = &foo.bar; } Error: cannot implicitly convert expression (&foo.bar) of type void delegate() to shared(void delegate()) But this compiles: class Foo { void bar() {} } void main() { shared(void delegate()) d; auto foo = new Foo; d = &foo.bar; } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 05 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4818 yebblies <yebblies gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |yebblies gmail.com Resolution| |FIXED With dmd 2.053 this prints: testx.d(9): Error: cannot implicitly convert expression (&foo.bar) of type void delegate() shared to shared(void delegate()) Which shows the delegate is being typed correctly. shared(void delegate()) is not the same type as shared(void delegate() shared) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 16 2011