Skip to content

Exceptions defined with define-exception don't receive a Signalable instance #1711

@Jason94

Description

@Jason94

Types defined with define-exception don't receive a Signalable instance, but they probably should.

Reading the docs, it kind of seems like Coalton has two separate error mechanisms going on, Signalable / error and define-exception / throw? I'm not quite sure how they relate to each other, so maybe this is intentional?


With this exception type:

  (define-exception MyException
    (MyException String))

They can't be called with error:

(coalton (error (MyException "Error")))
===>
     1 |  (coalton (error (MyException "Error")))
       |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expression has type:A. (SIGNALABLE MYEXCEPTION) => :A with unresolved constraint (SIGNALABLE MYEXCEPTION)
       |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Add a type assertion with THE to resolve ambiguity

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions