Skip to content

Converters found after a match not typechecked #13061

Open
@deech

Description

@deech

The second converter is not typechecked

Example

type
  A = distinct int

# If two converters do the same thing after a match is found the rest are not typechecked
converter toA(a:A):int = (int)a
converter anotherToA(a:A):int = "lol"

# If the wrong one comes first it is typechecked and throws a compiler error
# converter anotherToA(a:A):int = "lol"
# converter toA(a:A):int = (int)a

Current Output

Successful compilation

Expected Output

Error: type mismatch: got <string> but expected 'int'

Nim Version

$ nim -v
Nim Compiler Version 1.0.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions