ソースを参照

don't set anon fields too early

Simon Krajewski 1 年間 前
コミット
dd86cb7b9b
1 ファイル変更2 行追加2 行削除
  1. 2 2
      src/typing/typeloadFields.ml

+ 2 - 2
src/typing/typeloadFields.ml

@@ -1878,12 +1878,12 @@ let init_class ctx c p herits fields =
 	end;
 	c.cl_ordered_statics <- List.rev c.cl_ordered_statics;
 	c.cl_ordered_fields <- List.rev c.cl_ordered_fields;
-	begin match follow c.cl_type with
+	delay ctx PConnectField (fun () -> match follow c.cl_type with
 		| TAnon an ->
 			an.a_fields <- c.cl_statics
 		| _ ->
 			die "" __LOC__
-	end;
+	);
 	(*
 		make sure a default contructor with same access as super one will be added to the class structure at some point.
 	*)