瀏覽代碼

fix haxe.macro.Context.getType documentation

Simon Krajewski 10 年之前
父節點
當前提交
a3be766599
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      interp.ml
  2. 1 1
      std/haxe/macro/Context.hx

+ 1 - 1
interp.ml

@@ -2201,7 +2201,7 @@ let macro_lib =
 			match s with
 			| VString s ->
 				(match (get_ctx()).curapi.get_type s with
-				| None -> VNull
+				| None -> failwith ("Type not found '" ^ s ^ "'")
 				| Some t -> encode_type t)
 			| _ -> error()
 		);

+ 1 - 1
std/haxe/macro/Context.hx

@@ -243,7 +243,7 @@ class Context {
 		The resolution follows the usual class path rules where the last
 		declared class path has priority.
 
-		If no type can be found, null is returned.
+		If no type can be found, an exception of type `String` is thrown.
 	**/
 	public static function getType( name : String ) : Type {
 		return load("get_type", 1)(untyped name.__s);