Skip to content

Conversation

metagn
Copy link
Collaborator

@metagn metagn commented Jun 17, 2023

else:
if efDetermineType in flags and c.inGenericContext > 0 and c.matchedConcept == nil:
result = n
result = semGenericStmt(c, n)
Copy link
Member

Choose a reason for hiding this comment

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

What? Why?

@Araq
Copy link
Member

Araq commented Jun 17, 2023

Seems to go into the wrong direction. What commit caused this regression? What else can we do about it?

@metagn
Copy link
Collaborator Author

metagn commented Jun 17, 2023

#22029 caused it, basically a tyFromExpr node that uses a private symbol and is instantiated from another module doesn't find that symbol.

Used semGenericStmt because it solves this scoping issue by resolving the symbol, and is already used here in semtypes for generic proc default values and there's also this use which also calls makeTypeFromExpr but I don't really know what it does.

Don't really know another solution. I guess we could also always use semGenericStmt for range/array/when parameters in generic types but this is a radical change.

@Araq
Copy link
Member

Araq commented Jun 17, 2023

Fine.

@Araq Araq added the merge_when_passes_CI mergeable once green label Jun 17, 2023
@ringabout ringabout merged commit 6d21637 into nim-lang:devel Jun 17, 2023
@github-actions
Copy link
Contributor

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

Hint: mm: orc; opt: speed; options: -d:release
167989 lines; 8.773s; 611.016MiB peakmem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge_when_passes_CI mergeable once green
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants