Browse Source

[cs] Use Lib.as for Std.instance

Cauê Waneck 11 years ago
parent
commit
460baf4f8e
1 changed files with 2 additions and 2 deletions
  1. 2 2
      std/cs/_std/Std.hx

+ 2 - 2
std/cs/_std/Std.hx

@@ -232,8 +232,8 @@ import cs.internal.Exceptions;
 		}
 	}
 
-	public static function instance<T:{},S:T>( value : T, c : Class<S> ) : S {
-		return Std.is(value, c) ? cast value : null;
+	@:extern inline public static function instance<T:{},S:T>( value : T, c : Class<S> ) : S {
+		return cs.Lib.as(value,c);
 	}
 
 	public static function random( x : Int ) : Int {