Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mratsim opened this issue Apr 15, 2018 · 2 comments
Closed

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

mratsim opened this issue Apr 15, 2018 · 2 comments
Labels

Comments

@mratsim
Copy link
Collaborator

mratsim commented Apr 15, 2018

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))
mratsim added a commit to mratsim/golem-prime that referenced this issue Apr 15, 2018
@zah
Copy link
Member

zah commented Apr 16, 2018

The problem is more general. this: self doesn't work in generic code.

@zah
Copy link
Member

zah commented Apr 16, 2018

Duplicate of #5053

@zah zah marked this as a duplicate of #7177 Apr 16, 2018
@zah zah closed this as completed Apr 16, 2018
@zah zah marked this as a duplicate of #5053 Apr 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants