浏览代码

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
 			match s with
 			| VString s ->
 			| VString s ->
 				(match (get_ctx()).curapi.get_type s with
 				(match (get_ctx()).curapi.get_type s with
-				| None -> VNull
+				| None -> failwith ("Type not found '" ^ s ^ "'")
 				| Some t -> encode_type t)
 				| Some t -> encode_type t)
 			| _ -> error()
 			| _ -> 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
 		The resolution follows the usual class path rules where the last
 		declared class path has priority.
 		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 {
 	public static function getType( name : String ) : Type {
 		return load("get_type", 1)(untyped name.__s);
 		return load("get_type", 1)(untyped name.__s);