From 8ece67ed9d0c91d37ed82d87d5531edf215fa52b Mon Sep 17 00:00:00 2001 From: sabiwara Date: Mon, 29 Apr 2024 15:25:04 +0200 Subject: [PATCH] Use deterministic key order when quoting maps --- lib/elixir/lib/module/types/descr.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/elixir/lib/module/types/descr.ex b/lib/elixir/lib/module/types/descr.ex index 9654b0dfb02..76e731b5b81 100644 --- a/lib/elixir/lib/module/types/descr.ex +++ b/lib/elixir/lib/module/types/descr.ex @@ -860,7 +860,7 @@ defmodule Module.Types.Descr do end defp fields_to_quoted(tag, map) do - for {key, type} <- map, + for {key, type} <- Enum.sort(map), not (tag == :open and optional?(type) and term?(type)) do cond do optional?(type) and empty?(type) -> {literal(key), {:not_set, [], []}}