Skip to content

New semantic analyzer: only create each SymbolNode once #6300

@JukkaL

Description

@JukkaL

Currently we can create a symbol node multiple times (once per iteration), which is risky since we don't want to risk having different references to a particular name pointing to different nodes. For example, class-based TypedDict definitions may create multiple TypeInfo objects per definition.

I think that for most things we can treat the definition as complete once we've successfully created a symbol table node, and further iterations would skip the definition, as there's nothing more to do.

Normal class definitions should not have this problem, but we should verify that these work as expected:

  • Var nodes
  • TypedDict (as discussed above)
  • Named tuples
  • Type variables
  • Type aliases
  • NewTypes
  • Enums

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions