Skip to content

Commit c7c009b

Browse files
committed
Clean
1 parent df5ec74 commit c7c009b

File tree

3 files changed

+169
-363
lines changed

3 files changed

+169
-363
lines changed

compiler/lib/flow.ml

+2
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,8 @@ let rec the_shape_of info x =
407407
match info.info_defs.(Var.idx x) with
408408
| Expr (Block (_, a, _, Immutable)) ->
409409
Shape.Block (List.map ~f:(the_shape_of info) (Array.to_list a))
410+
| Expr (Block (_, a, _, _)) when not (Var.ISet.mem info.info_possibly_mutable x)
411+
-> Shape.Block (List.map ~f:(the_shape_of info) (Array.to_list a))
410412
| Expr (Closure (l, _)) ->
411413
Shape.Function { arity = List.length l; pure = false; res = Top "unk" }
412414
| Expr (Special (Alias_prim name)) -> (

compiler/tests-compiler/gh747.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ end
227227
1:
228228
2: //# unitInfo: Provides: Test
229229
3: //# unitInfo: Requires: Stdlib__Printf
230-
4: //# shape: Test:[N,N,[N],N,N,N,N,N,N,N,N,N,N,F(2),F(2),[F(4)]]
230+
4: //# shape: Test:[N,N,[N],N,N,N,N,N,N,N,N,N,[N,N],F(2),F(2),[F(4)]]
231231
5: (function
232232
6: (globalThis){
233233
7: "use strict";

0 commit comments

Comments
 (0)