Assigning Interface to Object

Trass3r un at known.com
Sat Jan 15 03:51:06 PST 2011


> 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?

Doesn't really make sense.
If you cast it to Object you "loose" the interface methods.


More information about the Digitalmars-d-learn mailing list