[Issue 3472] New: alias of a template cannot be used to override a function required by an interface
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Nov 4 08:00:33 PST 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3472
Summary: alias of a template cannot be used to override a
function required by an interface
Product: D
Version: 1.048
Platform: Other
OS/Version: Mac OS X
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: fawzi at gmx.ch
--- Comment #0 from Fawzi Mohamed <fawzi at gmx.ch> 2009-11-04 08:00:32 PST ---
The following shows that alias cannot be used to override a function that is
requested by an interface.
luckily the mixin does work, but I think that also the alias version should
work... (I find it cleaner)
I tested both in D1 and D2.
{{{
interface II{
void f(int);
void f(double);
}
template pr(T){
void f(T i){
// do something
}
}
class A:II{
void print(T)(T i){
// do something
}
version(works){
mixin pr!(int);
mixin pr!(double);
} else { // fails
alias print!(int) f;
alias print!(double) f;
}
}
}}}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list