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 converting static vars to openArray #19047

Merged
merged 1 commit into from
Oct 27, 2021
Merged

allow converting static vars to openArray #19047

merged 1 commit into from
Oct 27, 2021

Conversation

etan-status
Copy link
Contributor

When assigning constant output to a seq, and then passing that static
seq to other functions that take openArray, the compiler may end up
producing errors, as it does not know how to convert static[seq[T]]
to openArray[T]. By ignoring the static wrapper on the type for
the purpose of determining data memory location and length, this gets
resolved cleanly. Unfortunately, it is relatively tricky to come up
with a minimal example, as there are followup problems from the failing
conversion, e.g., this may lead to internal error: inconsistent environment type, instead of the relevant openArrayLoc error message.

(cherry picked from commit 490c422)

@etan-status etan-status changed the title allow converting static vars to openArray (#19035) allow converting static vars to openArray Oct 25, 2021
When assigning constant output to a seq, and then passing that static
seq to other functions that take `openArray`, the compiler may end up
producing errors, as it does not know how to convert `static[seq[T]]`
to `openArray[T]`. By ignoring the `static` wrapper on the type for
the purpose of determining data memory location and length, this gets
resolved cleanly. Unfortunately, it is relatively tricky to come up
with a minimal example, as there are followup problems from the failing
conversion, e.g., this may lead to `internal error: inconsistent
environment type`, instead of the relevant `openArrayLoc` error message.

(cherry picked from commit 490c422)
@narimiran narimiran merged commit 861b625 into nim-lang:version-1-6 Oct 27, 2021
@etan-status etan-status deleted the static-openarray-1-6 branch October 27, 2021 09:25
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.

None yet

2 participants