Skip to content

.this pragma doesn't work with generics #5053

@Swend5

Description

@Swend5
type
  A[T] = object
    x: T
{.this: self.}
proc testproc[T](self: A[T]) =
  echo x
type
  A = object
    x: int
{.this: self.}
proc testproc(self: A) =
  echo x

First example results in Error: undeclared identifier: 'x', second example compiles without issue.

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