@@ -2217,28 +2217,40 @@ _testDictOrUnionEdgeCases.py:10: note: Revealed type is "dict[str, dict[str, ...
22172217# flags: --strict-equality --warn-unreachable
22182218from typing import Mapping, AbstractSet
22192219
2220- def f1(x: Mapping[str, int]) -> None:
2220+ def f1(x: Mapping[str, int], y: dict[str, int] ) -> None:
22212221 if isinstance(x, dict):
22222222 reveal_type(x)
22232223
2224+ if x == y:
2225+ reveal_type(x)
2226+ reveal_type(y)
2227+
22242228 if x == {}:
22252229 reveal_type(x)
22262230
2227- def f2(x: AbstractSet[int]) -> None:
2231+ def f2(x: AbstractSet[int], y: set[int] ) -> None:
22282232 if isinstance(x, set):
22292233 reveal_type(x)
22302234
2235+ if x == y:
2236+ reveal_type(x)
2237+ reveal_type(y)
2238+
22312239 if x == set():
22322240 reveal_type(x)
22332241
2234- def f3(x: frozenset[str ], y: set[str ]):
2242+ def f3(x: frozenset[int ], y: set[int ]):
22352243 if x == y:
22362244 reveal_type(x)
22372245 reveal_type(y)
22382246[out]
22392247_testNarrowingMappingAndAbstractSet.py:6: note: Revealed type is "dict[Any, Any]"
22402248_testNarrowingMappingAndAbstractSet.py:9: note: Revealed type is "typing.Mapping[str, int]"
2241- _testNarrowingMappingAndAbstractSet.py:13: note: Revealed type is "set[Any]"
2242- _testNarrowingMappingAndAbstractSet.py:16: note: Revealed type is "typing.AbstractSet[int]"
2243- _testNarrowingMappingAndAbstractSet.py:20: note: Revealed type is "frozenset[str]"
2244- _testNarrowingMappingAndAbstractSet.py:21: note: Revealed type is "set[str]"
2249+ _testNarrowingMappingAndAbstractSet.py:10: note: Revealed type is "dict[str, int]"
2250+ _testNarrowingMappingAndAbstractSet.py:13: note: Revealed type is "typing.Mapping[str, int]"
2251+ _testNarrowingMappingAndAbstractSet.py:17: note: Revealed type is "set[Any]"
2252+ _testNarrowingMappingAndAbstractSet.py:20: note: Revealed type is "typing.AbstractSet[int]"
2253+ _testNarrowingMappingAndAbstractSet.py:21: note: Revealed type is "set[int]"
2254+ _testNarrowingMappingAndAbstractSet.py:24: note: Revealed type is "typing.AbstractSet[int]"
2255+ _testNarrowingMappingAndAbstractSet.py:28: note: Revealed type is "frozenset[int]"
2256+ _testNarrowingMappingAndAbstractSet.py:29: note: Revealed type is "set[int]"
0 commit comments