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

fixes #22049; fixes #22054; implicit conversion keeps varness #22097

Merged
merged 10 commits into from
Jun 16, 2023
Merged

Conversation

ringabout
Copy link
Member

fixes #22049
fixes #22054

@ringabout ringabout marked this pull request as draft June 14, 2023 10:41
@ringabout ringabout changed the title fixes #22049; fixes #22054; Invalid codegen when unpacking tuple via template fixes #22049; fixes #22054; implicit conversion keeps varness Jun 15, 2023
@ringabout ringabout marked this pull request as ready for review June 15, 2023 10:14
@Araq
Copy link
Member

Araq commented Jun 15, 2023

Implicit conversions cover a conversion from uint8 to uint16 which does not keep the varness. At least a test case must be added to ensure that this keeps not compiling.

@ringabout
Copy link
Member Author

What case?

proc toUInt16(x: var uint16) =
  discard

var x = uint8(1)
toUInt16 x

?

@Araq
Copy link
Member

Araq commented Jun 16, 2023

For example, yes.

@Araq Araq merged commit 77beb15 into devel Jun 16, 2023
@Araq Araq deleted the pr_var_tuple branch June 16, 2023 10:06
@github-actions
Copy link
Contributor

Thanks for your hard work on this PR!
The lines below are statistics of the Nim compiler built from 77beb15

Hint: mm: orc; opt: speed; options: -d:release
167911 lines; 8.751s; 610.969MiB peakmem

bung87 pushed a commit to bung87/Nim that referenced this pull request 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 pull request Sep 11, 2023

Verified

This commit was signed with the committer’s verified signature.
narimiran Miran
* 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 pull request Sep 11, 2023

Verified

This commit was signed with the committer’s verified signature.
narimiran Miran
* 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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

convs are ignored for var tuples in transf Invalid codegen when unpacking tuple via template
2 participants