Skip to content

Commit 580bf91

Browse files
committed
Type analysis: see through option types
1 parent 8e19f3c commit 580bf91

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

compiler/lib-wasm/typing.ml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ module Domain = struct
134134
else
135135
Array.init (max l l') ~f:(fun i ->
136136
if i < l then if i < l' then join t.(i) t'.(i) else t.(i) else t'.(i)))
137+
| Int _, Tuple _ -> t'
138+
| Tuple _, Int _ -> t
137139
| Bigarray b, Bigarray b' when Bigarray.equal b b' -> t
138140
| Top, _ | _, Top -> Top
139141
| (Int _ | Number _ | Tuple _ | Bigarray _), _ -> Top
@@ -164,6 +166,7 @@ module Domain = struct
164166
i = l || (sub t.(i) t'.(i) && compare t t' (i + 1) l)
165167
in
166168
compare t t' 0 (Array.length t)
169+
| Int _, Tuple _ -> true
167170
| Bigarray b, Bigarray b' -> Bigarray.equal b b'
168171
| (Int _ | Number _ | Tuple _ | Bigarray _), _ -> false
169172

0 commit comments

Comments
 (0)