http://d.puremagic.com/issues/show_bug.cgi?id=8983
Maxim Fomin <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #3 from Maxim Fomin <[email protected]> 2012-11-09 02:59:41 PST --- (In reply to comment #2) > One unfortunate consequence of the nested scope rule is we cannot use unnamed > mixins for adding definitions to declarations. > > mixin template Foo() > { > void foo() {} > } > > class A > { > void foo(); > mixin Foo; > } > > results in undefined reference. Even if there were no nested scope, this still would not work because function with omitted body is expected to appear in another object file: class A { void foo(); void foo() {} } void main() { (new A).foo; } will fail because foo matches "both foo and foo". This contradicts to C practice and does not make sense because dmd artificially creates ambiguity between function declaration and its own body. I complained in Bugzilla but was told that such practice in redundant in C and need not supported even as enhancement. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
