Skip to content

genericParams from typetraits gives internal error when used in a simple function #19334

@EyeCon

Description

@EyeCon

Using genericParams from typetraits is fine, but encapsulating in a function gives an internal error.

This is observed using "latest" in play.nim-lang.org playground.

echo genericParams(seq[int]) works fine and gives the expected output.

Example

import typetraits

proc contained_type(S: typedesc): string = $genericParams(S)

echo contained_type(seq[int])

Current Output

/usercode/in.nim(5, 20) template/generic instantiation of `contained_type` from here
/usercode/in.nim(3, 58) template/generic instantiation of `genericParams` from here
/usercode/in.nim(5, 20) template/generic instantiation of `contained_type` from here
/usercode/in.nim(3, 58) template/generic instantiation of `genericParams` from here
Error: internal error: /build/Nim/compiler/semtypes.nim(1943, 26)
No stack traceback available
To create a stacktrace, rerun compilation with './koch temp c <file>', see https://nim-lang.github.io/Nim/intern.html#debugging-the-compiler for details

Expected Output

(int,)

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