From c60cd7004ab2fbe91db47ddba2d0da8f70d9671a Mon Sep 17 00:00:00 2001 From: Zeina Migeed Date: Wed, 23 Oct 2024 17:42:38 -0700 Subject: [PATCH 1/2] add missing return type to generic_syntax_infer_variance.py --- .../mypy/generics_syntax_infer_variance.toml | 235 +++++++++--------- conformance/results/mypy/version.toml | 2 +- .../pyre/generics_syntax_infer_variance.toml | 36 +-- conformance/results/pyre/version.toml | 2 +- .../generics_syntax_infer_variance.toml | 42 ++-- conformance/results/pyright/version.toml | 2 +- .../generics_syntax_infer_variance.toml | 34 +-- .../results/pytype/specialtypes_never.toml | 7 +- conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 8 +- .../tests/generics_syntax_infer_variance.py | 22 +- 11 files changed, 202 insertions(+), 190 deletions(-) diff --git a/conformance/results/mypy/generics_syntax_infer_variance.toml b/conformance/results/mypy/generics_syntax_infer_variance.toml index 1db3d4a8..6642df62 100644 --- a/conformance/results/mypy/generics_syntax_infer_variance.toml +++ b/conformance/results/mypy/generics_syntax_infer_variance.toml @@ -3,132 +3,139 @@ notes = """ Type parameter syntax not yet support. """ output = """ -generics_syntax_infer_variance.py:11: error: Unexpected argument to "TypeVar()": "infer_variance" [misc] generics_syntax_infer_variance.py:12: error: Unexpected argument to "TypeVar()": "infer_variance" [misc] generics_syntax_infer_variance.py:13: error: Unexpected argument to "TypeVar()": "infer_variance" [misc] -generics_syntax_infer_variance.py:15: error: Unexpected argument to "TypeVar()": "infer_variance" [misc] -generics_syntax_infer_variance.py:17: error: Unexpected argument to "TypeVar()": "infer_variance" [misc] -generics_syntax_infer_variance.py:20: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:21: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:21: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:24: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:24: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:28: error: "ShouldBeCovariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:28: error: The type "type[ShouldBeCovariant1]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:29: error: "ShouldBeCovariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:29: error: The type "type[ShouldBeCovariant1]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:32: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:32: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:36: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:36: error: The type "type[ShouldBeCovariant2]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:37: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:37: error: The type "type[ShouldBeCovariant2]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:40: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:41: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:41: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:41: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:45: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:45: error: The type "type[ShouldBeCovariant3]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:46: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:46: error: The type "type[ShouldBeCovariant3]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:50: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:51: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:51: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:65: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:66: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:66: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:70: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:70: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:74: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:74: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:75: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:75: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:78: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:79: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:79: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:14: error: Unexpected argument to "TypeVar()": "infer_variance" [misc] +generics_syntax_infer_variance.py:16: error: Unexpected argument to "TypeVar()": "infer_variance" [misc] +generics_syntax_infer_variance.py:20: error: Unexpected argument to "TypeVar()": "infer_variance" [misc] +generics_syntax_infer_variance.py:25: error: Free type variable expected in Generic[...] [misc] +generics_syntax_infer_variance.py:26: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:26: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:28: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:28: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:31: error: "ShouldBeCovariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:31: error: The type "type[ShouldBeCovariant1]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:32: error: "ShouldBeCovariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:32: error: The type "type[ShouldBeCovariant1]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:35: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:35: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:39: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:39: error: The type "type[ShouldBeCovariant2]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:40: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:40: error: The type "type[ShouldBeCovariant2]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:43: error: Free type variable expected in Generic[...] [misc] +generics_syntax_infer_variance.py:44: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:44: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:44: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:47: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:47: error: The type "type[ShouldBeCovariant3]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:48: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:48: error: The type "type[ShouldBeCovariant3]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:52: error: Free type variable expected in Generic[...] [misc] +generics_syntax_infer_variance.py:53: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:53: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:67: error: Free type variable expected in Generic[...] [misc] +generics_syntax_infer_variance.py:68: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:68: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:72: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:72: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:76: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:76: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:77: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:77: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:80: error: Free type variable expected in Generic[...] [misc] generics_syntax_infer_variance.py:81: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] generics_syntax_infer_variance.py:81: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:85: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:85: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:86: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:86: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:89: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:90: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:90: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:98: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:98: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:102: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:102: error: The type "type[ShouldBeInvariant1]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:103: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:103: error: The type "type[ShouldBeInvariant1]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:106: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:107: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:107: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:110: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:110: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:113: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:113: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:117: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:117: error: The type "type[ShouldBeInvariant2]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:118: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:118: error: The type "type[ShouldBeInvariant2]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:121: error: Variable "generics_syntax_infer_variance.K" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:121: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:121: error: Variable "generics_syntax_infer_variance.V" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:125: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] -generics_syntax_infer_variance.py:125: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:126: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] -generics_syntax_infer_variance.py:126: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:83: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:83: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:87: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:87: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:88: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:88: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:91: error: Free type variable expected in Generic[...] [misc] +generics_syntax_infer_variance.py:92: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:92: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:96: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:96: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:100: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:100: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:104: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:104: error: The type "type[ShouldBeInvariant1]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:105: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:105: error: The type "type[ShouldBeInvariant1]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:108: error: Free type variable expected in Generic[...] [misc] +generics_syntax_infer_variance.py:109: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:109: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:112: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:112: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:115: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:115: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:119: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:119: error: The type "type[ShouldBeInvariant2]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:120: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:120: error: The type "type[ShouldBeInvariant2]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:123: error: Variable "generics_syntax_infer_variance.K" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:123: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:123: error: Variable "generics_syntax_infer_variance.V" is not valid as a type [valid-type] generics_syntax_infer_variance.py:127: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] generics_syntax_infer_variance.py:127: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] generics_syntax_infer_variance.py:128: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] generics_syntax_infer_variance.py:128: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:136: error: Incompatible types in assignment (expression has type "ShouldBeInvariant4[int]", variable has type "ShouldBeInvariant4[float]") [assignment] -generics_syntax_infer_variance.py:144: error: Incompatible types in assignment (expression has type "ShouldBeInvariant5[int]", variable has type "ShouldBeInvariant5[float]") [assignment] -generics_syntax_infer_variance.py:147: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:148: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:148: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:151: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:151: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:155: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:155: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:156: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:156: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:129: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] +generics_syntax_infer_variance.py:129: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:130: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] +generics_syntax_infer_variance.py:130: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:138: error: Incompatible types in assignment (expression has type "ShouldBeInvariant4[int]", variable has type "ShouldBeInvariant4[float]") [assignment] +generics_syntax_infer_variance.py:146: error: Incompatible types in assignment (expression has type "ShouldBeInvariant5[int]", variable has type "ShouldBeInvariant5[float]") [assignment] +generics_syntax_infer_variance.py:149: error: Free type variable expected in Generic[...] [misc] +generics_syntax_infer_variance.py:150: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:150: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:153: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:153: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:157: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:157: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:158: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:158: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc] """ conformance_automated = "Fail" errors_diff = """ -Line 11: Unexpected errors ['generics_syntax_infer_variance.py:11: error: Unexpected argument to "TypeVar()": "infer_variance" [misc]'] +Line 18: Expected 1 errors +Line 22: Expected 1 errors Line 12: Unexpected errors ['generics_syntax_infer_variance.py:12: error: Unexpected argument to "TypeVar()": "infer_variance" [misc]'] Line 13: Unexpected errors ['generics_syntax_infer_variance.py:13: error: Unexpected argument to "TypeVar()": "infer_variance" [misc]'] -Line 20: Unexpected errors ['generics_syntax_infer_variance.py:20: error: Free type variable expected in Generic[...] [misc]'] -Line 21: Unexpected errors ['generics_syntax_infer_variance.py:21: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 24: Unexpected errors ['generics_syntax_infer_variance.py:24: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 28: Unexpected errors ['generics_syntax_infer_variance.py:28: error: "ShouldBeCovariant1" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:28: error: The type "type[ShouldBeCovariant1]" is not generic and not indexable [misc]'] -Line 32: Unexpected errors ['generics_syntax_infer_variance.py:32: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 36: Unexpected errors ['generics_syntax_infer_variance.py:36: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:36: error: The type "type[ShouldBeCovariant2]" is not generic and not indexable [misc]'] -Line 40: Unexpected errors ['generics_syntax_infer_variance.py:40: error: Free type variable expected in Generic[...] [misc]'] -Line 41: Unexpected errors ['generics_syntax_infer_variance.py:41: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]', 'generics_syntax_infer_variance.py:41: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg]'] -Line 45: Unexpected errors ['generics_syntax_infer_variance.py:45: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:45: error: The type "type[ShouldBeCovariant3]" is not generic and not indexable [misc]'] -Line 50: Unexpected errors ['generics_syntax_infer_variance.py:50: error: Free type variable expected in Generic[...] [misc]'] -Line 51: Unexpected errors ['generics_syntax_infer_variance.py:51: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 65: Unexpected errors ['generics_syntax_infer_variance.py:65: error: Free type variable expected in Generic[...] [misc]'] -Line 66: Unexpected errors ['generics_syntax_infer_variance.py:66: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 70: Unexpected errors ['generics_syntax_infer_variance.py:70: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 74: Unexpected errors ['generics_syntax_infer_variance.py:74: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:74: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc]'] -Line 78: Unexpected errors ['generics_syntax_infer_variance.py:78: error: Free type variable expected in Generic[...] [misc]'] -Line 79: Unexpected errors ['generics_syntax_infer_variance.py:79: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 14: Unexpected errors ['generics_syntax_infer_variance.py:14: error: Unexpected argument to "TypeVar()": "infer_variance" [misc]'] +Line 16: Unexpected errors ['generics_syntax_infer_variance.py:16: error: Unexpected argument to "TypeVar()": "infer_variance" [misc]'] +Line 20: Unexpected errors ['generics_syntax_infer_variance.py:20: error: Unexpected argument to "TypeVar()": "infer_variance" [misc]'] +Line 25: Unexpected errors ['generics_syntax_infer_variance.py:25: error: Free type variable expected in Generic[...] [misc]'] +Line 26: Unexpected errors ['generics_syntax_infer_variance.py:26: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 28: Unexpected errors ['generics_syntax_infer_variance.py:28: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 31: Unexpected errors ['generics_syntax_infer_variance.py:31: error: "ShouldBeCovariant1" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:31: error: The type "type[ShouldBeCovariant1]" is not generic and not indexable [misc]'] +Line 35: Unexpected errors ['generics_syntax_infer_variance.py:35: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 39: Unexpected errors ['generics_syntax_infer_variance.py:39: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:39: error: The type "type[ShouldBeCovariant2]" is not generic and not indexable [misc]'] +Line 43: Unexpected errors ['generics_syntax_infer_variance.py:43: error: Free type variable expected in Generic[...] [misc]'] +Line 44: Unexpected errors ['generics_syntax_infer_variance.py:44: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]', 'generics_syntax_infer_variance.py:44: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg]'] +Line 47: Unexpected errors ['generics_syntax_infer_variance.py:47: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:47: error: The type "type[ShouldBeCovariant3]" is not generic and not indexable [misc]'] +Line 52: Unexpected errors ['generics_syntax_infer_variance.py:52: error: Free type variable expected in Generic[...] [misc]'] +Line 53: Unexpected errors ['generics_syntax_infer_variance.py:53: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 67: Unexpected errors ['generics_syntax_infer_variance.py:67: error: Free type variable expected in Generic[...] [misc]'] +Line 68: Unexpected errors ['generics_syntax_infer_variance.py:68: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 72: Unexpected errors ['generics_syntax_infer_variance.py:72: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 76: Unexpected errors ['generics_syntax_infer_variance.py:76: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:76: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc]'] +Line 80: Unexpected errors ['generics_syntax_infer_variance.py:80: error: Free type variable expected in Generic[...] [misc]'] Line 81: Unexpected errors ['generics_syntax_infer_variance.py:81: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 85: Unexpected errors ['generics_syntax_infer_variance.py:85: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:85: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc]'] -Line 89: Unexpected errors ['generics_syntax_infer_variance.py:89: error: Free type variable expected in Generic[...] [misc]'] -Line 90: Unexpected errors ['generics_syntax_infer_variance.py:90: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 98: Unexpected errors ['generics_syntax_infer_variance.py:98: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 106: Unexpected errors ['generics_syntax_infer_variance.py:106: error: Free type variable expected in Generic[...] [misc]'] -Line 107: Unexpected errors ['generics_syntax_infer_variance.py:107: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 110: Unexpected errors ['generics_syntax_infer_variance.py:110: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 113: Unexpected errors ['generics_syntax_infer_variance.py:113: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 121: Unexpected errors ['generics_syntax_infer_variance.py:121: error: Variable "generics_syntax_infer_variance.K" is not valid as a type [valid-type]', 'generics_syntax_infer_variance.py:121: error: Variable "generics_syntax_infer_variance.V" is not valid as a type [valid-type]'] -Line 147: Unexpected errors ['generics_syntax_infer_variance.py:147: error: Free type variable expected in Generic[...] [misc]'] -Line 148: Unexpected errors ['generics_syntax_infer_variance.py:148: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 151: Unexpected errors ['generics_syntax_infer_variance.py:151: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 156: Unexpected errors ['generics_syntax_infer_variance.py:156: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:156: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc]'] +Line 83: Unexpected errors ['generics_syntax_infer_variance.py:83: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 87: Unexpected errors ['generics_syntax_infer_variance.py:87: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:87: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc]'] +Line 91: Unexpected errors ['generics_syntax_infer_variance.py:91: error: Free type variable expected in Generic[...] [misc]'] +Line 92: Unexpected errors ['generics_syntax_infer_variance.py:92: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 96: Unexpected errors ['generics_syntax_infer_variance.py:96: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 100: Unexpected errors ['generics_syntax_infer_variance.py:100: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 108: Unexpected errors ['generics_syntax_infer_variance.py:108: error: Free type variable expected in Generic[...] [misc]'] +Line 109: Unexpected errors ['generics_syntax_infer_variance.py:109: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 112: Unexpected errors ['generics_syntax_infer_variance.py:112: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 115: Unexpected errors ['generics_syntax_infer_variance.py:115: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 123: Unexpected errors ['generics_syntax_infer_variance.py:123: error: Variable "generics_syntax_infer_variance.K" is not valid as a type [valid-type]', 'generics_syntax_infer_variance.py:123: error: Variable "generics_syntax_infer_variance.V" is not valid as a type [valid-type]'] +Line 149: Unexpected errors ['generics_syntax_infer_variance.py:149: error: Free type variable expected in Generic[...] [misc]'] +Line 150: Unexpected errors ['generics_syntax_infer_variance.py:150: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 153: Unexpected errors ['generics_syntax_infer_variance.py:153: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 158: Unexpected errors ['generics_syntax_infer_variance.py:158: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:158: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc]'] """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index 6f12777c..05391ed1 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.13.0" -test_duration = 1.5 +test_duration = 2.4 diff --git a/conformance/results/pyre/generics_syntax_infer_variance.toml b/conformance/results/pyre/generics_syntax_infer_variance.toml index 7a848658..6a0b74af 100644 --- a/conformance/results/pyre/generics_syntax_infer_variance.toml +++ b/conformance/results/pyre/generics_syntax_infer_variance.toml @@ -3,27 +3,27 @@ notes = """ Type parameter syntax not yet support. """ output = """ -generics_syntax_infer_variance.py:132:25 Parsing failure [404]: invalid syntax +generics_syntax_infer_variance.py:134:25 Parsing failure [404]: invalid syntax """ conformance_automated = "Fail" errors_diff = """ -Line 15: Expected 1 errors -Line 17: Expected 1 errors -Line 29: Expected 1 errors -Line 37: Expected 1 errors -Line 46: Expected 1 errors -Line 75: Expected 1 errors -Line 86: Expected 1 errors -Line 102: Expected 1 errors -Line 103: Expected 1 errors -Line 117: Expected 1 errors -Line 118: Expected 1 errors -Line 125: Expected 1 errors -Line 126: Expected 1 errors +Line 18: Expected 1 errors +Line 22: Expected 1 errors +Line 32: Expected 1 errors +Line 40: Expected 1 errors +Line 48: Expected 1 errors +Line 77: Expected 1 errors +Line 88: Expected 1 errors +Line 104: Expected 1 errors +Line 105: Expected 1 errors +Line 119: Expected 1 errors +Line 120: Expected 1 errors Line 127: Expected 1 errors Line 128: Expected 1 errors -Line 136: Expected 1 errors -Line 144: Expected 1 errors -Line 155: Expected 1 errors -Line 132: Unexpected errors ['generics_syntax_infer_variance.py:132:25 Parsing failure [404]: invalid syntax'] +Line 129: Expected 1 errors +Line 130: Expected 1 errors +Line 138: Expected 1 errors +Line 146: Expected 1 errors +Line 157: Expected 1 errors +Line 134: Unexpected errors ['generics_syntax_infer_variance.py:134:25 Parsing failure [404]: invalid syntax'] """ diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index 48f19eaa..17b803bf 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.22" -test_duration = 4.4 +test_duration = 6.1 diff --git a/conformance/results/pyright/generics_syntax_infer_variance.toml b/conformance/results/pyright/generics_syntax_infer_variance.toml index b23985d5..d45181e3 100644 --- a/conformance/results/pyright/generics_syntax_infer_variance.toml +++ b/conformance/results/pyright/generics_syntax_infer_variance.toml @@ -1,62 +1,66 @@ conformant = "Pass" output = """ -generics_syntax_infer_variance.py:15:51 - error: TypeVar cannot be both covariant and contravariant (reportGeneralTypeIssues) -generics_syntax_infer_variance.py:17:55 - error: TypeVar cannot be both covariant and contravariant (reportGeneralTypeIssues) -generics_syntax_infer_variance.py:29:35 - error: Type "ShouldBeCovariant1[float]" is not assignable to declared type "ShouldBeCovariant1[int]" +generics_syntax_infer_variance.py:17:42 - error: TypeVar cannot be both covariant and contravariant (reportGeneralTypeIssues) +generics_syntax_infer_variance.py:21:46 - error: TypeVar cannot be both covariant and contravariant (reportGeneralTypeIssues) +generics_syntax_infer_variance.py:32:35 - error: Type "ShouldBeCovariant1[float]" is not assignable to declared type "ShouldBeCovariant1[int]"   "ShouldBeCovariant1[float]" is not assignable to "ShouldBeCovariant1[int]"     Type parameter "T@ShouldBeCovariant1" is covariant, but "float" is not a subtype of "int"       "float" is not assignable to "int" (reportAssignmentType) -generics_syntax_infer_variance.py:37:35 - error: Type "ShouldBeCovariant2[float]" is not assignable to declared type "ShouldBeCovariant2[int]" +generics_syntax_infer_variance.py:40:35 - error: Type "ShouldBeCovariant2[float]" is not assignable to declared type "ShouldBeCovariant2[int]"   "ShouldBeCovariant2[float]" is not assignable to "ShouldBeCovariant2[int]"     Type parameter "T@ShouldBeCovariant2" is covariant, but "float" is not a subtype of "int"       "float" is not assignable to "int" (reportAssignmentType) -generics_syntax_infer_variance.py:46:35 - error: Type "ShouldBeCovariant3[float]" is not assignable to declared type "ShouldBeCovariant3[int]" +generics_syntax_infer_variance.py:48:35 - error: Type "ShouldBeCovariant3[float]" is not assignable to declared type "ShouldBeCovariant3[int]"   "ShouldBeCovariant3[float]" is not assignable to "ShouldBeCovariant3[int]"     Type parameter "T@ShouldBeCovariant3" is covariant, but "float" is not a subtype of "int"       "float" is not assignable to "int" (reportAssignmentType) -generics_syntax_infer_variance.py:75:34 - error: Type "ShouldBeCovariant5[float]" is not assignable to declared type "ShouldBeCovariant5[int]" +generics_syntax_infer_variance.py:77:34 - error: Type "ShouldBeCovariant5[float]" is not assignable to declared type "ShouldBeCovariant5[int]"   "ShouldBeCovariant5[float]" is not assignable to "ShouldBeCovariant5[int]"     Type parameter "T@ShouldBeCovariant5" is covariant, but "float" is not a subtype of "int"       "float" is not assignable to "int" (reportAssignmentType) -generics_syntax_infer_variance.py:86:34 - error: Type "ShouldBeCovariant6[float]" is not assignable to declared type "ShouldBeCovariant6[int]" +generics_syntax_infer_variance.py:88:34 - error: Type "ShouldBeCovariant6[float]" is not assignable to declared type "ShouldBeCovariant6[int]"   "ShouldBeCovariant6[float]" is not assignable to "ShouldBeCovariant6[int]"     Type parameter "T@ShouldBeCovariant6" is covariant, but "float" is not a subtype of "int"       "float" is not assignable to "int" (reportAssignmentType) -generics_syntax_infer_variance.py:102:38 - error: Type "ShouldBeInvariant1[int]" is not assignable to declared type "ShouldBeInvariant1[float]" +generics_syntax_infer_variance.py:104:38 - error: Type "ShouldBeInvariant1[int]" is not assignable to declared type "ShouldBeInvariant1[float]"   "ShouldBeInvariant1[int]" is not assignable to "ShouldBeInvariant1[float]"     Type parameter "T@ShouldBeInvariant1" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_syntax_infer_variance.py:103:36 - error: Type "ShouldBeInvariant1[float]" is not assignable to declared type "ShouldBeInvariant1[int]" +generics_syntax_infer_variance.py:105:36 - error: Type "ShouldBeInvariant1[float]" is not assignable to declared type "ShouldBeInvariant1[int]"   "ShouldBeInvariant1[float]" is not assignable to "ShouldBeInvariant1[int]"     Type parameter "T@ShouldBeInvariant1" is invariant, but "float" is not the same as "int" (reportAssignmentType) -generics_syntax_infer_variance.py:117:38 - error: Type "ShouldBeInvariant2[int]" is not assignable to declared type "ShouldBeInvariant2[float]" +generics_syntax_infer_variance.py:119:38 - error: Type "ShouldBeInvariant2[int]" is not assignable to declared type "ShouldBeInvariant2[float]"   "ShouldBeInvariant2[int]" is not assignable to "ShouldBeInvariant2[float]"     Type parameter "T@ShouldBeInvariant2" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_syntax_infer_variance.py:118:36 - error: Type "ShouldBeInvariant2[float]" is not assignable to declared type "ShouldBeInvariant2[int]" +generics_syntax_infer_variance.py:120:36 - error: Type "ShouldBeInvariant2[float]" is not assignable to declared type "ShouldBeInvariant2[int]"   "ShouldBeInvariant2[float]" is not assignable to "ShouldBeInvariant2[int]"     Type parameter "T@ShouldBeInvariant2" is invariant, but "float" is not the same as "int" (reportAssignmentType) -generics_syntax_infer_variance.py:125:43 - error: Type "ShouldBeInvariant3[int, str]" is not assignable to declared type "ShouldBeInvariant3[float, str]" +generics_syntax_infer_variance.py:127:43 - error: Type "ShouldBeInvariant3[int, str]" is not assignable to declared type "ShouldBeInvariant3[float, str]"   "ShouldBeInvariant3[int, str]" is not assignable to "ShouldBeInvariant3[float, str]"     Type parameter "K@ShouldBeInvariant3" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_syntax_infer_variance.py:126:41 - error: Type "ShouldBeInvariant3[float, str]" is not assignable to declared type "ShouldBeInvariant3[int, str]" +generics_syntax_infer_variance.py:128:41 - error: Type "ShouldBeInvariant3[float, str]" is not assignable to declared type "ShouldBeInvariant3[int, str]"   "ShouldBeInvariant3[float, str]" is not assignable to "ShouldBeInvariant3[int, str]"     Type parameter "K@ShouldBeInvariant3" is invariant, but "float" is not the same as "int" (reportAssignmentType) -generics_syntax_infer_variance.py:127:43 - error: Type "ShouldBeInvariant3[str, int]" is not assignable to declared type "ShouldBeInvariant3[str, float]" +generics_syntax_infer_variance.py:129:43 - error: Type "ShouldBeInvariant3[str, int]" is not assignable to declared type "ShouldBeInvariant3[str, float]"   "ShouldBeInvariant3[str, int]" is not assignable to "ShouldBeInvariant3[str, float]"     Type parameter "V@ShouldBeInvariant3" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_syntax_infer_variance.py:128:41 - error: Type "ShouldBeInvariant3[str, float]" is not assignable to declared type "ShouldBeInvariant3[str, int]" +generics_syntax_infer_variance.py:130:41 - error: Type "ShouldBeInvariant3[str, float]" is not assignable to declared type "ShouldBeInvariant3[str, int]"   "ShouldBeInvariant3[str, float]" is not assignable to "ShouldBeInvariant3[str, int]"     Type parameter "V@ShouldBeInvariant3" is invariant, but "float" is not the same as "int" (reportAssignmentType) -generics_syntax_infer_variance.py:136:38 - error: Type "ShouldBeInvariant4[int]" is not assignable to declared type "ShouldBeInvariant4[float]" +generics_syntax_infer_variance.py:138:38 - error: Type "ShouldBeInvariant4[int]" is not assignable to declared type "ShouldBeInvariant4[float]"   "ShouldBeInvariant4[int]" is not assignable to "ShouldBeInvariant4[float]"     Type parameter "T@ShouldBeInvariant4" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_syntax_infer_variance.py:144:38 - error: Type "ShouldBeInvariant5[int]" is not assignable to declared type "ShouldBeInvariant5[float]" +generics_syntax_infer_variance.py:146:38 - error: Type "ShouldBeInvariant5[int]" is not assignable to declared type "ShouldBeInvariant5[float]"   "ShouldBeInvariant5[int]" is not assignable to "ShouldBeInvariant5[float]"     Type parameter "T@ShouldBeInvariant5" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_syntax_infer_variance.py:155:45 - error: Type "ShouldBeContravariant1[int]" is not assignable to declared type "ShouldBeContravariant1[float]" +generics_syntax_infer_variance.py:157:45 - error: Type "ShouldBeContravariant1[int]" is not assignable to declared type "ShouldBeContravariant1[float]"   "ShouldBeContravariant1[int]" is not assignable to "ShouldBeContravariant1[float]"     Type parameter "T@ShouldBeContravariant1" is contravariant, but "int" is not a supertype of "float"       "float" is not assignable to "int" (reportAssignmentType) """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 18: Expected 1 errors +Line 22: Expected 1 errors +Line 17: Unexpected errors ['generics_syntax_infer_variance.py:17:42 - error: TypeVar cannot be both covariant and contravariant (reportGeneralTypeIssues)'] +Line 21: Unexpected errors ['generics_syntax_infer_variance.py:21:46 - error: TypeVar cannot be both covariant and contravariant (reportGeneralTypeIssues)'] """ diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 49cfb801..0dff02f6 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ version = "pyright 1.1.386" -test_duration = 1.2 +test_duration = 1.8 diff --git a/conformance/results/pytype/generics_syntax_infer_variance.toml b/conformance/results/pytype/generics_syntax_infer_variance.toml index 05c5d9be..fb3ee4ee 100644 --- a/conformance/results/pytype/generics_syntax_infer_variance.toml +++ b/conformance/results/pytype/generics_syntax_infer_variance.toml @@ -3,26 +3,26 @@ notes = """ Type parameter syntax not yet support. """ output = """ -SyntaxError: Type parameter lists are only supported in Python 3.12 and greater (, line 132) +SyntaxError: Type parameter lists are only supported in Python 3.12 and greater (, line 134) """ conformance_automated = "Fail" errors_diff = """ -Line 15: Expected 1 errors -Line 17: Expected 1 errors -Line 29: Expected 1 errors -Line 37: Expected 1 errors -Line 46: Expected 1 errors -Line 75: Expected 1 errors -Line 86: Expected 1 errors -Line 102: Expected 1 errors -Line 103: Expected 1 errors -Line 117: Expected 1 errors -Line 118: Expected 1 errors -Line 125: Expected 1 errors -Line 126: Expected 1 errors +Line 18: Expected 1 errors +Line 22: Expected 1 errors +Line 32: Expected 1 errors +Line 40: Expected 1 errors +Line 48: Expected 1 errors +Line 77: Expected 1 errors +Line 88: Expected 1 errors +Line 104: Expected 1 errors +Line 105: Expected 1 errors +Line 119: Expected 1 errors +Line 120: Expected 1 errors Line 127: Expected 1 errors Line 128: Expected 1 errors -Line 136: Expected 1 errors -Line 144: Expected 1 errors -Line 155: Expected 1 errors +Line 129: Expected 1 errors +Line 130: Expected 1 errors +Line 138: Expected 1 errors +Line 146: Expected 1 errors +Line 157: Expected 1 errors """ diff --git a/conformance/results/pytype/specialtypes_never.toml b/conformance/results/pytype/specialtypes_never.toml index 7a231858..be27a72a 100644 --- a/conformance/results/pytype/specialtypes_never.toml +++ b/conformance/results/pytype/specialtypes_never.toml @@ -8,11 +8,10 @@ specialtypes_never.py:11:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 21: Unexpected errors ['specialtypes_never.py:21:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: bad return type [bad-return-type]'] +Line 21: Unexpected errors ['specialtypes_never.py:21:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: bad return type [bad-return-type]'] Line 68: Unexpected errors ['specialtypes_never.py:68:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Type annotation for v1 does not match type of assignment [annotation-type-mismatch]'] Line 69: Unexpected errors ['specialtypes_never.py:69:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Type annotation for v2 does not match type of assignment [annotation-type-mismatch]'] Line 70: Unexpected errors ['specialtypes_never.py:70:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Type annotation for v3 does not match type of assignment [annotation-type-mismatch]'] diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index a314c2a0..87ce1f36 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.10.11" -test_duration = 33.1 +test_duration = 47.7 diff --git a/conformance/results/results.html b/conformance/results/results.html index 3211c84f..e2533e8d 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,16 +159,16 @@

