File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -4448,6 +4448,10 @@ defmodule Module.Types.Descr do
44484448 { :eq , _ , _ } ->
44494449 bdd1
44504450 end
4451+ |> case do
4452+ { _ , :bdd_top , _ , :bdd_top } -> :bdd_top
4453+ other -> other
4454+ end
44514455 end
44524456 end
44534457
@@ -4537,6 +4541,10 @@ defmodule Module.Types.Descr do
45374541 { :eq , _ , _ } ->
45384542 :bdd_bot
45394543 end
4544+ |> case do
4545+ { _ , :bdd_bot , u , :bdd_bot } -> u
4546+ other -> other
4547+ end
45404548 end
45414549 end
45424550
@@ -4601,6 +4609,10 @@ defmodule Module.Types.Descr do
46014609 { :eq , bdd , _ } ->
46024610 bdd
46034611 end
4612+ |> case do
4613+ { _ , :bdd_bot , u , :bdd_bot } -> u
4614+ other -> other
4615+ end
46044616 end
46054617 end
46064618
Original file line number Diff line number Diff line change @@ -2504,6 +2504,20 @@ defmodule Module.Types.DescrTest do
25042504 assert subtype? ( map2 , map1 )
25052505 end
25062506
2507+ test "map intersection and then difference" do
2508+ actual = open_map ( __struct__: atom ( ) , __exception__: atom ( [ true ] ) )
2509+
2510+ expected =
2511+ for i <- 1 .. 50 do
2512+ name = :"name_#{ i } "
2513+ closed_map ( [ __struct__: atom ( [ name ] ) ] ++ [ { name , binary ( ) } ] )
2514+ end
2515+ |> Enum . reduce ( & union / 2 )
2516+
2517+ common = intersection ( actual , expected )
2518+ difference ( actual , common )
2519+ end
2520+
25072521 test "struct difference" do
25082522 entries =
25092523 [
You can’t perform that action at this time.
0 commit comments