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))
Here is a working non-static version and the static version.
With static I get
undeclared identifier