[Issue 3332] Mixin a constructor with a construct already present fails
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Feb 25 10:50:44 PST 2014
https://d.puremagic.com/issues/show_bug.cgi?id=3332
Adam D. Ruppe <destructionator at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |destructionator at gmail.com
--- Comment #5 from Adam D. Ruppe <destructionator at gmail.com> 2014-02-25 10:50:38 PST ---
I'm not sure this is a bug, and I'd be weary of any fix for it because this
comes from an extremely useful feature of template mixins.
Any name in the class overrides the same name from the template mixin. This is
useful because it allows for easy customization of a single function from an
otherwise very useful mixin. Kinda like inheriting from a class and just
overriding one function, very good ability to have.
But since it is the *name*, if you override one, it blasts the entire overload
set. Here, you did your own constructor, so all overloaded constructors are
considered overridden. I'm not sure if you can just alias in the mixin
template's functions to add them to the set.
So I kinda wish you could change just one overload so this might be a bug, but
overriding a function like this is a useful, documented feature of template
mixins so it might not be and either way, caution is needed not to flush the
baby with the bathwater.
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list