Skip to content

BOAPI-1096 fix(typecheck): delete {:ok, decimal} case#2

Open
zhabinka wants to merge 1 commit into
masterfrom
fix/BOAPI-1096-fix-type-checker
Open

BOAPI-1096 fix(typecheck): delete {:ok, decimal} case#2
zhabinka wants to merge 1 commit into
masterfrom
fix/BOAPI-1096-fix-type-checker

Conversation

@zhabinka
Copy link
Copy Markdown

В elixir 1.19 TypeCheck стал более строгим.
У cast_decimal есть мёртвая ветка case:

==> tarams
Compiling 4 files (.ex)
    warning: the following clause will never match:

        {:ok, decimal}

    because it attempts to match on the result of:

        Decimal.parse(term)

    which has type:

        dynamic(
          :error or
            {%Decimal{sign: integer(), coef: integer(), exp: float() or integer()} or
               %Decimal{sign: integer(), coef: :NaN or :inf, exp: integer()}, term()}
        )

    typing violation found at:
    │
 66 │       {:ok, decimal} -> check_decimal(decimal, false)
    │       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    │
    └─ lib/type.ex:66: Tarams.Type.cast_decimal/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant