Skip to content

Range type is considered as underlying type when invoking from generic #6013

@endragor

Description

@endragor

Sample:

type
  n16 = range[0'i16..high(int16)]
  SomeObj = ref object

proc doSomethingMore(idOrObj: n16 or SomeObj) =
  discard

proc doSomething(idOrObj: n16 or SomeObj) =
  doSomethingMore(idOrObj) # Error: type mismatch: got (int16)

doSomething(0.n16)

Git hash: 9d4aa03

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions