2
0
Эх сурвалжийг харах

do not erase Const flag of expected type when it is initialized to a structure declaration (closes #2467)

Simon Krajewski 11 жил өмнө
parent
commit
01bd1e5729
1 өөрчлөгдсөн 1 нэмэгдсэн , 1 устгасан
  1. 1 1
      typer.ml

+ 1 - 1
typer.ml

@@ -2494,7 +2494,7 @@ and type_expr ctx (e,p) (with_type:with_type) =
 				| [] -> ()
 				| _ -> unify_error (List.map (fun n -> has_extra_field t n) !extra_fields) p);
 			end;
-			a.a_status := Closed;
+			if !(a.a_status) <> Const then a.a_status := Closed;
 			mk (TObjectDecl fl) t p)
 	| EArrayDecl [(EFor _,_) | (EWhile _,_) as e] ->
 		let v = gen_local ctx (mk_mono()) in