Skip to content

Commit 5e7771f

Browse files
committed
Get rid of xfail
1 parent a1d4db8 commit 5e7771f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

test-data/unit/check-inference.test

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3776,15 +3776,23 @@ f(x, empty) # E: Cannot infer value of type parameter "T" of "f"
37763776
f(["no"], empty) # E: Cannot infer value of type parameter "T" of "f"
37773777
[builtins fixtures/list.pyi]
37783778

3779-
[case testInferenceWorksWithEmptyCollectionsUnion-xfail]
3779+
[case testInferenceWorksWithEmptyCollectionsUnion]
37803780
from typing import Any, Dict, NoReturn, NoReturn, Union
37813781

37823782
def foo() -> Union[Dict[str, Any], Dict[int, Any]]:
37833783
return {}
3784+
[builtins fixtures/dict.pyi]
3785+
3786+
[case testExistingEmptyCollectionDoesNotUpcast]
3787+
from typing import Any, Dict, NoReturn, NoReturn, Union
37843788

37853789
empty: Dict[NoReturn, NoReturn]
3790+
3791+
def foo() -> Dict[str, Any]:
3792+
return empty # E: Incompatible return value type (got "dict[Never, Never]", expected "dict[str, Any]")
3793+
37863794
def bar() -> Union[Dict[str, Any], Dict[int, Any]]:
3787-
return empty
3795+
return empty # E: Incompatible return value type (got "dict[Never, Never]", expected "Union[dict[str, Any], dict[int, Any]]")
37883796
[builtins fixtures/dict.pyi]
37893797

37903798
[case testUpperBoundInferenceFallbackNotOverused]

0 commit comments

Comments
 (0)