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

Attempt to fix issue with ParamSpec serialization #12654

Merged
merged 1 commit into from Apr 22, 2022
Merged

Commits on Apr 22, 2022

  1. Attempt to fix issue with ParamSpec serialization

    I've seen crashes like this, which might be caused by not
    fixing up some FakeInfos:
    
    ```
      File "mypy/checkexpr.py", line 3981, in accept
      File "mypy/nodes.py", line 1753, in accept
      File "mypy/checkexpr.py", line 288, in visit_call_expr
      File "mypy/checkexpr.py", line 371, in visit_call_expr_inner
      File "mypy/checkexpr.py", line 880, in check_call_expr_with_callee_type
      File "mypy/checkexpr.py", line 940, in check_call
      File "mypy/checkexpr.py", line 1027, in check_callable_call
      File "mypy/checkexpr.py", line 1269, in infer_function_type_arguments
      File "mypy/checkexpr.py", line 1324, in infer_function_type_arguments_pass2
      File "mypy/infer.py", line 47, in infer_function_type_arguments
      File "mypy/constraints.py", line 72, in infer_constraints_for_callable
      File "mypy/constraints.py", line 108, in infer_constraints
      File "mypy/constraints.py", line 181, in _infer_constraints
      File "mypy/types.py", line 1576, in accept
      File "mypy/constraints.py", line 663, in visit_callable_type
      File "mypy/constraints.py", line 685, in infer_against_overloaded
      File "mypy/constraints.py", line 775, in find_matching_overload_item
      File "mypy/subtypes.py", line 942, in is_callable_compatible
      File "mypy/subtypes.py", line 1209, in unify_generic_callable
      File "mypy/applytype.py", line 86, in apply_generic_arguments
      File "mypy/applytype.py", line 50, in get_target_type
      File "mypy/subtypes.py", line 97, in is_subtype
      File "mypy/subtypes.py", line 158, in _is_subtype
      File "mypy/types.py", line 615, in accept
      File "mypy/subtypes.py", line 341, in visit_param_spec
      File "mypy/subtypes.py", line 217, in _is_subtype
      File "mypy/subtypes.py", line 97, in is_subtype
      File "mypy/subtypes.py", line 158, in _is_subtype
      File "mypy/types.py", line 1127, in accept
      File "mypy/subtypes.py", line 257, in visit_instance
    AttributeError: attribute 'fallback_to_any' of 'TypeInfo' undefined
    ```
    
    I don't have a small reproducer to I couldn't add a test case,
    unfortunately.
    JukkaL committed Apr 22, 2022
    Copy the full SHA
    f2fed08 View commit details
    Browse the repository at this point in the history