Assigning Interface to Object

Mandeep Singh Brar mandeep at brars.co.in
Fri Jan 14 20:52:00 PST 2011


Hi,

I am not able to assign an interface to object. The following code
does not compile.

module testObj;

public interface testInterface {
	void someMethod();
}
public class testObj
{
	Object someCaller;
	this(Object caller) {
		someCaller = caller;
	}
	this(testInterface tI, bool xyz) {
		someCaller = tI;
	}
}

Shouldn't this work?

Thanks & Regards
Mandeep


More information about the Digitalmars-d-learn mailing list