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

[red-knot]: Implement HasTy for Alias #11971

Draft
wants to merge 2 commits into
base: semantic-model-api
Choose a base branch
from

Conversation

MichaReiser
Copy link
Member

Summary

This PR implements HasTy for Alias as a preparation to implement the bad-imports lint rules.

The bad-imports lint rule tests if an import resolves to Unbound. This requires querying querying the type of a specific import-item.
The way this is done in this PR is to change AstIds to not track Statements but instead have a Definitions map, so that we also get IDs for import definitions (and allocate fewer IDs in total).

Test Plan

Implemented the bad-overrides lint rule on top of the new API

@MichaReiser MichaReiser marked this pull request as draft June 21, 2024 16:11
@MichaReiser MichaReiser added the red-knot Multi-file analysis & type inference label Jun 21, 2024
@MichaReiser
Copy link
Member Author

This is a draft PR because it requires more documentation and some of the implementation feels errorprone.

@MichaReiser MichaReiser changed the base branch from main to semantic-model-api June 21, 2024 16:14
Copy link
Contributor

github-actions bot commented Jun 21, 2024

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@MichaReiser MichaReiser force-pushed the alias-has-type branch 2 times, most recently from dad786e to 86ec41f Compare June 22, 2024 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
red-knot Multi-file analysis & type inference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant