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

convs are ignored for var tuples in transf #22054

Closed
ringabout opened this issue Jun 9, 2023 · 0 comments · Fixed by #22097
Closed

convs are ignored for var tuples in transf #22054

ringabout opened this issue Jun 9, 2023 · 0 comments · Fixed by #22097
Assignees

Comments

@ringabout
Copy link
Member

          Smaller case:
type A = object
  field: tuple[a: int]

func value(v: var A): var tuple[a: int] =
  v.field
template get(v: A): tuple[a: int] = v.value

var v = A(field: (a: 1))
echo get(v)[0]
error: 'T2_' is a pointer; did you mean to use '->'?
  T1_[0] = dollar___systemZdollars_u8(T2_.Field0);
                                         ^
                                         ->

Originally posted by @metagn in #22049 (comment)

@ringabout ringabout changed the title Smaller case: convs are ignored for var tuples in transf Jun 9, 2023
@ringabout ringabout self-assigned this Jun 9, 2023
Araq pushed a commit that referenced this issue Jun 16, 2023
* fixes #22054; codegen for var tuples conv

* rethink fixes

* add test cases

* templates only

* fixes var tuples

* keep varness no matter what

* fixes typ.isNil

* make it work for generics

* restore isSubrange

* add a test case as requested
bung87 pushed a commit to bung87/Nim that referenced this issue Jul 29, 2023
… varness (nim-lang#22097)

* fixes nim-lang#22054; codegen for var tuples conv

* rethink fixes

* add test cases

* templates only

* fixes var tuples

* keep varness no matter what

* fixes typ.isNil

* make it work for generics

* restore isSubrange

* add a test case as requested
narimiran pushed a commit that referenced this issue Sep 11, 2023
* fixes #22054; codegen for var tuples conv

* rethink fixes

* add test cases

* templates only

* fixes var tuples

* keep varness no matter what

* fixes typ.isNil

* make it work for generics

* restore isSubrange

* add a test case as requested

(cherry picked from commit 77beb15)
narimiran pushed a commit that referenced this issue Sep 11, 2023
* fixes #22054; codegen for var tuples conv

* rethink fixes

* add test cases

* templates only

* fixes var tuples

* keep varness no matter what

* fixes typ.isNil

* make it work for generics

* restore isSubrange

* add a test case as requested

(cherry picked from commit 77beb15)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment