http://d.puremagic.com/issues/show_bug.cgi?id=4136
Summary: @disable semantics Product: D Version: unspecified Platform: x86 OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: bearophile_h...@eml.cc --- Comment #0 from bearophile_h...@eml.cc 2010-04-30 17:34:06 PDT --- This is not yet a bug report, but it can become one. This is D2 code: class A { void foo() {}; } class B : A { override @disable void foo() {} } class C : B { override void foo() {}; } void main() { A b1 = new B; b1.foo(); B c1 = new C; c1.foo(); // Error: function test.B.foo is not callable... } It compiles with dmd 2.043 with an error: test.d(15): Error: function test.B.foo is not callable because it is annotated with @disable The b1 is an instance of class B, but the call to foo produces no error. While c1 is an instance of C, but it generates an error. I don't understand well the design of @disable, but to be useful and more meaningful isn't it necessary/better to enforce it (at run-time) on the dynamic type of an object? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------