Skip to content

generic, compile-time proc creates "cannot generate VM code for T" error #19365

Closed
@tersec

Description

@tersec

A compile-time procedure with a generic, static type compiles with a VM code generation error.

Example

proc f[T](x: static T) {.compileTime.} = discard

Current Output

testcase.nim(1, 21) Error: cannot generate VM code for T

Expected Output

Successful compilation.

Tested with Nim versions:

Nim Compiler Version 1.2.16 [Linux: amd64]
Compiled at 2022-01-10
Copyright (c) 2006-2020 by Andreas Rumpf

git hash: c6a9f27b3e36bae9aacec1bd6c37893fb98fd33f
active boot switches: -d:release
Nim Compiler Version 1.6.2 [Linux: amd64]
Compiled at 2021-12-17
Copyright (c) 2006-2021 by Andreas Rumpf

active boot switches: -d:release
Nim Compiler Version 1.7.1 [Linux: amd64]
Compiled at 2022-01-11
Copyright (c) 2006-2021 by Andreas Rumpf

git hash: 9888a29c3de09c73202b2a955e09e2a7b5e56ea4
active boot switches: -d:release

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