[Issue 4838] Cannot declare a delegate variable for const member functions

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Sep 8 02:14:01 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4838



--- Comment #2 from klickverbot <code at klickverbot.at> 2010-09-08 02:13:36 PDT ---
Okay, bearophile, here you go:

---
class A {
   void foo() const {}
}

void main() {
   A a = new A;

   pragma( msg, typeof( &a.foo ) ); // Yields »void delegate() const«
   void delegate() const dg = &a.foo; // Does not compile.
}
---

The error message for this simple case is »test.d(9):
const/immutable/shared/inout attributes are only valid for non-static member
functions
«.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list