Cast Object - get null

Namespace rswhite4 at googlemail.com
Wed Apr 18 09:15:37 PDT 2012


override bool opEquals(Object o) const {
         if (o is null) {
		return false;
	}
	
	writeln(o); // write: cast.Vector2D!(float).Vector2D
	
	Vector2D!(T) vec = cast(Vector2D!(T)) o;
	
	writeln(vec); // write: null
         // ...

It seems the cast fail, but the question is: why?


More information about the Digitalmars-d-bugs mailing list