May 04, 2012 [Issue 8030] New: Multiple override are allowed using mixin template | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=8030 Summary: Multiple override are allowed using mixin template Product: D Version: D2 Platform: All OS/Version: All Status: NEW Keywords: accepts-invalid Severity: normal Priority: P2 Component: DMD AssignedTo: nobody@puremagic.com ReportedBy: verylonglogin.reg@gmail.com --- Comment #0 from Denis <verylonglogin.reg@gmail.com> 2012-05-04 13:33:36 MSD --- IMHO this should rise a compiler error: --- mixin template T() { override string f() { return "T"; } } class A { string f() { return "A"; } } class B: A { mixin T; override string f() { return "B"; } mixin T; } void main() { A b = new B; assert(b.f() == "B"); // This passes } --- -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
May 04, 2012 [Issue 8030] Multiple override are allowed using mixin template | ||||
---|---|---|---|---|
| ||||
Posted in reply to Denis | http://d.puremagic.com/issues/show_bug.cgi?id=8030 --- Comment #1 from Denis <verylonglogin.reg@gmail.com> 2012-05-04 15:48:06 MSD --- Or, if this shouldn't rise an error, this also should compiles: --- class B: A { mixin T; mixin T; override string f() { return "B"; } } --- Error: function main.B.T!().f multiple overrides of same function -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation