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 @@ -1329,11 +1329,10 @@ defmodule Module.Types.Descr do
13291329 :maps . next ( iterator ) |> map_literal_intersection_loop ( acc )
13301330
13311331 _ ->
1332- # If the key is marked as not_set in the open map, we can ignore it.
1333- if type1 == @ not_set do
1334- :maps . next ( iterator ) |> map_literal_intersection_loop ( acc )
1335- else
1336- throw ( :empty )
1332+ # If the key is optional in the open map, we can ignore it
1333+ case type1 do
1334+ % { optional: 1 } -> :maps . next ( iterator ) |> map_literal_intersection_loop ( acc )
1335+ _ -> throw ( :empty )
13371336 end
13381337 end
13391338 end
Original file line number Diff line number Diff line change @@ -163,6 +163,9 @@ defmodule Module.Types.DescrTest do
163163 assert intersection ( closed_map ( a: integer ( ) ) , open_map ( b: not_set ( ) ) ) ==
164164 closed_map ( a: integer ( ) )
165165
166+ assert intersection ( closed_map ( a: integer ( ) ) , open_map ( b: if_set ( integer ( ) ) ) ) ==
167+ closed_map ( a: integer ( ) )
168+
166169 assert equal? (
167170 intersection ( closed_map ( a: integer ( ) ) , closed_map ( a: if_set ( integer ( ) ) ) ) ,
168171 closed_map ( a: integer ( ) )
You can’t perform that action at this time.
0 commit comments