Fix false positive invalid-type-var for generic functions assigned to attributes (#2204)#2725
Fix false positive invalid-type-var for generic functions assigned to attributes (#2204)#2725yangdanny97 wants to merge 1 commit intofacebook:mainfrom
Conversation
… attributes (facebook#2204) Summary: fixes facebook#2204 Fixed check_and_sanitize_type_parameters to also exclude Forall-bound tparams within the type of the attribute. Differential Revision: D95799931
|
@yangdanny97 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D95799931. |
|
Diff from mypy_primer, showing the effect of this PR on open source code: jinja (https://github.com/pallets/jinja)
- ERROR src/jinja2/environment.py:352:14-21: Attribute `filters` cannot depend on type variable `K`, which is not in the scope of class `Environment` [invalid-type-var]
- ERROR src/jinja2/environment.py:352:14-21: Attribute `filters` cannot depend on type variable `_T`, which is not in the scope of class `Environment` [invalid-type-var]
|
Primer Diff Classification✅ 1 improvement(s) | 1 project(s) total 1 improvement(s) across jinja.
Detailed analysis✅ Improvement (1)jinja (-1)
Was this helpful? React with 👍 or 👎 Classification by primer-classifier (1 LLM) |
rchen152
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
|
This pull request has been merged in e3acc75. |
Summary:
fixes #2204
Fixed check_and_sanitize_type_parameters to also exclude Forall-bound tparams within the type of the attribute.
Differential Revision: D95799931