Python Type System Conformance Test Results

 
mypy 1.13.0
-
1.5sec
+
2.4sec
pyright 1.1.386
-
1.2sec
+
1.8sec
pyre 0.9.22
-
4.4sec
+
6.1sec
pytype 2024.10.11
-
33.1sec
+
47.7sec
diff --git a/conformance/tests/generics_syntax_infer_variance.py b/conformance/tests/generics_syntax_infer_variance.py index 7df2e64e..64e1536b 100644 --- a/conformance/tests/generics_syntax_infer_variance.py +++ b/conformance/tests/generics_syntax_infer_variance.py @@ -2,27 +2,30 @@ Tests the handling of "infer_variance" parameter for TypeVar. """ +from dataclasses import dataclass + # Specification: https://peps.python.org/pep-0695/#auto-variance-for-typevar from typing import Final, Generic, Iterator, Sequence, TypeVar -from dataclasses import dataclass T = TypeVar("T", infer_variance=True) K = TypeVar("K", infer_variance=True) V = TypeVar("V", infer_variance=True) -S1 = TypeVar("S1", covariant=True, infer_variance=True) # E: cannot use covariant with infer_variance +S1 = TypeVar( + "S1", covariant=True, infer_variance=True +) # E: cannot use covariant with infer_variance -S2 = TypeVar("S2", contravariant=True, infer_variance=True) # E: cannot use contravariant with infer_variance +S2 = TypeVar( + "S2", contravariant=True, infer_variance=True +) # E: cannot use contravariant with infer_variance class ShouldBeCovariant1(Generic[T]): - def __getitem__(self, index: int) -> T: - ... + def __getitem__(self, index: int) -> T: ... - def __iter__(self) -> Iterator[T]: - ... + def __iter__(self) -> Iterator[T]: ... vco1_1: ShouldBeCovariant1[float] = ShouldBeCovariant1[int]() # OK @@ -38,8 +41,7 @@ class ShouldBeCovariant2(Sequence[T]): class ShouldBeCovariant3(Generic[T]): - def method1(self) -> "ShouldBeCovariant2[T]": - ... + def method1(self) -> "ShouldBeCovariant2[T]": ... vco3_1: ShouldBeCovariant3[float] = ShouldBeCovariant3[int]() # OK @@ -91,7 +93,7 @@ def __init__(self, value: T) -> None: self._value = value @property - def value(self): + def value(self) -> T: return self._value @value.setter From 3e4c5a9edb4563bf832915dd217aa7c210f08797 Mon Sep 17 00:00:00 2001 From: Zeina Migeed Date: Thu, 24 Oct 2024 11:06:43 -0700 Subject: [PATCH 2/2] update generics_syntax_infer_variance.py --- .../mypy/generics_syntax_infer_variance.toml | 238 +++++++++--------- conformance/results/mypy/version.toml | 2 +- .../pyre/generics_syntax_infer_variance.toml | 36 +-- conformance/results/pyre/version.toml | 2 +- .../generics_syntax_infer_variance.toml | 42 ++-- conformance/results/pyright/version.toml | 2 +- .../generics_syntax_infer_variance.toml | 34 +-- conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 8 +- .../tests/generics_syntax_infer_variance.py | 20 +- 10 files changed, 188 insertions(+), 198 deletions(-) diff --git a/conformance/results/mypy/generics_syntax_infer_variance.toml b/conformance/results/mypy/generics_syntax_infer_variance.toml index 6642df62..4a4ecc71 100644 --- a/conformance/results/mypy/generics_syntax_infer_variance.toml +++ b/conformance/results/mypy/generics_syntax_infer_variance.toml @@ -3,139 +3,135 @@ notes = """ Type parameter syntax not yet support. """ output = """ +generics_syntax_infer_variance.py:11: error: Unexpected argument to "TypeVar()": "infer_variance" [misc] generics_syntax_infer_variance.py:12: error: Unexpected argument to "TypeVar()": "infer_variance" [misc] generics_syntax_infer_variance.py:13: error: Unexpected argument to "TypeVar()": "infer_variance" [misc] -generics_syntax_infer_variance.py:14: error: Unexpected argument to "TypeVar()": "infer_variance" [misc] -generics_syntax_infer_variance.py:16: error: Unexpected argument to "TypeVar()": "infer_variance" [misc] -generics_syntax_infer_variance.py:20: error: Unexpected argument to "TypeVar()": "infer_variance" [misc] -generics_syntax_infer_variance.py:25: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:26: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:26: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:28: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:28: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:31: error: "ShouldBeCovariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:31: error: The type "type[ShouldBeCovariant1]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:32: error: "ShouldBeCovariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:32: error: The type "type[ShouldBeCovariant1]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:35: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:35: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:39: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:39: error: The type "type[ShouldBeCovariant2]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:40: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:40: error: The type "type[ShouldBeCovariant2]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:43: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:44: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:44: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:44: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:47: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:47: error: The type "type[ShouldBeCovariant3]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:48: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:48: error: The type "type[ShouldBeCovariant3]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:52: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:53: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:53: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:67: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:68: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:68: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:72: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:72: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:76: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:76: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:77: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:77: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:80: error: Free type variable expected in Generic[...] [misc] +generics_syntax_infer_variance.py:15: error: Unexpected argument to "TypeVar()": "infer_variance" [misc] +generics_syntax_infer_variance.py:17: error: Unexpected argument to "TypeVar()": "infer_variance" [misc] +generics_syntax_infer_variance.py:20: error: Free type variable expected in Generic[...] [misc] +generics_syntax_infer_variance.py:21: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:21: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:24: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:24: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:28: error: "ShouldBeCovariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:28: error: The type "type[ShouldBeCovariant1]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:29: error: "ShouldBeCovariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:29: error: The type "type[ShouldBeCovariant1]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:32: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:32: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:36: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:36: error: The type "type[ShouldBeCovariant2]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:37: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:37: error: The type "type[ShouldBeCovariant2]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:40: error: Free type variable expected in Generic[...] [misc] +generics_syntax_infer_variance.py:41: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:41: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:41: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:45: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:45: error: The type "type[ShouldBeCovariant3]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:46: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:46: error: The type "type[ShouldBeCovariant3]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:50: error: Free type variable expected in Generic[...] [misc] +generics_syntax_infer_variance.py:51: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:51: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:65: error: Free type variable expected in Generic[...] [misc] +generics_syntax_infer_variance.py:66: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:66: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:70: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:70: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:74: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:74: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:75: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:75: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:78: error: Free type variable expected in Generic[...] [misc] +generics_syntax_infer_variance.py:79: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:79: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases generics_syntax_infer_variance.py:81: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] generics_syntax_infer_variance.py:81: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:83: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:83: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:87: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:87: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:88: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:88: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:91: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:92: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:92: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:96: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:96: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:100: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:100: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:104: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:104: error: The type "type[ShouldBeInvariant1]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:105: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:105: error: The type "type[ShouldBeInvariant1]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:108: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:109: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:109: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:112: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:112: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:115: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:115: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:119: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:119: error: The type "type[ShouldBeInvariant2]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:120: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:120: error: The type "type[ShouldBeInvariant2]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:123: error: Variable "generics_syntax_infer_variance.K" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:123: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:123: error: Variable "generics_syntax_infer_variance.V" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:85: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:85: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:86: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:86: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:89: error: Free type variable expected in Generic[...] [misc] +generics_syntax_infer_variance.py:90: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:90: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:94: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:94: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:98: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:98: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:102: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:102: error: The type "type[ShouldBeInvariant1]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:103: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:103: error: The type "type[ShouldBeInvariant1]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:106: error: Free type variable expected in Generic[...] [misc] +generics_syntax_infer_variance.py:107: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:107: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:110: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:110: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:113: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:113: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:117: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:117: error: The type "type[ShouldBeInvariant2]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:118: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:118: error: The type "type[ShouldBeInvariant2]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:121: error: Variable "generics_syntax_infer_variance.K" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:121: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:121: error: Variable "generics_syntax_infer_variance.V" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:125: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] +generics_syntax_infer_variance.py:125: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:126: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] +generics_syntax_infer_variance.py:126: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] generics_syntax_infer_variance.py:127: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] generics_syntax_infer_variance.py:127: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] generics_syntax_infer_variance.py:128: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] generics_syntax_infer_variance.py:128: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:129: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] -generics_syntax_infer_variance.py:129: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:130: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] -generics_syntax_infer_variance.py:130: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:138: error: Incompatible types in assignment (expression has type "ShouldBeInvariant4[int]", variable has type "ShouldBeInvariant4[float]") [assignment] -generics_syntax_infer_variance.py:146: error: Incompatible types in assignment (expression has type "ShouldBeInvariant5[int]", variable has type "ShouldBeInvariant5[float]") [assignment] -generics_syntax_infer_variance.py:149: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:150: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:150: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:153: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:153: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:157: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:157: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:158: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:158: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:136: error: Incompatible types in assignment (expression has type "ShouldBeInvariant4[int]", variable has type "ShouldBeInvariant4[float]") [assignment] +generics_syntax_infer_variance.py:144: error: Incompatible types in assignment (expression has type "ShouldBeInvariant5[int]", variable has type "ShouldBeInvariant5[float]") [assignment] +generics_syntax_infer_variance.py:147: error: Free type variable expected in Generic[...] [misc] +generics_syntax_infer_variance.py:148: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:148: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:151: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:151: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:155: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:155: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:156: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:156: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc] """ conformance_automated = "Fail" errors_diff = """ -Line 18: Expected 1 errors -Line 22: Expected 1 errors +Line 11: Unexpected errors ['generics_syntax_infer_variance.py:11: error: Unexpected argument to "TypeVar()": "infer_variance" [misc]'] Line 12: Unexpected errors ['generics_syntax_infer_variance.py:12: error: Unexpected argument to "TypeVar()": "infer_variance" [misc]'] Line 13: Unexpected errors ['generics_syntax_infer_variance.py:13: error: Unexpected argument to "TypeVar()": "infer_variance" [misc]'] -Line 14: Unexpected errors ['generics_syntax_infer_variance.py:14: error: Unexpected argument to "TypeVar()": "infer_variance" [misc]'] -Line 16: Unexpected errors ['generics_syntax_infer_variance.py:16: error: Unexpected argument to "TypeVar()": "infer_variance" [misc]'] -Line 20: Unexpected errors ['generics_syntax_infer_variance.py:20: error: Unexpected argument to "TypeVar()": "infer_variance" [misc]'] -Line 25: Unexpected errors ['generics_syntax_infer_variance.py:25: error: Free type variable expected in Generic[...] [misc]'] -Line 26: Unexpected errors ['generics_syntax_infer_variance.py:26: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 28: Unexpected errors ['generics_syntax_infer_variance.py:28: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 31: Unexpected errors ['generics_syntax_infer_variance.py:31: error: "ShouldBeCovariant1" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:31: error: The type "type[ShouldBeCovariant1]" is not generic and not indexable [misc]'] -Line 35: Unexpected errors ['generics_syntax_infer_variance.py:35: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 39: Unexpected errors ['generics_syntax_infer_variance.py:39: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:39: error: The type "type[ShouldBeCovariant2]" is not generic and not indexable [misc]'] -Line 43: Unexpected errors ['generics_syntax_infer_variance.py:43: error: Free type variable expected in Generic[...] [misc]'] -Line 44: Unexpected errors ['generics_syntax_infer_variance.py:44: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]', 'generics_syntax_infer_variance.py:44: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg]'] -Line 47: Unexpected errors ['generics_syntax_infer_variance.py:47: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:47: error: The type "type[ShouldBeCovariant3]" is not generic and not indexable [misc]'] -Line 52: Unexpected errors ['generics_syntax_infer_variance.py:52: error: Free type variable expected in Generic[...] [misc]'] -Line 53: Unexpected errors ['generics_syntax_infer_variance.py:53: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 67: Unexpected errors ['generics_syntax_infer_variance.py:67: error: Free type variable expected in Generic[...] [misc]'] -Line 68: Unexpected errors ['generics_syntax_infer_variance.py:68: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 72: Unexpected errors ['generics_syntax_infer_variance.py:72: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 76: Unexpected errors ['generics_syntax_infer_variance.py:76: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:76: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc]'] -Line 80: Unexpected errors ['generics_syntax_infer_variance.py:80: error: Free type variable expected in Generic[...] [misc]'] +Line 20: Unexpected errors ['generics_syntax_infer_variance.py:20: error: Free type variable expected in Generic[...] [misc]'] +Line 21: Unexpected errors ['generics_syntax_infer_variance.py:21: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 24: Unexpected errors ['generics_syntax_infer_variance.py:24: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 28: Unexpected errors ['generics_syntax_infer_variance.py:28: error: "ShouldBeCovariant1" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:28: error: The type "type[ShouldBeCovariant1]" is not generic and not indexable [misc]'] +Line 32: Unexpected errors ['generics_syntax_infer_variance.py:32: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 36: Unexpected errors ['generics_syntax_infer_variance.py:36: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:36: error: The type "type[ShouldBeCovariant2]" is not generic and not indexable [misc]'] +Line 40: Unexpected errors ['generics_syntax_infer_variance.py:40: error: Free type variable expected in Generic[...] [misc]'] +Line 41: Unexpected errors ['generics_syntax_infer_variance.py:41: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]', 'generics_syntax_infer_variance.py:41: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg]'] +Line 45: Unexpected errors ['generics_syntax_infer_variance.py:45: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:45: error: The type "type[ShouldBeCovariant3]" is not generic and not indexable [misc]'] +Line 50: Unexpected errors ['generics_syntax_infer_variance.py:50: error: Free type variable expected in Generic[...] [misc]'] +Line 51: Unexpected errors ['generics_syntax_infer_variance.py:51: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 65: Unexpected errors ['generics_syntax_infer_variance.py:65: error: Free type variable expected in Generic[...] [misc]'] +Line 66: Unexpected errors ['generics_syntax_infer_variance.py:66: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 70: Unexpected errors ['generics_syntax_infer_variance.py:70: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 74: Unexpected errors ['generics_syntax_infer_variance.py:74: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:74: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc]'] +Line 78: Unexpected errors ['generics_syntax_infer_variance.py:78: error: Free type variable expected in Generic[...] [misc]'] +Line 79: Unexpected errors ['generics_syntax_infer_variance.py:79: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] Line 81: Unexpected errors ['generics_syntax_infer_variance.py:81: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 83: Unexpected errors ['generics_syntax_infer_variance.py:83: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 87: Unexpected errors ['generics_syntax_infer_variance.py:87: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:87: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc]'] -Line 91: Unexpected errors ['generics_syntax_infer_variance.py:91: error: Free type variable expected in Generic[...] [misc]'] -Line 92: Unexpected errors ['generics_syntax_infer_variance.py:92: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 96: Unexpected errors ['generics_syntax_infer_variance.py:96: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 100: Unexpected errors ['generics_syntax_infer_variance.py:100: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 108: Unexpected errors ['generics_syntax_infer_variance.py:108: error: Free type variable expected in Generic[...] [misc]'] -Line 109: Unexpected errors ['generics_syntax_infer_variance.py:109: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 112: Unexpected errors ['generics_syntax_infer_variance.py:112: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 115: Unexpected errors ['generics_syntax_infer_variance.py:115: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 123: Unexpected errors ['generics_syntax_infer_variance.py:123: error: Variable "generics_syntax_infer_variance.K" is not valid as a type [valid-type]', 'generics_syntax_infer_variance.py:123: error: Variable "generics_syntax_infer_variance.V" is not valid as a type [valid-type]'] -Line 149: Unexpected errors ['generics_syntax_infer_variance.py:149: error: Free type variable expected in Generic[...] [misc]'] -Line 150: Unexpected errors ['generics_syntax_infer_variance.py:150: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 153: Unexpected errors ['generics_syntax_infer_variance.py:153: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 158: Unexpected errors ['generics_syntax_infer_variance.py:158: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:158: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc]'] +Line 85: Unexpected errors ['generics_syntax_infer_variance.py:85: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:85: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc]'] +Line 89: Unexpected errors ['generics_syntax_infer_variance.py:89: error: Free type variable expected in Generic[...] [misc]'] +Line 90: Unexpected errors ['generics_syntax_infer_variance.py:90: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 94: Unexpected errors ['generics_syntax_infer_variance.py:94: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 98: Unexpected errors ['generics_syntax_infer_variance.py:98: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 106: Unexpected errors ['generics_syntax_infer_variance.py:106: error: Free type variable expected in Generic[...] [misc]'] +Line 107: Unexpected errors ['generics_syntax_infer_variance.py:107: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 110: Unexpected errors ['generics_syntax_infer_variance.py:110: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 113: Unexpected errors ['generics_syntax_infer_variance.py:113: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 121: Unexpected errors ['generics_syntax_infer_variance.py:121: error: Variable "generics_syntax_infer_variance.K" is not valid as a type [valid-type]', 'generics_syntax_infer_variance.py:121: error: Variable "generics_syntax_infer_variance.V" is not valid as a type [valid-type]'] +Line 147: Unexpected errors ['generics_syntax_infer_variance.py:147: error: Free type variable expected in Generic[...] [misc]'] +Line 148: Unexpected errors ['generics_syntax_infer_variance.py:148: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 151: Unexpected errors ['generics_syntax_infer_variance.py:151: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 156: Unexpected errors ['generics_syntax_infer_variance.py:156: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:156: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc]'] """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index 05391ed1..33181f43 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.13.0" -test_duration = 2.4 +test_duration = 2.6 diff --git a/conformance/results/pyre/generics_syntax_infer_variance.toml b/conformance/results/pyre/generics_syntax_infer_variance.toml index 6a0b74af..7a848658 100644 --- a/conformance/results/pyre/generics_syntax_infer_variance.toml +++ b/conformance/results/pyre/generics_syntax_infer_variance.toml @@ -3,27 +3,27 @@ notes = """ Type parameter syntax not yet support. """ output = """ -generics_syntax_infer_variance.py:134:25 Parsing failure [404]: invalid syntax +generics_syntax_infer_variance.py:132:25 Parsing failure [404]: invalid syntax """ conformance_automated = "Fail" errors_diff = """ -Line 18: Expected 1 errors -Line 22: Expected 1 errors -Line 32: Expected 1 errors -Line 40: Expected 1 errors -Line 48: Expected 1 errors -Line 77: Expected 1 errors -Line 88: Expected 1 errors -Line 104: Expected 1 errors -Line 105: Expected 1 errors -Line 119: Expected 1 errors -Line 120: Expected 1 errors +Line 15: Expected 1 errors +Line 17: Expected 1 errors +Line 29: Expected 1 errors +Line 37: Expected 1 errors +Line 46: Expected 1 errors +Line 75: Expected 1 errors +Line 86: Expected 1 errors +Line 102: Expected 1 errors +Line 103: Expected 1 errors +Line 117: Expected 1 errors +Line 118: Expected 1 errors +Line 125: Expected 1 errors +Line 126: Expected 1 errors Line 127: Expected 1 errors Line 128: Expected 1 errors -Line 129: Expected 1 errors -Line 130: Expected 1 errors -Line 138: Expected 1 errors -Line 146: Expected 1 errors -Line 157: Expected 1 errors -Line 134: Unexpected errors ['generics_syntax_infer_variance.py:134:25 Parsing failure [404]: invalid syntax'] +Line 136: Expected 1 errors +Line 144: Expected 1 errors +Line 155: Expected 1 errors +Line 132: Unexpected errors ['generics_syntax_infer_variance.py:132:25 Parsing failure [404]: invalid syntax'] """ diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index 17b803bf..9b63b04f 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.22" -test_duration = 6.1 +test_duration = 6.5 diff --git a/conformance/results/pyright/generics_syntax_infer_variance.toml b/conformance/results/pyright/generics_syntax_infer_variance.toml index d45181e3..b23985d5 100644 --- a/conformance/results/pyright/generics_syntax_infer_variance.toml +++ b/conformance/results/pyright/generics_syntax_infer_variance.toml @@ -1,66 +1,62 @@ conformant = "Pass" output = """ -generics_syntax_infer_variance.py:17:42 - error: TypeVar cannot be both covariant and contravariant (reportGeneralTypeIssues) -generics_syntax_infer_variance.py:21:46 - error: TypeVar cannot be both covariant and contravariant (reportGeneralTypeIssues) -generics_syntax_infer_variance.py:32:35 - error: Type "ShouldBeCovariant1[float]" is not assignable to declared type "ShouldBeCovariant1[int]" +generics_syntax_infer_variance.py:15:51 - error: TypeVar cannot be both covariant and contravariant (reportGeneralTypeIssues) +generics_syntax_infer_variance.py:17:55 - error: TypeVar cannot be both covariant and contravariant (reportGeneralTypeIssues) +generics_syntax_infer_variance.py:29:35 - error: Type "ShouldBeCovariant1[float]" is not assignable to declared type "ShouldBeCovariant1[int]"   "ShouldBeCovariant1[float]" is not assignable to "ShouldBeCovariant1[int]"     Type parameter "T@ShouldBeCovariant1" is covariant, but "float" is not a subtype of "int"       "float" is not assignable to "int" (reportAssignmentType) -generics_syntax_infer_variance.py:40:35 - error: Type "ShouldBeCovariant2[float]" is not assignable to declared type "ShouldBeCovariant2[int]" +generics_syntax_infer_variance.py:37:35 - error: Type "ShouldBeCovariant2[float]" is not assignable to declared type "ShouldBeCovariant2[int]"   "ShouldBeCovariant2[float]" is not assignable to "ShouldBeCovariant2[int]"     Type parameter "T@ShouldBeCovariant2" is covariant, but "float" is not a subtype of "int"       "float" is not assignable to "int" (reportAssignmentType) -generics_syntax_infer_variance.py:48:35 - error: Type "ShouldBeCovariant3[float]" is not assignable to declared type "ShouldBeCovariant3[int]" +generics_syntax_infer_variance.py:46:35 - error: Type "ShouldBeCovariant3[float]" is not assignable to declared type "ShouldBeCovariant3[int]"   "ShouldBeCovariant3[float]" is not assignable to "ShouldBeCovariant3[int]"     Type parameter "T@ShouldBeCovariant3" is covariant, but "float" is not a subtype of "int"       "float" is not assignable to "int" (reportAssignmentType) -generics_syntax_infer_variance.py:77:34 - error: Type "ShouldBeCovariant5[float]" is not assignable to declared type "ShouldBeCovariant5[int]" +generics_syntax_infer_variance.py:75:34 - error: Type "ShouldBeCovariant5[float]" is not assignable to declared type "ShouldBeCovariant5[int]"   "ShouldBeCovariant5[float]" is not assignable to "ShouldBeCovariant5[int]"     Type parameter "T@ShouldBeCovariant5" is covariant, but "float" is not a subtype of "int"       "float" is not assignable to "int" (reportAssignmentType) -generics_syntax_infer_variance.py:88:34 - error: Type "ShouldBeCovariant6[float]" is not assignable to declared type "ShouldBeCovariant6[int]" +generics_syntax_infer_variance.py:86:34 - error: Type "ShouldBeCovariant6[float]" is not assignable to declared type "ShouldBeCovariant6[int]"   "ShouldBeCovariant6[float]" is not assignable to "ShouldBeCovariant6[int]"     Type parameter "T@ShouldBeCovariant6" is covariant, but "float" is not a subtype of "int"       "float" is not assignable to "int" (reportAssignmentType) -generics_syntax_infer_variance.py:104:38 - error: Type "ShouldBeInvariant1[int]" is not assignable to declared type "ShouldBeInvariant1[float]" +generics_syntax_infer_variance.py:102:38 - error: Type "ShouldBeInvariant1[int]" is not assignable to declared type "ShouldBeInvariant1[float]"   "ShouldBeInvariant1[int]" is not assignable to "ShouldBeInvariant1[float]"     Type parameter "T@ShouldBeInvariant1" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_syntax_infer_variance.py:105:36 - error: Type "ShouldBeInvariant1[float]" is not assignable to declared type "ShouldBeInvariant1[int]" +generics_syntax_infer_variance.py:103:36 - error: Type "ShouldBeInvariant1[float]" is not assignable to declared type "ShouldBeInvariant1[int]"   "ShouldBeInvariant1[float]" is not assignable to "ShouldBeInvariant1[int]"     Type parameter "T@ShouldBeInvariant1" is invariant, but "float" is not the same as "int" (reportAssignmentType) -generics_syntax_infer_variance.py:119:38 - error: Type "ShouldBeInvariant2[int]" is not assignable to declared type "ShouldBeInvariant2[float]" +generics_syntax_infer_variance.py:117:38 - error: Type "ShouldBeInvariant2[int]" is not assignable to declared type "ShouldBeInvariant2[float]"   "ShouldBeInvariant2[int]" is not assignable to "ShouldBeInvariant2[float]"     Type parameter "T@ShouldBeInvariant2" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_syntax_infer_variance.py:120:36 - error: Type "ShouldBeInvariant2[float]" is not assignable to declared type "ShouldBeInvariant2[int]" +generics_syntax_infer_variance.py:118:36 - error: Type "ShouldBeInvariant2[float]" is not assignable to declared type "ShouldBeInvariant2[int]"   "ShouldBeInvariant2[float]" is not assignable to "ShouldBeInvariant2[int]"     Type parameter "T@ShouldBeInvariant2" is invariant, but "float" is not the same as "int" (reportAssignmentType) -generics_syntax_infer_variance.py:127:43 - error: Type "ShouldBeInvariant3[int, str]" is not assignable to declared type "ShouldBeInvariant3[float, str]" +generics_syntax_infer_variance.py:125:43 - error: Type "ShouldBeInvariant3[int, str]" is not assignable to declared type "ShouldBeInvariant3[float, str]"   "ShouldBeInvariant3[int, str]" is not assignable to "ShouldBeInvariant3[float, str]"     Type parameter "K@ShouldBeInvariant3" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_syntax_infer_variance.py:128:41 - error: Type "ShouldBeInvariant3[float, str]" is not assignable to declared type "ShouldBeInvariant3[int, str]" +generics_syntax_infer_variance.py:126:41 - error: Type "ShouldBeInvariant3[float, str]" is not assignable to declared type "ShouldBeInvariant3[int, str]"   "ShouldBeInvariant3[float, str]" is not assignable to "ShouldBeInvariant3[int, str]"     Type parameter "K@ShouldBeInvariant3" is invariant, but "float" is not the same as "int" (reportAssignmentType) -generics_syntax_infer_variance.py:129:43 - error: Type "ShouldBeInvariant3[str, int]" is not assignable to declared type "ShouldBeInvariant3[str, float]" +generics_syntax_infer_variance.py:127:43 - error: Type "ShouldBeInvariant3[str, int]" is not assignable to declared type "ShouldBeInvariant3[str, float]"   "ShouldBeInvariant3[str, int]" is not assignable to "ShouldBeInvariant3[str, float]"     Type parameter "V@ShouldBeInvariant3" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_syntax_infer_variance.py:130:41 - error: Type "ShouldBeInvariant3[str, float]" is not assignable to declared type "ShouldBeInvariant3[str, int]" +generics_syntax_infer_variance.py:128:41 - error: Type "ShouldBeInvariant3[str, float]" is not assignable to declared type "ShouldBeInvariant3[str, int]"   "ShouldBeInvariant3[str, float]" is not assignable to "ShouldBeInvariant3[str, int]"     Type parameter "V@ShouldBeInvariant3" is invariant, but "float" is not the same as "int" (reportAssignmentType) -generics_syntax_infer_variance.py:138:38 - error: Type "ShouldBeInvariant4[int]" is not assignable to declared type "ShouldBeInvariant4[float]" +generics_syntax_infer_variance.py:136:38 - error: Type "ShouldBeInvariant4[int]" is not assignable to declared type "ShouldBeInvariant4[float]"   "ShouldBeInvariant4[int]" is not assignable to "ShouldBeInvariant4[float]"     Type parameter "T@ShouldBeInvariant4" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_syntax_infer_variance.py:146:38 - error: Type "ShouldBeInvariant5[int]" is not assignable to declared type "ShouldBeInvariant5[float]" +generics_syntax_infer_variance.py:144:38 - error: Type "ShouldBeInvariant5[int]" is not assignable to declared type "ShouldBeInvariant5[float]"   "ShouldBeInvariant5[int]" is not assignable to "ShouldBeInvariant5[float]"     Type parameter "T@ShouldBeInvariant5" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_syntax_infer_variance.py:157:45 - error: Type "ShouldBeContravariant1[int]" is not assignable to declared type "ShouldBeContravariant1[float]" +generics_syntax_infer_variance.py:155:45 - error: Type "ShouldBeContravariant1[int]" is not assignable to declared type "ShouldBeContravariant1[float]"   "ShouldBeContravariant1[int]" is not assignable to "ShouldBeContravariant1[float]"     Type parameter "T@ShouldBeContravariant1" is contravariant, but "int" is not a supertype of "float"       "float" is not assignable to "int" (reportAssignmentType) """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 18: Expected 1 errors -Line 22: Expected 1 errors -Line 17: Unexpected errors ['generics_syntax_infer_variance.py:17:42 - error: TypeVar cannot be both covariant and contravariant (reportGeneralTypeIssues)'] -Line 21: Unexpected errors ['generics_syntax_infer_variance.py:21:46 - error: TypeVar cannot be both covariant and contravariant (reportGeneralTypeIssues)'] """ diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 0dff02f6..9430b168 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ version = "pyright 1.1.386" -test_duration = 1.8 +test_duration = 1.9 diff --git a/conformance/results/pytype/generics_syntax_infer_variance.toml b/conformance/results/pytype/generics_syntax_infer_variance.toml index fb3ee4ee..05c5d9be 100644 --- a/conformance/results/pytype/generics_syntax_infer_variance.toml +++ b/conformance/results/pytype/generics_syntax_infer_variance.toml @@ -3,26 +3,26 @@ notes = """ Type parameter syntax not yet support. """ output = """ -SyntaxError: Type parameter lists are only supported in Python 3.12 and greater (, line 134) +SyntaxError: Type parameter lists are only supported in Python 3.12 and greater (, line 132) """ conformance_automated = "Fail" errors_diff = """ -Line 18: Expected 1 errors -Line 22: Expected 1 errors -Line 32: Expected 1 errors -Line 40: Expected 1 errors -Line 48: Expected 1 errors -Line 77: Expected 1 errors -Line 88: Expected 1 errors -Line 104: Expected 1 errors -Line 105: Expected 1 errors -Line 119: Expected 1 errors -Line 120: Expected 1 errors +Line 15: Expected 1 errors +Line 17: Expected 1 errors +Line 29: Expected 1 errors +Line 37: Expected 1 errors +Line 46: Expected 1 errors +Line 75: Expected 1 errors +Line 86: Expected 1 errors +Line 102: Expected 1 errors +Line 103: Expected 1 errors +Line 117: Expected 1 errors +Line 118: Expected 1 errors +Line 125: Expected 1 errors +Line 126: Expected 1 errors Line 127: Expected 1 errors Line 128: Expected 1 errors -Line 129: Expected 1 errors -Line 130: Expected 1 errors -Line 138: Expected 1 errors -Line 146: Expected 1 errors -Line 157: Expected 1 errors +Line 136: Expected 1 errors +Line 144: Expected 1 errors +Line 155: Expected 1 errors """ diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index 87ce1f36..47fa98ff 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.10.11" -test_duration = 47.7 +test_duration = 50.2 diff --git a/conformance/results/results.html b/conformance/results/results.html index e2533e8d..98e57034 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,16 +159,16 @@

Python Type System Conformance Test Results

 
mypy 1.13.0
-
2.4sec
+
2.6sec
pyright 1.1.386
-
1.8sec
+
1.9sec
pyre 0.9.22
-
6.1sec
+
6.5sec
pytype 2024.10.11
-
47.7sec
+
50.2sec
diff --git a/conformance/tests/generics_syntax_infer_variance.py b/conformance/tests/generics_syntax_infer_variance.py index 64e1536b..62d14ccb 100644 --- a/conformance/tests/generics_syntax_infer_variance.py +++ b/conformance/tests/generics_syntax_infer_variance.py @@ -2,30 +2,27 @@ Tests the handling of "infer_variance" parameter for TypeVar. """ -from dataclasses import dataclass - # Specification: https://peps.python.org/pep-0695/#auto-variance-for-typevar from typing import Final, Generic, Iterator, Sequence, TypeVar +from dataclasses import dataclass T = TypeVar("T", infer_variance=True) K = TypeVar("K", infer_variance=True) V = TypeVar("V", infer_variance=True) -S1 = TypeVar( - "S1", covariant=True, infer_variance=True -) # E: cannot use covariant with infer_variance +S1 = TypeVar("S1", covariant=True, infer_variance=True) # E: cannot use covariant with infer_variance -S2 = TypeVar( - "S2", contravariant=True, infer_variance=True -) # E: cannot use contravariant with infer_variance +S2 = TypeVar("S2", contravariant=True, infer_variance=True) # E: cannot use contravariant with infer_variance class ShouldBeCovariant1(Generic[T]): - def __getitem__(self, index: int) -> T: ... + def __getitem__(self, index: int) -> T: + ... - def __iter__(self) -> Iterator[T]: ... + def __iter__(self) -> Iterator[T]: + ... vco1_1: ShouldBeCovariant1[float] = ShouldBeCovariant1[int]() # OK @@ -41,7 +38,8 @@ class ShouldBeCovariant2(Sequence[T]): class ShouldBeCovariant3(Generic[T]): - def method1(self) -> "ShouldBeCovariant2[T]": ... + def method1(self) -> "ShouldBeCovariant2[T]": + ... vco3_1: ShouldBeCovariant3[float] = ShouldBeCovariant3[int]() # OK