From 33013f133991a190fe314954366e1009c83f8706 Mon Sep 17 00:00:00 2001 From: Diego Silva Date: Fri, 21 May 2021 18:41:19 -0300 Subject: [PATCH] fix BigDecimal coercion --- lib/sorbet-coerce/converter.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/sorbet-coerce/converter.rb b/lib/sorbet-coerce/converter.rb index e973b58..853746b 100644 --- a/lib/sorbet-coerce/converter.rb +++ b/lib/sorbet-coerce/converter.rb @@ -130,6 +130,8 @@ def _convert_simple(value, type, raise_coercion_error) safe_type_rule = SafeType::Boolean.strict elsif value.is_a?(type) return value + elsif type == BigDecimal + return BigDecimal(value) elsif PRIMITIVE_TYPES.include?(type) safe_type_rule = SafeType.const_get(type.name).strict else