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)
@github-project-automation github-project-automation bot moved this to ❓New in Issues Board Aug 1, 2024
@hubertp hubertp moved this from ❓New to 📤 Backlog in Issues Board Aug 6, 2024
@JaroslavTulach
Copy link
Member

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

@JaroslavTulach JaroslavTulach moved this from 📤 Backlog to 👁️ Code review in Issues Board Aug 6, 2024
@github-project-automation github-project-automation bot moved this from 👁️ Code review to 🟢 Accepted in Issues Board Aug 9, 2024
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
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants