From 43a386436b817e8d93fea8f6ea719f9162192241 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20H=C3=B6gberg?= Date: Wed, 29 May 2019 15:30:51 +0200 Subject: beam_validator: Use integers as tuple element keys This simplifies a later migration to a unified type format, as the literal representation may differ between passes, so passing container types keyed by literals will fail. --- lib/compiler/src/beam_ssa_type.erl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/compiler/src/beam_ssa_type.erl') diff --git a/lib/compiler/src/beam_ssa_type.erl b/lib/compiler/src/beam_ssa_type.erl index 612277393e..da73dc26f7 100644 --- a/lib/compiler/src/beam_ssa_type.erl +++ b/lib/compiler/src/beam_ssa_type.erl @@ -177,10 +177,9 @@ validator_anno(#t_fun{}) -> any; validator_anno(#t_tuple{size=Size,exact=Exact,elements=Elements0}) -> Elements = maps:fold(fun(Index, Type0, Acc) -> - Key = beam_validator:type_anno(integer, Index), case validator_anno(Type0) of any -> Acc; - Type -> Acc#{Key=>Type} + Type -> Acc#{ Index => Type } end end, #{}, Elements0), beam_validator:type_anno(tuple, Size, Exact, Elements); -- cgit v1.2.3