Forráskód Böngészése

ensure local types priority over package one when looking for a submodule (fixed issue #1391)

Nicolas Cannasse 12 éve
szülő
commit
2c147fa1f4
1 módosított fájl, 6 hozzáadás és 1 törlés
  1. 6 1
      typer.ml

+ 6 - 1
typer.ml

@@ -1750,7 +1750,12 @@ and type_access ctx e p mode =
 								| _ :: l -> loop (List.rev l)
 						in
 						(match pack with
-						| [] -> loop (fst ctx.m.curmod.m_path)
+						| [] ->
+							(try
+								let t = List.find (fun t -> snd (t_infos t).mt_path = name) (ctx.m.curmod.m_types @ ctx.m.module_types) in
+								get_static t
+							with Not_found ->
+								loop (fst ctx.m.curmod.m_path))
 						| _ ->
 							match check_module (pack,name) sname with
 							| Some r -> r