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

[minor] allow var auto in proc getX(a:var A): var auto = return a.x #7566

Open
timotheecour opened this issue Apr 11, 2018 · 2 comments
Open

Comments

@timotheecour
Copy link
Member

allow:
proc getX(a:var A): var auto = return a.x
# means:
proc getX(a:var A): var a.x.type = return a.x
@andreaferretti
Copy link
Collaborator

A possible workaround for now:

template getX[A](a:var A): untyped = a.x

@timotheecour
Copy link
Member Author

problem is, whenever template is used instead of proc, semantics change: if it's used in a place where x is a proc and and a doesn't have field x, it gives new meaning to a.getX

@metagn metagn added the Feature label Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants