Skip to content

New semantic analyzer: refactor analysis of assignments #6412

Closed
@ilevkivskyi

Description

@ilevkivskyi

This is a follow-up for #6390

Assignment statements can create a bunch of different symbol nodes:

  • Variable
  • Type alias
  • Type variable
  • Named tuple
  • Typed dict

Because of this current implementation is messy and has some hacks. We should refactor this to happen in two steps:

  • Classify the kind of assignment
  • Perform analysis accordingly for each kind

The tricky corner case is enums: c = Color['Red'] looks like a type alias, but this should create a variable.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions