Skip to content

Compile error with heapqueue, generics and tuples #25312

@emiljanQ3

Description

@emiljanQ3

Nim Version

Nim Compiler Version 2.2.0 [Windows: amd64]

Description

I ran into this problem with Nim Compiler Version 2.2.0.

import heapqueue

proc test1[T](test: (float, T)) = # Works
    discard

proc test2[T](test: seq[(float, T)]) = # Works
    discard

proc test3[T](test: HeapQueue[tuple[sqd: float, data: T]]) = # Works
    discard

proc test4(test: HeapQueue[(float, float)]) = # Works
    discard

type ExampleObj = object
    a: string
    b: seq[float]

proc test5(test: HeapQueue[(float, ExampleObj)]) = # Works
    discard

proc failingTest[T](test: HeapQueue[(float, T)]) = # (Compile) Error: Mixing types and values in tuples is not allowed.
    discard

It was not recognized by @Araq as a known bug when posted on the nim forum.

Current Output


Expected Output


Known Workarounds

No response

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions