Skip to content

Very basic code fails from generic alias replacing concrete typedesc argument #23977

Closed
@metagn

Description

@metagn

Description

This test code is so simple I would think there has to be an issue for it but I couldn't find one. Even if there is I feel like this would have to be fixed with higher priority.

type Foo[T] = int

proc foo(T: typedesc) =
  var a: T

foo(int)

Even happens if Foo is defined in another module.

Nim Version

2e4d344 and 2.0.8 going back at least to 1.0

Current Output

(6, 4) template/generic instantiation of `foo` from here
(4, 7) Error: invalid type: 'Foo' for var

Expected Output

compiles

Possible Solution

No response

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions