Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicit return type with error causes type error when an error is thrown #10736

Closed
GregoryTravis opened this issue Aug 1, 2024 · 1 comment · Fixed by #10765
Closed

Explicit return type with error causes type error when an error is thrown #10736

GregoryTravis opened this issue Aug 1, 2024 · 1 comment · Fixed by #10765
Assignees
Labels
-compiler p-low Low priority

Comments

@GregoryTravis
Copy link
Contributor

GregoryTravis commented Aug 1, 2024

(This bug refers to #10725)

This change to Decimal.add results in the error shown below, in the case of a thrown error:

-    add self (that : Decimal) (math_context : Math_Context | Nothing = Nothing) =
     add self (that : Decimal) (math_context : Math_Context | Nothing = Nothing) -> Decimal ! Arithmetic_Error | Illegal_Argument =

Error:

    - [FAILED] should not allow mixed arithmetic (float) [68ms]
        Reason: An unexpected panic was thrown: Type error: expected the result of `add` to be Decimal, but got <ERR>.
        at <enso> Decimal.add(/Users/gmt/dev/enso/enso/built-distribution/enso-engine-0.0.0-dev-macos-aarch64/enso-0.0.0-dev/lib/Standard/Base/0.0.0-dev/src/Data/Decimal.enso:478-482)
@JaroslavTulach
Copy link
Member

Ok. Caused by an attempt to attach warning to DataFlowError.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-compiler p-low Low priority
Projects
Status: 🟢 Accepted
Development

Successfully merging a pull request may close this issue.

2 participants