digitalmars.D.bugs - [Issue 9053] New: Can't overload functions with mixin
- d-bugmail puremagic.com (36/36) Nov 21 2012 http://d.puremagic.com/issues/show_bug.cgi?id=9053
- d-bugmail puremagic.com (18/18) Nov 21 2012 http://d.puremagic.com/issues/show_bug.cgi?id=9053
http://d.puremagic.com/issues/show_bug.cgi?id=9053 Summary: Can't overload functions with mixin Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: freeslave93 gmail.com --- Comment #0 from Roman <freeslave93 gmail.com> 2012-11-21 09:19:30 PST --- mixin template MyMixin() { void foo(int) { } } struct A { void foo() { } mixin MyMixin; } int main(string[] args) { A a; a.foo(5); return 0; } Error: function hello.A.foo () is not callable using argument types (int) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 21 2012
http://d.puremagic.com/issues/show_bug.cgi?id=9053 timon.gehr gmx.ch changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |timon.gehr gmx.ch Resolution| |INVALID --- Comment #1 from timon.gehr gmx.ch 2012-11-21 09:35:19 PST --- That is how it is supposed to work. "Mixin Scope The declarations in a mixin are ‘imported’ into the surrounding scope. If the name of a declaration in a mixin is the same as a declaration in the surrounding scope, the surrounding declaration overrides the mixin one" dlang.org/template-mixin.html You can use a string mixin to generate overloads. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 21 2012