Skip to content

type in type sections fails with concepts #12714

@mratsim

Description

@mratsim

Linked to dereferencing types: #11773

The type magic does not work in type sections with concept while typeof does

type
  Enqueueable = concept x, type T
    x is ptr
    x.next is Atomic[pointer]

  MyChannel*[T: Enqueueable] = object
    dummy: type(default(T)[])
default_concept.nim(9, 24) template/generic instantiation of `default` from here
system.nim(1818, 16) Error: invalid type: 'T: Enqueueable' in this context: 'proc (T: type T: Enqueueable): T: Enqueueable{.noSideEffect.}' for proc

Using typeof instead works.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions