[ty] Fix more generics-related TODOs#18062
Merged
AlexWaygood merged 1 commit intomainfrom May 14, 2025
Merged
Conversation
AlexWaygood
commented
May 13, 2025
Comment on lines
+2240
to
+2242
| let Type::ClassLiteral(class_literal) = self.to_class_literal(db) else { | ||
| return Type::unknown(); | ||
| }; |
Member
Author
There was a problem hiding this comment.
this was necessary or some custom-typeshed tests started panicking because they couldn't find Exception and ExceptionGroup in the custom typeshed
Comment on lines
+2550
to
+2551
| let class = if symbol_ty | ||
| .is_subtype_of(self.db(), KnownClass::Exception.to_instance(self.db())) |
Member
Author
There was a problem hiding this comment.
using is_subtype_of rather than is_assignable_to here because I think we should infer BaseExceptionGroup rather than ExceptionGroup if symbol_ty is Unknown or similar
Contributor
|
dcreager
approved these changes
May 14, 2025
dcreager
added a commit
that referenced
this pull request
May 14, 2025
…rals * origin/main: [ty] Add type-expression syntax link to invalid-type-expression (#18104) [`flake8-simplify`] add fix safety section (`SIM103`) (#18086) [ty] mypy_primer: fix static-frame setup (#18103) [`flake8-simplify`] Correct behavior for `str.split`/`rsplit` with `maxsplit=0` (`SIM905`) (#18075) [ty] Fix more generics-related TODOs (#18062)
Glyphack
pushed a commit
to Glyphack/ruff
that referenced
this pull request
May 21, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Address various generics-related TODOs by converting
.to_instance()calls into.to_specialized_instance()calls.Test Plan
Existing mdtests updated.