浏览代码

[python] add a hack to work around #7436 for now (#7865)

Jens Fischer 6 年之前
父节点
当前提交
a4fad7bdf6
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/typing/typeload.ml

+ 4 - 1
src/typing/typeload.ml

@@ -32,6 +32,7 @@ open Type
 open Typecore
 open Error
 open Globals
+open Filename
 
 let build_count = ref 0
 
@@ -458,7 +459,9 @@ and load_complex_type' ctx allow_display (t,p) =
 				match fst a with
 				| APublic -> ()
 				| APrivate ->
-					ctx.com.warning "private structure fields are deprecated" (pos a);
+					let p = pos a in
+					if Filename.basename p.pfile <> "NativeIterable.hx" then (* Terrible workaround for #7436 *)
+						ctx.com.warning "private structure fields are deprecated" p;
 					pub := false;
 				| ADynamic when (match f.cff_kind with FFun _ -> true | _ -> false) -> dyn := true
 				| AFinal -> final := true