coerce stringy booleans

This commit is contained in:
Jarvis Carroll 2025-09-23 12:44:20 +10:00
parent 7704d82c6f
commit 0caf5a61c7

View File

@ -1822,8 +1822,12 @@ coerce({_, _, signature}, Bin, from_fate) ->
{ok, unicode:characters_to_list(Address)}; {ok, unicode:characters_to_list(Address)};
coerce({_, _, boolean}, true, _) -> coerce({_, _, boolean}, true, _) ->
{ok, true}; {ok, true};
coerce({_, _, boolean}, "true", _) ->
{ok, true};
coerce({_, _, boolean}, false, _) -> coerce({_, _, boolean}, false, _) ->
{ok, false}; {ok, false};
coerce({_, _, boolean}, "false", _) ->
{ok, false};
coerce({O, N, boolean}, S, _) -> coerce({O, N, boolean}, S, _) ->
single_error({invalid, O, N, S}); single_error({invalid, O, N, S});
coerce({O, N, string}, Str, Direction) -> coerce({O, N, string}, Str, Direction) ->