浏览代码

fixed pos_path is sometimes null_pos whereas pos_full is not (close #11431)

Nicolas Cannasse 1 年之前
父节点
当前提交
15731ea672
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/typing/typeload.ml

+ 1 - 1
src/typing/typeload.ml

@@ -429,7 +429,7 @@ and load_instance' ctx ptp get_params =
 		if t.tparams <> [] then raise_typing_error ("Class type parameter " ^ t.tname ^ " can't have parameters") ptp.pos_full;
 		pt
 	with Not_found ->
-		let mt = load_type_def ctx ptp.pos_path t in
+		let mt = load_type_def ctx (if ptp.pos_path == null_pos then ptp.pos_full else ptp.pos_path) t in
 		let info = ctx.g.get_build_info ctx mt ptp.pos_full in
 		if info.build_path = ([],"Dynamic") then match t.tparams with
 			| [] -> t_dynamic