Pretty print state variables 'a instead of '1
This commit is contained in:
@@ -1850,8 +1850,8 @@ instantiate(E) ->
|
||||
instantiate1(dereference(E)).
|
||||
|
||||
instantiate1({uvar, Attr, R}) ->
|
||||
Next = proplists:get_value(next, ets_lookup(type_vars, next), 1),
|
||||
TVar = {tvar, Attr, "'" ++ integer_to_list(Next)},
|
||||
Next = proplists:get_value(next, ets_lookup(type_vars, next), 0),
|
||||
TVar = {tvar, Attr, "'" ++ integer_to_tvar(Next)},
|
||||
ets_insert(type_vars, [{next, Next + 1}, {R, TVar}]),
|
||||
TVar;
|
||||
instantiate1({fun_t, Ann, Named, Args, Ret}) ->
|
||||
@@ -1871,6 +1871,12 @@ instantiate1([A|B]) ->
|
||||
instantiate1(X) ->
|
||||
X.
|
||||
|
||||
integer_to_tvar(X) when X < 26 ->
|
||||
[$a + X];
|
||||
integer_to_tvar(X) ->
|
||||
[integer_to_tvar(X div 26)] ++ [$a + (X rem 26)].
|
||||
|
||||
|
||||
%% Save unification failures for error messages.
|
||||
|
||||
cannot_unify(A, B, When) ->
|
||||
|
||||
Reference in New Issue
Block a user