소스 검색

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