Fix incorrect join in the presence of Any fallback
Fixes #11925
This avoids mypy from guessing subtype relationships because of the any fallback over here: https://github.com/python/mypy/blob/e1bfb75ed2187db76d51ed875ce953da3ba4d02c/mypy/subtypes.py#L438
Diff from mypy_primer, showing the effect of this PR on open source code:
kornia (https://github.com/kornia/kornia)
- kornia/nerf/nerf_model.py:121: error: "object" not callable [operator]
cc @ilevkivskyi could you review? The check_context assertion comes from https://github.com/python/mypy/pull/13303 , as far as I can see no changes are required for ignore_type_params=True, but I might be missing something
Diff from mypy_primer, showing the effect of this PR on open source code:
kornia (https://github.com/kornia/kornia)
- kornia/nerf/nerf_model.py:121: error: "object" not callable [operator]
I finally got some time to think about this. In general, those asserts were added when two visitors were merged to prevent accidentally going through previously completely untested code paths. Also I don't really like ignore_type_params for proper subtypes, but after all I think it is not a big deal, so if this doesn't cause problems, let's just keep this.