Skip to content

ICE on typeclass consisting of more than one range #1215

@ghost

Description

type
  TRange1* = range[0 .. 1]
  TRange2* = range[1 .. 2]
  TTypeClass* = TRange1|TRange2

proc p*[T:TTypeClass](val: T) = discard T is range

p(1.TRange1)

That identity check yields this:

range_bug.nim(8, 1) Info: instantiation from here
range_bug.nim(8, 1) Info: instantiation from here
Error: internal error: (filename: compiler/sigmatch.nim, line: 1014)
No stack traceback available

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