浏览代码

fixed again #2555, this time correctly keep the private class path (a.b._C.Name becomes a.b.Name as if it was public)

Nicolas Cannasse 11 年之前
父节点
当前提交
518552990c
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      typer.ml

+ 1 - 1
typer.ml

@@ -232,7 +232,7 @@ let rec can_access ctx ?(in_overload=false) c cf stat =
 	(* has metadata path *)
 	let make_path c f = match c.cl_kind with
 		| KAbstractImpl a -> fst a.a_path @ [snd a.a_path; f.cf_name]
-		| _ when c.cl_private -> [snd c.cl_path; f.cf_name]
+		| _ when c.cl_private -> List.rev (f.cf_name :: snd c.cl_path :: (List.tl (List.rev (fst c.cl_path))))
 		| _ -> fst c.cl_path @ [snd c.cl_path; f.cf_name]
 	in
 	let rec expr_path acc e =