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

Attempt to fix issue with ParamSpec serialization #12654

merged 1 commit into from Apr 22, 2022

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Apr 22, 2022

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.

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.
@github-actions
Copy link

@github-actions github-actions bot commented Apr 22, 2022

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@JukkaL JukkaL merged commit 07ea0f6 into master Apr 22, 2022
15 checks passed
@JukkaL JukkaL deleted the fixup-paramspec branch Apr 22, 2022
JukkaL added a commit that referenced this issue Apr 22, 2022
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
Copy link
Collaborator Author

@JukkaL JukkaL commented Apr 22, 2022

I was able to verify manually that this seems to fix the crash.

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.

None yet

1 participant