Skip to content

Invalid pred in when swallowed #25254

@arnetheduck

Description

@arnetheduck

Nim Version

2.2.4

Description

type X = enum
  a
  b

when pred(a) == b:
  echo "a"
else:
  echo "b"

pred(a) is not well-defined - this should fail to compile

Current Output

Compiles

Expected Output

Compile-time error

Known Workarounds

No response

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    VMsee also `const` label

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions