Final templated interface method not found

anonymous via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Sep 15 22:46:12 PDT 2015


On Wednesday 16 September 2015 06:14, Andre wrote:

> Hi,
> 
> following coding shoud work, or?
> It doesn't compile with v2.068.0.
> 
> Kind regards
> André
> 
> interface IfStatement
> {
> 	void execute();
> 	
> 	final void execute(T...)(T t)
> 	{
> 		execute();
> 	}
> }
> 
> class Statement: IfStatement
> {
> 	void execute(){}
> }
> 
> void main()
> {
> 	new Statement().execute(1,"Hello World");
> }

You need to add IfStatement.execute to the overload set like so:
----
class Statement: IfStatement
{
    alias execute = IfStatement.execute;
    void execute(){}
}
----


More information about the Digitalmars-d-learn mailing list