Browse Source

only change structure status to Closed if it's Opened (so we don't touch already-non-opened structures like Const,Extend or statics)

Dan Korostelev 8 years ago
parent
commit
2bee697774
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/typing/typer.ml

+ 1 - 1
src/typing/typer.ml

@@ -2898,7 +2898,7 @@ and type_object_decl ctx fl with_type p =
 		mk (TObjectDecl (List.rev fields)) (TAnon { a_fields = types; a_status = x }) p
 		mk (TObjectDecl (List.rev fields)) (TAnon { a_fields = types; a_status = x }) p
 	| ODKWithStructure a ->
 	| ODKWithStructure a ->
 		let t, fl = type_fields a.a_fields in
 		let t, fl = type_fields a.a_fields in
-		if !(a.a_status) <> Const then a.a_status := Closed;
+		if !(a.a_status) = Opened then a.a_status := Closed;
 		mk (TObjectDecl fl) t p
 		mk (TObjectDecl fl) t p
 	| ODKWithClass (c,tl) ->
 	| ODKWithClass (c,tl) ->
 		let t,ctor = get_constructor ctx c tl p in
 		let t,ctor = get_constructor ctx c tl p in