File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -1330,11 +1330,10 @@ defmodule Module.Types.Descr do
13301330 :maps . next ( iterator ) |> map_literal_intersection_loop ( acc )
13311331
13321332 _ ->
1333- # If the key is marked as not_set in the open map, we can ignore it.
1334- if type1 == @ not_set do
1335- :maps . next ( iterator ) |> map_literal_intersection_loop ( acc )
1336- else
1337- throw ( :empty )
1333+ # If the key is optional in the open map, we can ignore it
1334+ case type1 do
1335+ % { optional: 1 } -> :maps . next ( iterator ) |> map_literal_intersection_loop ( acc )
1336+ _ -> throw ( :empty )
13381337 end
13391338 end
13401339 end
Original file line number Diff line number Diff line change @@ -167,6 +167,9 @@ defmodule Module.Types.DescrTest do
167167 assert intersection ( closed_map ( a: integer ( ) ) , open_map ( b: not_set ( ) ) ) ==
168168 closed_map ( a: integer ( ) )
169169
170+ assert intersection ( closed_map ( a: integer ( ) ) , open_map ( b: if_set ( integer ( ) ) ) ) ==
171+ closed_map ( a: integer ( ) )
172+
170173 assert equal? (
171174 intersection ( closed_map ( a: integer ( ) ) , closed_map ( a: if_set ( integer ( ) ) ) ) ,
172175 closed_map ( a: integer ( ) )
You can’t perform that action at this time.
0 commit comments