Bug 96 – Unable to overload functions injected from mixins.

Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2006-04-08T16:09:00Z
Last change time
2014-02-15T02:09:21Z
Assigned to
bugzilla
Creator
bruno.do.medeiros+deebugz

Comments

Comment #0 by bruno.do.medeiros+deebugz — 2006-04-08T16:09:38Z
The following code doesn't compile: template T1() { void func(int x) { } } template T2() { void func() { } } mixin T1!(); mixin T2!(); void main() { func(); // A name conflict occurs here between the two func's. }
Comment #1 by bruno.do.medeiros+deebugz — 2006-04-08T16:23:24Z
Note: If by design one does not want mixins to enable function overloading, then the doc should be clear on that. Specifically, on "If two different mixins are put in the same scope, and each define a declaration with the same name, there is an ambiguity error when the declaration is referenced:", http://www.digitalmars.com/d/mixin.html .
Comment #2 by bruno.do.medeiros+deebugz — 2006-06-19T09:46:15Z
(In reply to comment #1) > Note: If by design one does not want mixins to enable function overloading, > then the doc should be clear on that. Specifically, on "If two different mixins > are put in the same scope, and each define a declaration with the same name, > there is an ambiguity error when the declaration is referenced:", > http://www.digitalmars.com/d/mixin.html . What The Frak!?... What was I thinking, I didn't notice that I quoted the very section of the spec that states quite explicitly that this behaviour is correct, and thus this is not a bug. (Whether the behaviour should or not be allowed, that's another (design) issue)
Comment #3 by bugzilla — 2006-06-20T02:15:48Z
Fixed documentation.