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

make type contexts mostly shallow #379

Merged
merged 1 commit into from
Jan 17, 2025
Merged

Conversation

metagn
Copy link
Collaborator

@metagn metagn commented Jan 17, 2025

TypeDeclContext is used to track if:

  • nominal types can be declared, i.e. the type expression is the direct value of a type symbol declaration
  • the type . is valid, either as void for return types or the lack of a constraint for generic params
  • the standalone symbols array/range/set can be turned into typeclasses of the respective type, checks for a constraint context but should probably be separated

These are mostly shallow checks, so contexts are no longer propagated in general. The only cases where they're still propagated are:

  • ParX
  • or/and types, these could also use InGenericConstraint or some other typeclass context too
  • inlined type symbols (not symbols produced by semInvoke which use InLocalDecl which could be changed too but in another PR)

The unused fields of TypeDeclContext are removed in case they weren't meant to be shallow.

@Araq Araq merged commit a8388af into nim-lang:master Jan 17, 2025
3 checks passed
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.

2 participants