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
1329
1329
:maps . next ( iterator ) |> map_literal_intersection_loop ( acc )
1330
1330
1331
1331
_ ->
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 )
1337
1336
end
1338
1337
end
1339
1338
end
Original file line number Diff line number Diff line change @@ -163,6 +163,9 @@ defmodule Module.Types.DescrTest do
163
163
assert intersection ( closed_map ( a: integer ( ) ) , open_map ( b: not_set ( ) ) ) ==
164
164
closed_map ( a: integer ( ) )
165
165
166
+ assert intersection ( closed_map ( a: integer ( ) ) , open_map ( b: if_set ( integer ( ) ) ) ) ==
167
+ closed_map ( a: integer ( ) )
168
+
166
169
assert equal? (
167
170
intersection ( closed_map ( a: integer ( ) ) , closed_map ( a: if_set ( integer ( ) ) ) ) ,
168
171
closed_map ( a: integer ( ) )
You can’t perform that action at this time.
0 commit comments