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 #14917; Consider the case where nkBracket is of type tySequence #22629

Closed
wants to merge 3 commits into from

Conversation

Pylgos
Copy link
Contributor

@Pylgos Pylgos commented Sep 2, 2023

fixes #14917

@@ -643,6 +643,15 @@ proc arrayConstrType(c: PContext, n: PNode): PType =
result = typ

proc semArrayConstr(c: PContext, n: PNode, flags: TExprFlags; expectedType: PType = nil): PNode =
if n.typ != nil and n.typ.kind == tySequence:
Copy link
Collaborator

@metagn metagn Sep 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry if this is outside your comfort range, but could we maybe wait until the end and sem the array as normal and finally change the type to seq from the formed array type if the node was originally typed as seq? Just curious if it accomplishes the same thing.

@Araq
Copy link
Member

Araq commented Sep 3, 2023

This doesn't fix the root cause.

@Pylgos Pylgos closed this Sep 4, 2023
@ringabout
Copy link
Member

ringabout commented Sep 4, 2023

I stumbled upon the same problem, just for the record: #20662

@metagn
Copy link
Collaborator

metagn commented Sep 4, 2023

What is the root cause? Is the VM generating nkBracket bad?

@Araq
Copy link
Member

Araq commented Sep 4, 2023

I don't know, but I do know that blindly reseming expressions is not a good solution.

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.

Static seqs are turned into static arrays when passed through template.
4 participants