Skip to content

Flipping comparison changes exception #2618

@xsebek

Description

@xsebek

Describe the bug

Flipping comparison produces different exceptions:

// foobar.sw
def foo = {1} end
def bar = 1 end
let foo = "" in let bar = "" in run "example/foobar.sw"; pure (foo > bar)
// <: Comparison is undefined for  {1} and 1

let foo = "" in let bar = "" in run "example/foobar.sw"; pure (bar < foo)
// Fatal error: Incompatible comparison of 1 and {1}

Expected behavior

Both should report that {1} cannot be compared.

Additional context

This issue is just for fun, I already have a fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugThe observed behaviour is incorrect or unexpected.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions