Browse Source

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

Nicolas Cannasse 1 year ago
parent
commit
15731ea672
1 changed files with 1 additions and 1 deletions
  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