PY-86002 Revert also PY-25989 PY-84544 to fix new test failures after the revert to weak unions

Namely, `generics_basic.py` in the conformance test suite and
Py3TypeCheckerInspectionTest.testTypeVarWidening.

Revert 07803c6243370d55df0d870e2e32b38170c1fb49


(cherry picked from commit 9c334ef32597be1d1e8fbc3251ac267be46555c8)

IJ-MR-184619

GitOrigin-RevId: 4b2440c973d9c7a7a42590665bd473c4e7a4c9cf
This commit is contained in:
Mikhail Golubev
2025-12-03 20:58:50 +00:00
committed by intellij-monorepo-bot
parent 7c1fa29f39
commit 060b900cf9
4 changed files with 20 additions and 81 deletions
@@ -40,11 +40,7 @@ def test():
print(result)
print(result + <warning descr="Expected type 'int', got 'str' instead">'foo'</warning>)
# Bug: Expected error.
# Generics are considered to be covariant.
# I.e. `list[str]` is assignable to `list[int | str]`.
# Thus, substitution `T` -> `int | str` is considered valid.
f2(1, ['foo'], 'bar')
f2(1, <warning descr="Expected type 'List[int]' (matched generic type 'List[T]'), got 'List[str]' instead">['foo']</warning>, 'bar')
result = f3(1, 'foo', True)
f4(<warning descr="Expected type 'Tuple[bool, int, str]', got 'Tuple[int, str, bool]' instead">result</warning>)