Skip to content

{.this: self.} does not work with Static[T] #7618

@mratsim

Description

@mratsim

Here is a working non-static version and the static version.

With static I get undeclared identifier

type Bar = object
    baz: int

{.this: self.}
proc foo(self: Bar) =
  echo(baz)

foo(Bar(baz: 1))

############################################

type Bar2[N: static[int]] = object
    baz2: int

{.this: self.}
proc foo2[N: static[int]](self: Bar2[N]) =
  echo(baz2) # Undeclared identifier baz2

foo2(Bar2[10](baz2: 1))

Metadata

Metadata

Assignees

No one assigned

    Labels

    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