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

fix(11090): skip translate_dict_call when type alias dict call #11246

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hi-ogawa
Copy link
Contributor

@hi-ogawa hi-ogawa commented Oct 2, 2021

Description

Fixes #11093

I explained what I analyzed about the issue in the comment #11093 (comment), so I would appreciate if someone could take a loot at it together with this PR.

Clearly, my fix is nothing but a workaround for the specific case in the issue, but surprisingly there is no regression in exisiting tests. So, I made this PR anyway as a starting point to ask some opinions about the issue itself. (Also, maybe CI will show me some regression).

It's highly likely that I'm missing some important use of SemanticAnalyzer.translate_dict_call, but I couldn't figure it out by myself.

Thanks a lot for the review!

Test Plan

I added new tests in check-type-aliases.test:

  • testTypeAliasDictNoVarAnnotatedError,
  • testTypeAliasListNoVarAnnotatedError.

I think the relevant existing tests are mostly in check-typeddict.test and especially this test case:

  • testCanCreateTypedDictInstanceWithDictCall.

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.

Need type annotation for predefined dict generic (3.9)
1 participant