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

Allow typing for destructive assignment #17989

Closed
gavr123456789 opened this issue May 10, 2021 · 0 comments · Fixed by #22611
Closed

Allow typing for destructive assignment #17989

gavr123456789 opened this issue May 10, 2021 · 0 comments · Fixed by #22611
Labels

Comments

@gavr123456789
Copy link
Contributor

Summary

type
  SomeType1 = object
  SomeType2 = object
  Example = tuple [some1: SomeType1, some2: SomeType2]
  
proc foo(): Example = 
  (SomeType1(), SomeType2())

var (sas, ses) = foo()

For better readability, I would like to be able to type variables when tuple is used as a multiple return

var (sas: SomeType1, ses: SomeType2) = foo()
Araq pushed a commit that referenced this issue Sep 1, 2023
…22611)

* type annotations for variable tuple unpacking, better error messages

closes #17989, closes nim-lang/RFCs#339

* update grammar

* fix test
narimiran pushed a commit that referenced this issue Apr 17, 2024
…22611)

* type annotations for variable tuple unpacking, better error messages

closes #17989, closes nim-lang/RFCs#339

* update grammar

* fix test

(cherry picked from commit ba158d7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants