diff --git a/conformance/results/mypy/specialtypes_promotions.toml b/conformance/results/mypy/specialtypes_promotions.toml index f1a46655..04499e86 100644 --- a/conformance/results/mypy/specialtypes_promotions.toml +++ b/conformance/results/mypy/specialtypes_promotions.toml @@ -1,8 +1,12 @@ -conformant = "Pass" +conformant = "Partial" +notes = """ +Does not narrow from float to int after isinstance() check +""" output = """ specialtypes_promotions.py:17: error: "float" has no attribute "numerator" [attr-defined] -specialtypes_promotions.py:29: error: Incompatible return value type (got "complex", expected "float") [return-value] +specialtypes_promotions.py:33: error: Incompatible return value type (got "complex", expected "float") [return-value] """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 26: Expected 1 errors """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index 9c6b57d3..dc9b55ed 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.10.0" -test_duration = 6.2 +test_duration = 1.5 diff --git a/conformance/results/pyre/specialtypes_promotions.toml b/conformance/results/pyre/specialtypes_promotions.toml index 4d57e8ce..f17ad77f 100644 --- a/conformance/results/pyre/specialtypes_promotions.toml +++ b/conformance/results/pyre/specialtypes_promotions.toml @@ -1,11 +1,13 @@ conformant = "Partial" notes = """ Does not reject use of attribute that is compatible only with float. +Does not narrow from float to int after isinstance() check """ output = """ -specialtypes_promotions.py:29:8 Incompatible return type [7]: Expected `float` but got `complex`. +specialtypes_promotions.py:33:8 Incompatible return type [7]: Expected `float` but got `complex`. """ conformance_automated = "Fail" errors_diff = """ Line 17: Expected 1 errors +Line 26: Expected 1 errors """ diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index 47c7ebcc..1fec89de 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.21" -test_duration = 2.6 +test_duration = 2.9 diff --git a/conformance/results/pyright/specialtypes_promotions.toml b/conformance/results/pyright/specialtypes_promotions.toml index da01e5ad..560cb119 100644 --- a/conformance/results/pyright/specialtypes_promotions.toml +++ b/conformance/results/pyright/specialtypes_promotions.toml @@ -2,7 +2,9 @@ conformant = "Pass" output = """ specialtypes_promotions.py:17:7 - error: Cannot access attribute "numerator" for class "float" Attribute "numerator" is unknown (reportAttributeAccessIssue) -specialtypes_promotions.py:29:16 - error: Expression of type "complex" is incompatible with return type "float" +specialtypes_promotions.py:26:16 - error: Expression of type "Literal['x']" is incompatible with return type "int" + "Literal['x']" is incompatible with "int" (reportReturnType) +specialtypes_promotions.py:33:16 - error: Expression of type "complex" is incompatible with return type "float" "complex" is incompatible with "float" (reportReturnType) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index f2385b55..789c07a2 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ version = "pyright 1.1.364" -test_duration = 1.8 +test_duration = 1.6 diff --git a/conformance/results/pytype/specialtypes_promotions.toml b/conformance/results/pytype/specialtypes_promotions.toml index 89270b31..3d6ee073 100644 --- a/conformance/results/pytype/specialtypes_promotions.toml +++ b/conformance/results/pytype/specialtypes_promotions.toml @@ -1,8 +1,12 @@ -conformant = "Pass" +conformant = "Partial" +notes = """ +Does not narrow from float to int after isinstance() check +""" output = """ File "specialtypes_promotions.py", line 17, in func1: No attribute 'numerator' on float [attribute-error] -File "specialtypes_promotions.py", line 29, in func2: bad return type [bad-return-type] +File "specialtypes_promotions.py", line 33, in func2: bad return type [bad-return-type] """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 26: Expected 1 errors """ diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index 4c23eb4b..bbfb29cd 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.04.11" -test_duration = 54.5 +test_duration = 49.8 diff --git a/conformance/results/results.html b/conformance/results/results.html index e0a66c34..bc90bed9 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,16 +159,16 @@
mypy 1.10.0
-6.2sec
+1.5sec
|
pyright 1.1.364
-1.8sec
+1.6sec
|
pyre 0.9.21
-2.6sec
+2.9sec
|
pytype 2024.04.11
-54.5sec
+49.8sec
|
|
---|---|---|---|---|
diff --git a/conformance/tests/specialtypes_promotions.py b/conformance/tests/specialtypes_promotions.py index 64e728cf..0216337d 100644 --- a/conformance/tests/specialtypes_promotions.py +++ b/conformance/tests/specialtypes_promotions.py @@ -13,13 +13,17 @@ v4 = 1 -def func1(f: float): +def func1(f: float) -> int: f.numerator # E: attribute exists on int but not float if isinstance(f, float): f.hex() # OK (attribute exists on float but not int) + return 1 else: assert_type(f, int) + # Make sure type checkers don't treat this branch as unreachable + # and skip checking it. + return "x" # E def func2(x: int) -> float: |