Skip to content

Commit 24ebb96

Browse files
committed
Expand case by hand to avoid bug in Erlang/OTP 27+
1 parent 8eb702a commit 24ebb96

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

lib/elixir/lib/module/types/descr.ex

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5916,8 +5916,19 @@ defmodule Module.Types.Descr do
59165916
end
59175917

59185918
defp bdd_difference(bdd1, bdd2, leaf_compare) when is_tuple(bdd1) and is_tuple(bdd2) do
5919-
{a1, c1, u1, d1} = bdd_expand(bdd1)
5920-
{a2, c2, u2, d2} = bdd_expand(bdd2)
5919+
# TODO: Use bdd_expand on Erlang/OTP 28.
5920+
# We write the case by hand to address a bug in Erlang/OTP 27.0
5921+
{a1, c1, u1, d1} =
5922+
case bdd1 do
5923+
bdd_leaf(_, _) -> {bdd1, :bdd_top, :bdd_bot, :bdd_bot}
5924+
_ -> bdd1
5925+
end
5926+
5927+
{a2, c2, u2, d2} =
5928+
case bdd2 do
5929+
bdd_leaf(_, _) -> {bdd2, :bdd_top, :bdd_bot, :bdd_bot}
5930+
_ -> bdd2
5931+
end
59215932

59225933
cond do
59235934
d1 == :bdd_bot and c1 == :bdd_top ->

0 commit comments

Comments
 (0)