diff --git a/conformance/results/mypy/annotations_forward_refs.toml b/conformance/results/mypy/annotations_forward_refs.toml index 14d8cb64c..bee7ebbd0 100644 --- a/conformance/results/mypy/annotations_forward_refs.toml +++ b/conformance/results/mypy/annotations_forward_refs.toml @@ -6,9 +6,8 @@ Incorrectly generates error for quoted type defined in class scope. """ output = """ annotations_forward_refs.py:41: error: Invalid type comment or annotation [valid-type] -annotations_forward_refs.py:42: error: Bracketed expression "[...]" is not valid as a type [valid-type] -annotations_forward_refs.py:43: error: Syntax error in type annotation [syntax] -annotations_forward_refs.py:43: note: Suggestion: Use Tuple[T1, ..., Tn] instead of (T1, ..., Tn) +annotations_forward_refs.py:42: error: Invalid type comment or annotation [valid-type] +annotations_forward_refs.py:43: error: Invalid type comment or annotation [valid-type] annotations_forward_refs.py:44: error: Invalid type comment or annotation [valid-type] annotations_forward_refs.py:45: error: Invalid type comment or annotation [valid-type] annotations_forward_refs.py:46: error: Invalid type comment or annotation [valid-type] @@ -16,9 +15,9 @@ annotations_forward_refs.py:47: error: Invalid type comment or annotation [vali annotations_forward_refs.py:48: error: Invalid type comment or annotation [valid-type] annotations_forward_refs.py:49: error: Variable "annotations_forward_refs.var1" is not valid as a type [valid-type] annotations_forward_refs.py:49: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -annotations_forward_refs.py:50: error: Invalid type: try using Literal[True] instead? [valid-type] -annotations_forward_refs.py:51: error: Invalid type: try using Literal[1] instead? [valid-type] -annotations_forward_refs.py:52: error: Invalid type: try using Literal[-1] instead? [valid-type] +annotations_forward_refs.py:50: error: Invalid type comment or annotation [valid-type] +annotations_forward_refs.py:51: error: Invalid type comment or annotation [valid-type] +annotations_forward_refs.py:52: error: Invalid type comment or annotation [valid-type] annotations_forward_refs.py:53: error: Invalid type comment or annotation [valid-type] annotations_forward_refs.py:54: error: Invalid type comment or annotation [valid-type] annotations_forward_refs.py:55: error: Module "types" is not valid as a type [valid-type] diff --git a/conformance/results/mypy/generics_syntax_infer_variance.toml b/conformance/results/mypy/generics_syntax_infer_variance.toml index b354ae226..1db3d4a8d 100644 --- a/conformance/results/mypy/generics_syntax_infer_variance.toml +++ b/conformance/results/mypy/generics_syntax_infer_variance.toml @@ -34,70 +34,66 @@ generics_syntax_infer_variance.py:46: error: The type "type[ShouldBeCovariant3]" 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:54: error: "ShouldBeCovariant4" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:54: error: The type "type[ShouldBeCovariant4]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:55: error: "ShouldBeCovariant4" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:55: error: The type "type[ShouldBeCovariant4]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:58: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:59: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:59: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:63: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:63: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:67: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:67: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:68: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:68: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:71: error: Free type variable expected in Generic[...] [misc] -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:74: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:74: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:78: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:78: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:79: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:79: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:82: error: Free type variable expected in Generic[...] [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:91: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:91: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:95: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:95: error: The type "type[ShouldBeInvariant1]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:96: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:96: error: The type "type[ShouldBeInvariant1]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:99: error: Free type variable expected in Generic[...] [misc] -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:103: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:103: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:106: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:106: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:110: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:110: error: The type "type[ShouldBeInvariant2]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:111: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:111: error: The type "type[ShouldBeInvariant2]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:114: error: Variable "generics_syntax_infer_variance.K" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:114: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:114: error: Variable "generics_syntax_infer_variance.V" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:118: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] -generics_syntax_infer_variance.py:118: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:119: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] -generics_syntax_infer_variance.py:119: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:120: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] -generics_syntax_infer_variance.py:120: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:121: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] -generics_syntax_infer_variance.py:121: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:129: error: Incompatible types in assignment (expression has type "ShouldBeInvariant4[int]", variable has type "ShouldBeInvariant4[float]") [assignment] -generics_syntax_infer_variance.py:137: error: Incompatible types in assignment (expression has type "ShouldBeInvariant5[int]", variable has type "ShouldBeInvariant5[float]") [assignment] -generics_syntax_infer_variance.py:140: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:141: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:141: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:144: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:144: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:148: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:148: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:149: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:149: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc] +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: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: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] """ conformance_automated = "Fail" errors_diff = """ @@ -115,25 +111,24 @@ Line 41: Unexpected errors ['generics_syntax_infer_variance.py:41: error: Variab 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 54: Unexpected errors ['generics_syntax_infer_variance.py:54: error: "ShouldBeCovariant4" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:54: error: The type "type[ShouldBeCovariant4]" is not generic and not indexable [misc]'] -Line 58: Unexpected errors ['generics_syntax_infer_variance.py:58: error: Free type variable expected in Generic[...] [misc]'] -Line 59: Unexpected errors ['generics_syntax_infer_variance.py:59: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 63: Unexpected errors ['generics_syntax_infer_variance.py:63: 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: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:67: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc]'] -Line 71: Unexpected errors ['generics_syntax_infer_variance.py:71: error: Free type variable expected in Generic[...] [misc]'] -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 74: Unexpected errors ['generics_syntax_infer_variance.py:74: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 78: Unexpected errors ['generics_syntax_infer_variance.py:78: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:78: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc]'] -Line 82: Unexpected errors ['generics_syntax_infer_variance.py:82: error: Free type variable expected in Generic[...] [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 91: Unexpected errors ['generics_syntax_infer_variance.py:91: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 99: Unexpected errors ['generics_syntax_infer_variance.py:99: error: Free type variable expected in Generic[...] [misc]'] -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 103: Unexpected errors ['generics_syntax_infer_variance.py:103: 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: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 114: Unexpected errors ['generics_syntax_infer_variance.py:114: error: Variable "generics_syntax_infer_variance.K" is not valid as a type [valid-type]', 'generics_syntax_infer_variance.py:114: error: Variable "generics_syntax_infer_variance.V" is not valid as a type [valid-type]'] -Line 140: Unexpected errors ['generics_syntax_infer_variance.py:140: error: Free type variable expected in Generic[...] [misc]'] -Line 141: Unexpected errors ['generics_syntax_infer_variance.py:141: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 144: Unexpected errors ['generics_syntax_infer_variance.py:144: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 149: Unexpected errors ['generics_syntax_infer_variance.py:149: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:149: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc]'] +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 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]'] """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index efd7c7998..aa90cb33e 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ -version = "mypy 1.11.1" -test_duration = 13.2 +version = "mypy 1.11.2" +test_duration = 1.9 diff --git a/conformance/results/pyre/annotations_forward_refs.toml b/conformance/results/pyre/annotations_forward_refs.toml index 1e4ecf739..6c52e88e7 100644 --- a/conformance/results/pyre/annotations_forward_refs.toml +++ b/conformance/results/pyre/annotations_forward_refs.toml @@ -8,7 +8,7 @@ Does not generate error for unquoted type defined in class scope. Does not treat triple-quoted forward reference annotation as implicitly parenthesized. """ output = """ -annotations_forward_refs.py:41:8 Undefined or invalid type [11]: Annotation `eval(.join(map(chr, [105, 110, 116])))` is not defined as a type. +annotations_forward_refs.py:41:8 Invalid type [31]: Expression `eval("".join(map(chr, [105, 110, 116])))` is not a valid type. annotations_forward_refs.py:42:8 Invalid type [31]: Expression `"[int, str]"` is not a valid type. annotations_forward_refs.py:43:8 Invalid type [31]: Expression `"(int, str)"` is not a valid type. annotations_forward_refs.py:44:8 Undefined or invalid type [11]: Annotation `comprehension(int for generators(generator($target$i in range(1) if )))` is not defined as a type. diff --git a/conformance/results/pyre/generics_syntax_infer_variance.toml b/conformance/results/pyre/generics_syntax_infer_variance.toml index 2a2c10d66..7a8486583 100644 --- a/conformance/results/pyre/generics_syntax_infer_variance.toml +++ b/conformance/results/pyre/generics_syntax_infer_variance.toml @@ -3,7 +3,7 @@ notes = """ Type parameter syntax not yet support. """ output = """ -generics_syntax_infer_variance.py:125:25 Parsing failure [404]: invalid syntax +generics_syntax_infer_variance.py:132:25 Parsing failure [404]: invalid syntax """ conformance_automated = "Fail" errors_diff = """ @@ -12,19 +12,18 @@ Line 17: Expected 1 errors Line 29: Expected 1 errors Line 37: Expected 1 errors Line 46: Expected 1 errors -Line 55: Expected 1 errors -Line 68: Expected 1 errors -Line 79: Expected 1 errors -Line 95: Expected 1 errors -Line 96: Expected 1 errors -Line 110: Expected 1 errors -Line 111: 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 119: Expected 1 errors -Line 120: Expected 1 errors -Line 121: Expected 1 errors -Line 129: Expected 1 errors -Line 137: Expected 1 errors -Line 148: Expected 1 errors -Line 125: Unexpected errors ['generics_syntax_infer_variance.py:125:25 Parsing failure [404]: invalid syntax'] +Line 125: Expected 1 errors +Line 126: 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'] """ diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index 9de046bf2..f4f08845e 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.22" -test_duration = 5.4 +test_duration = 4.5 diff --git a/conformance/results/pyright/aliases_explicit.toml b/conformance/results/pyright/aliases_explicit.toml index 2d5557190..a1e82c9eb 100644 --- a/conformance/results/pyright/aliases_explicit.toml +++ b/conformance/results/pyright/aliases_explicit.toml @@ -9,40 +9,40 @@ aliases_explicit.py:71:24 - error: Expected ParamSpec, ellipsis, or list of type aliases_explicit.py:79:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) aliases_explicit.py:79:21 - error: Call expression not allowed in type expression (reportInvalidTypeForm) aliases_explicit.py:80:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) -aliases_explicit.py:80:21 - error: List expression not allowed in type annotation +aliases_explicit.py:80:21 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) aliases_explicit.py:80:21 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues) aliases_explicit.py:81:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) -aliases_explicit.py:81:21 - error: Tuple expression not allowed in type annotation +aliases_explicit.py:81:21 - error: Tuple expression not allowed in type expression   Use tuple[T1, ..., Tn] to indicate a tuple type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) aliases_explicit.py:82:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) -aliases_explicit.py:82:21 - error: List expression not allowed in type annotation +aliases_explicit.py:82:21 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) aliases_explicit.py:82:21 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) aliases_explicit.py:83:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) -aliases_explicit.py:83:21 - error: Dictionary expression not allowed in type annotation +aliases_explicit.py:83:21 - error: Dictionary expression not allowed in type expression   Use Dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm) aliases_explicit.py:83:21 - error: Expected class but received "dict[str, Unknown]" (reportGeneralTypeIssues) aliases_explicit.py:83:28 - error: "b" is not defined (reportUndefinedVariable) aliases_explicit.py:84:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) aliases_explicit.py:84:21 - error: Call expression not allowed in type expression (reportInvalidTypeForm) aliases_explicit.py:85:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) -aliases_explicit.py:85:21 - error: List expression not allowed in type annotation +aliases_explicit.py:85:21 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) aliases_explicit.py:85:21 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) aliases_explicit.py:85:27 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues) aliases_explicit.py:86:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) -aliases_explicit.py:86:21 - error: Ternary expression not allowed in type annotation (reportInvalidTypeForm) +aliases_explicit.py:86:21 - error: Ternary expression not allowed in type expression (reportInvalidTypeForm) aliases_explicit.py:87:21 - error: Variable not allowed in type expression (reportInvalidTypeForm) +aliases_explicit.py:88:22 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) aliases_explicit.py:88:22 - error: Expected class but received "Literal[True]" (reportGeneralTypeIssues) aliases_explicit.py:89:22 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) aliases_explicit.py:89:22 - error: Expected class but received "Literal[1]" (reportGeneralTypeIssues) aliases_explicit.py:90:22 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) -aliases_explicit.py:90:22 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) -aliases_explicit.py:91:22 - error: Type annotations cannot use format string literals (f-strings) (reportGeneralTypeIssues) +aliases_explicit.py:90:22 - error: Binary operator not allowed in type expression (reportInvalidTypeForm) +aliases_explicit.py:91:22 - error: Type expressions cannot use format string literals (f-strings) (reportGeneralTypeIssues) aliases_explicit.py:100:5 - error: Type "list[Unknown]" is already specialized (reportInvalidTypeArguments) -aliases_explicit.py:101:6 - error: Object of type "UnionType" is not callable -  Attribute "__call__" is unknown (reportCallIssue) +aliases_explicit.py:101:6 - error: Object of type "UnionType" is not callable (reportCallIssue) aliases_explicit.py:102:5 - error: Type "list[Unknown]" is already specialized (reportInvalidTypeArguments) aliases_explicit.py:102:5 - error: Type "set[Unknown]" is already specialized (reportInvalidTypeArguments) """ diff --git a/conformance/results/pyright/aliases_implicit.toml b/conformance/results/pyright/aliases_implicit.toml index fde2e84ca..32f2b7be2 100644 --- a/conformance/results/pyright/aliases_implicit.toml +++ b/conformance/results/pyright/aliases_implicit.toml @@ -7,8 +7,8 @@ aliases_implicit.py:78:29 - error: Too many type arguments provided for "GoodTyp aliases_implicit.py:79:29 - error: Too many type arguments provided for "GoodTypeAlias8[T@GoodTypeAlias8]"; expected 1 but received 2 (reportInvalidTypeForm) aliases_implicit.py:80:24 - error: Expected ParamSpec, ellipsis, or list of types (reportInvalidTypeForm) aliases_implicit.py:81:9 - error: Could not specialize type "GoodTypeAlias12[TFloat@GoodTypeAlias12]" -  Type "str" is incompatible with type "float" -    "str" is incompatible with "float" (reportInvalidTypeForm) +  Type "str" is not assignable to type "float" +    "str" is not assignable to "float" (reportInvalidTypeForm) aliases_implicit.py:106:9 - error: Variable not allowed in type expression (reportInvalidTypeForm) aliases_implicit.py:107:9 - error: Variable not allowed in type expression (reportInvalidTypeForm) aliases_implicit.py:108:9 - error: Variable not allowed in type expression (reportInvalidTypeForm) @@ -23,8 +23,7 @@ aliases_implicit.py:116:10 - error: Variable not allowed in type expression (rep aliases_implicit.py:117:10 - error: Variable not allowed in type expression (reportInvalidTypeForm) aliases_implicit.py:118:10 - error: Variable not allowed in type expression (reportInvalidTypeForm) aliases_implicit.py:119:10 - error: Variable not allowed in type expression (reportInvalidTypeForm) -aliases_implicit.py:133:6 - error: Object of type "UnionType" is not callable -  Attribute "__call__" is unknown (reportCallIssue) +aliases_implicit.py:133:6 - error: Object of type "UnionType" is not callable (reportCallIssue) aliases_implicit.py:135:5 - error: Type "list[Unknown]" is already specialized (reportInvalidTypeArguments) aliases_implicit.py:135:5 - error: Type "set[Unknown]" is already specialized (reportInvalidTypeArguments) """ diff --git a/conformance/results/pyright/aliases_newtype.toml b/conformance/results/pyright/aliases_newtype.toml index 6d46e752d..256c13616 100644 --- a/conformance/results/pyright/aliases_newtype.toml +++ b/conformance/results/pyright/aliases_newtype.toml @@ -1,9 +1,9 @@ conformant = "Pass" output = """ aliases_newtype.py:11:8 - error: Argument of type "Literal['user']" cannot be assigned to parameter "_x" of type "int" in function "__init__" -  "Literal['user']" is incompatible with "int" (reportArgumentType) -aliases_newtype.py:12:14 - error: Expression of type "Literal[42]" is incompatible with declared type "UserId" -  "Literal[42]" is incompatible with "UserId" (reportAssignmentType) +  "Literal['user']" is not assignable to "int" (reportArgumentType) +aliases_newtype.py:12:14 - error: Type "Literal[42]" is not assignable to declared type "UserId" +  "Literal[42]" is not assignable to "UserId" (reportAssignmentType) aliases_newtype.py:20:16 - error: Second argument to "isinstance" must be a class or tuple of classes   Class created with NewType cannot be used with instance and class checks (reportArgumentType) aliases_newtype.py:23:21 - error: Base class "UserId" is marked final and cannot be subclassed (reportGeneralTypeIssues) @@ -11,9 +11,9 @@ aliases_newtype.py:32:1 - error: NewType must be assigned to a variable with the aliases_newtype.py:38:19 - error: Expected no type arguments for class "GoodNewType1" (reportInvalidTypeArguments) aliases_newtype.py:44:38 - error: Expected class as second argument to NewType (reportGeneralTypeIssues) aliases_newtype.py:47:43 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) -aliases_newtype.py:49:38 - error: NewType cannot be used with structural type (a protocol or TypedDict class) (reportGeneralTypeIssues) +aliases_newtype.py:49:38 - error: NewType cannot be used with structural type (a Protocol or TypedDict class) (reportGeneralTypeIssues) aliases_newtype.py:51:38 - error: NewType cannot be used with Literal type (reportGeneralTypeIssues) -aliases_newtype.py:58:38 - error: NewType cannot be used with structural type (a protocol or TypedDict class) (reportGeneralTypeIssues) +aliases_newtype.py:58:38 - error: NewType cannot be used with structural type (a Protocol or TypedDict class) (reportGeneralTypeIssues) aliases_newtype.py:60:15 - error: NewType requires two positional arguments (reportCallIssue) aliases_newtype.py:62:38 - error: The second argument to NewType must be a known class, not Any or Unknown (reportGeneralTypeIssues) """ diff --git a/conformance/results/pyright/aliases_recursive.toml b/conformance/results/pyright/aliases_recursive.toml index eafd7b25d..dd135ac2b 100644 --- a/conformance/results/pyright/aliases_recursive.toml +++ b/conformance/results/pyright/aliases_recursive.toml @@ -1,66 +1,74 @@ conformant = "Pass" output = """ -aliases_recursive.py:19:12 - error: Expression of type "dict[str, int | complex]" is incompatible with declared type "Json" -  Type "dict[str, int | complex]" is incompatible with type "Json" -    "dict[str, int | complex]" is incompatible with "None" -    "dict[str, int | complex]" is incompatible with "int" -    "dict[str, int | complex]" is incompatible with "str" -    "dict[str, int | complex]" is incompatible with "float" -    "dict[str, int | complex]" is incompatible with "list[Json]" -    "dict[str, int | complex]" is incompatible with "dict[str, Json]" +aliases_recursive.py:19:12 - error: Type "dict[str, int | complex]" is not assignable to declared type "Json" +  Type "dict[str, int | complex]" is not assignable to type "Json" +    "dict[str, int | complex]" is not assignable to "None" +    "dict[str, int | complex]" is not assignable to "int" +    "dict[str, int | complex]" is not assignable to "str" +    "dict[str, int | complex]" is not assignable to "float" +    "dict[str, int | complex]" is not assignable to "list[Json]" +    "dict[str, int | complex]" is not assignable to "dict[str, Json]"       Type parameter "_VT@dict" is invariant, but "int | complex" is not the same as "Json" ... (reportAssignmentType) -aliases_recursive.py:20:16 - error: Expression of type "list[int | complex]" is incompatible with declared type "Json" -  Type "complex" is incompatible with type "Json" -    "complex" is incompatible with "None" -    "complex" is incompatible with "int" -    "complex" is incompatible with "str" -    "complex" is incompatible with "float" -    "complex" is incompatible with "list[Json]" -    "complex" is incompatible with "dict[str, Json]" (reportAssignmentType) -aliases_recursive.py:38:22 - error: Expression of type "tuple[Literal[1], tuple[str, int], tuple[int, tuple[int, list[int]]]]" is incompatible with declared type "RecursiveTuple" -  Type "tuple[Literal[1], tuple[str, int], tuple[int, tuple[int, list[int]]]]" is incompatible with type "RecursiveTuple" -    "tuple[Literal[1], tuple[str, int], tuple[int, tuple[int, list[int]]]]" is incompatible with "str" -    "tuple[Literal[1], tuple[str, int], tuple[int, tuple[int, list[int]]]]" is incompatible with "int" -    "tuple[Literal[1], tuple[str, int], tuple[int, tuple[int, list[int]]]]" is incompatible with "tuple[RecursiveTuple, ...]" -      Tuple entry 1 is incorrect type (reportAssignmentType) -aliases_recursive.py:39:22 - error: Expression of type "tuple[Literal[1], list[int]]" is incompatible with declared type "RecursiveTuple" -  Type "tuple[Literal[1], list[int]]" is incompatible with type "RecursiveTuple" -    "tuple[Literal[1], list[int]]" is incompatible with "str" -    "tuple[Literal[1], list[int]]" is incompatible with "int" -    "tuple[Literal[1], list[int]]" is incompatible with "tuple[RecursiveTuple, ...]" -      Tuple entry 1 is incorrect type (reportAssignmentType) -aliases_recursive.py:50:24 - error: Expression of type "dict[str, list[int]]" is incompatible with declared type "RecursiveMapping" -  Type "dict[str, list[int]]" is incompatible with type "RecursiveMapping" -    "dict[str, list[int]]" is incompatible with "str" -    "dict[str, list[int]]" is incompatible with "int" -    "dict[str, list[int]]" is incompatible with "Mapping[str, RecursiveMapping]" +aliases_recursive.py:20:16 - error: Type "list[int | complex]" is not assignable to declared type "Json" +  Type "complex" is not assignable to type "Json" +    "complex" is not assignable to "None" +    "complex" is not assignable to "int" +    "complex" is not assignable to "str" +    "complex" is not assignable to "float" +    "complex" is not assignable to "list[Json]" +    "complex" is not assignable to "dict[str, Json]" (reportAssignmentType) +aliases_recursive.py:38:22 - error: Type "tuple[Literal[1], tuple[str, int], tuple[int, tuple[int, list[int]]]]" is not assignable to declared type "RecursiveTuple" +  Type "tuple[Literal[1], tuple[str, int], tuple[int, tuple[int, list[int]]]]" is not assignable to type "RecursiveTuple" +    "tuple[Literal[1], tuple[str, int], tuple[int, tuple[int, list[int]]]]" is not assignable to "str" +    "tuple[Literal[1], tuple[str, int], tuple[int, tuple[int, list[int]]]]" is not assignable to "int" +    "tuple[Literal[1], tuple[str, int], tuple[int, tuple[int, list[int]]]]" is not assignable to "tuple[RecursiveTuple, ...]" +      Tuple entry 1 is incorrect type +        Type "tuple[str, int] | tuple[int, tuple[int, list[int]]] | Literal[1]" is not assignable to type "RecursiveTuple" +          Type "tuple[int, tuple[int, list[int]]]" is not assignable to type "RecursiveTuple" (reportAssignmentType) +aliases_recursive.py:39:22 - error: Type "tuple[Literal[1], list[int]]" is not assignable to declared type "RecursiveTuple" +  Type "tuple[Literal[1], list[int]]" is not assignable to type "RecursiveTuple" +    "tuple[Literal[1], list[int]]" is not assignable to "str" +    "tuple[Literal[1], list[int]]" is not assignable to "int" +    "tuple[Literal[1], list[int]]" is not assignable to "tuple[RecursiveTuple, ...]" +      Tuple entry 1 is incorrect type +        Type "list[int] | Literal[1]" is not assignable to type "RecursiveTuple" +          Type "list[int]" is not assignable to type "RecursiveTuple" (reportAssignmentType) +aliases_recursive.py:50:24 - error: Type "dict[str, list[int]]" is not assignable to declared type "RecursiveMapping" +  Type "dict[str, list[int]]" is not assignable to type "RecursiveMapping" +    "dict[str, list[int]]" is not assignable to "str" +    "dict[str, list[int]]" is not assignable to "int" +    "dict[str, list[int]]" is not assignable to "Mapping[str, RecursiveMapping]"       Type parameter "_VT_co@Mapping" is covariant, but "list[int]" is not a subtype of "RecursiveMapping" -        Type "list[int]" is incompatible with type "RecursiveMapping" -          "list[int]" is incompatible with "str" -          "list[int]" is incompatible with "int" +        Type "list[int]" is not assignable to type "RecursiveMapping" +          "list[int]" is not assignable to "str" +          "list[int]" is not assignable to "int" ... (reportAssignmentType) -aliases_recursive.py:51:24 - error: Expression of type "dict[str, str | int | list[int]]" is incompatible with declared type "RecursiveMapping" -  Type "dict[str, str | int | list[int]]" is incompatible with type "RecursiveMapping" -    "dict[str, str | int | list[int]]" is incompatible with "str" -    "dict[str, str | int | list[int]]" is incompatible with "int" -    "dict[str, str | int | list[int]]" is incompatible with "Mapping[str, RecursiveMapping]" -      Type parameter "_VT_co@Mapping" is covariant, but "str | int | list[int]" is not a subtype of "RecursiveMapping" (reportAssignmentType) -aliases_recursive.py:52:24 - error: Expression of type "dict[str, str | int | dict[str, str | int | list[int]]]" is incompatible with declared type "RecursiveMapping" -  Type "dict[str, str | int | dict[str, str | int | list[int]]]" is incompatible with type "RecursiveMapping" -    "dict[str, str | int | dict[str, str | int | list[int]]]" is incompatible with "str" -    "dict[str, str | int | dict[str, str | int | list[int]]]" is incompatible with "int" -    "dict[str, str | int | dict[str, str | int | list[int]]]" is incompatible with "Mapping[str, RecursiveMapping]" -      Type parameter "_VT_co@Mapping" is covariant, but "str | int | dict[str, str | int | list[int]]" is not a subtype of "RecursiveMapping" (reportAssignmentType) -aliases_recursive.py:63:38 - error: Expression of type "list[str | list[float]]" is incompatible with declared type "GenericTypeAlias1[str]" -  Type "float" is incompatible with type "GenericTypeAlias1[T1@GenericTypeAlias1] | str" -    "float" is incompatible with "list[GenericTypeAlias1 | str]" -    "float" is incompatible with "str" (reportAssignmentType) -aliases_recursive.py:69:51 - error: Expression of type "list[list[int | list[str | int | list[float]]] | str]" is incompatible with declared type "GenericTypeAlias2[str, int]" -  Type "float" is incompatible with type "GenericTypeAlias2[T1@GenericTypeAlias2, T2@GenericTypeAlias2] | str | int" -    "float" is incompatible with "list[GenericTypeAlias2 | str | int]" -    "float" is incompatible with "str" -    "float" is incompatible with "int" (reportAssignmentType) +aliases_recursive.py:51:24 - error: Type "dict[str, str | int | list[int]]" is not assignable to declared type "RecursiveMapping" +  Type "dict[str, str | int | list[int]]" is not assignable to type "RecursiveMapping" +    "dict[str, str | int | list[int]]" is not assignable to "str" +    "dict[str, str | int | list[int]]" is not assignable to "int" +    "dict[str, str | int | list[int]]" is not assignable to "Mapping[str, RecursiveMapping]" +      Type parameter "_VT_co@Mapping" is covariant, but "str | int | list[int]" is not a subtype of "RecursiveMapping" +        Type "str | int | list[int]" is not assignable to type "RecursiveMapping" +          Type "list[int]" is not assignable to type "RecursiveMapping" (reportAssignmentType) +aliases_recursive.py:52:24 - error: Type "dict[str, str | int | dict[str, str | int | list[int]]]" is not assignable to declared type "RecursiveMapping" +  Type "dict[str, str | int | dict[str, str | int | list[int]]]" is not assignable to type "RecursiveMapping" +    "dict[str, str | int | dict[str, str | int | list[int]]]" is not assignable to "str" +    "dict[str, str | int | dict[str, str | int | list[int]]]" is not assignable to "int" +    "dict[str, str | int | dict[str, str | int | list[int]]]" is not assignable to "Mapping[str, RecursiveMapping]" +      Type parameter "_VT_co@Mapping" is covariant, but "str | int | dict[str, str | int | list[int]]" is not a subtype of "RecursiveMapping" +        Type "str | int | dict[str, str | int | list[int]]" is not assignable to type "RecursiveMapping" +          Type "dict[str, str | int | list[int]]" is not assignable to type "RecursiveMapping" (reportAssignmentType) +aliases_recursive.py:63:38 - error: Type "list[str | list[float]]" is not assignable to declared type "GenericTypeAlias1[str]" +  Type "float" is not assignable to type "GenericTypeAlias1[T1@GenericTypeAlias1] | str" +    "float" is not assignable to "list[GenericTypeAlias1 | str]" +    "float" is not assignable to "str" (reportAssignmentType) +aliases_recursive.py:69:51 - error: Type "list[list[int | list[str | int | list[float]]] | str]" is not assignable to declared type "GenericTypeAlias2[str, int]" +  Type "float" is not assignable to type "GenericTypeAlias2[T1@GenericTypeAlias2, T2@GenericTypeAlias2] | str | int" +    "float" is not assignable to "list[GenericTypeAlias2 | str | int]" +    "float" is not assignable to "str" +    "float" is not assignable to "int" (reportAssignmentType) aliases_recursive.py:72:29 - error: Type alias "RecursiveUnion" cannot use itself in its definition (reportGeneralTypeIssues) aliases_recursive.py:75:31 - error: Type alias "MutualReference1" cannot use itself in its definition (reportGeneralTypeIssues) """ diff --git a/conformance/results/pyright/aliases_type_statement.toml b/conformance/results/pyright/aliases_type_statement.toml index c134a70ef..ee9f8f7c3 100644 --- a/conformance/results/pyright/aliases_type_statement.toml +++ b/conformance/results/pyright/aliases_type_statement.toml @@ -8,44 +8,44 @@ aliases_type_statement.py:23:18 - error: Cannot access attribute "other_attrib"   Attribute "other_attrib" is unknown (reportAttributeAccessIssue) aliases_type_statement.py:26:18 - error: A type alias defined in a "type" statement cannot be used as a base class (reportGeneralTypeIssues) aliases_type_statement.py:31:22 - error: Argument of type "TypeAliasType" cannot be assigned to parameter "class_or_tuple" of type "_ClassInfo" in function "isinstance" -  Type "TypeAliasType" is incompatible with type "_ClassInfo" -    "TypeAliasType" is incompatible with "type" -    "TypeAliasType" is incompatible with "UnionType" -    "TypeAliasType" is incompatible with "tuple[_ClassInfo, ...]" (reportArgumentType) +  Type "TypeAliasType" is not assignable to type "_ClassInfo" +    "TypeAliasType" is not assignable to "type" +    "TypeAliasType" is not assignable to "UnionType" +    "TypeAliasType" is not assignable to "tuple[_ClassInfo, ...]" (reportArgumentType) aliases_type_statement.py:37:22 - error: Call expression not allowed in type expression (reportInvalidTypeForm) -aliases_type_statement.py:38:22 - error: List expression not allowed in type annotation +aliases_type_statement.py:38:22 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) aliases_type_statement.py:38:22 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues) -aliases_type_statement.py:39:22 - error: Tuple expression not allowed in type annotation +aliases_type_statement.py:39:22 - error: Tuple expression not allowed in type expression   Use tuple[T1, ..., Tn] to indicate a tuple type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) -aliases_type_statement.py:40:22 - error: List expression not allowed in type annotation +aliases_type_statement.py:40:22 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) aliases_type_statement.py:40:22 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) -aliases_type_statement.py:41:22 - error: Dictionary expression not allowed in type annotation +aliases_type_statement.py:41:22 - error: Dictionary expression not allowed in type expression   Use Dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm) aliases_type_statement.py:41:22 - error: Expected class but received "dict[str, Unknown]" (reportGeneralTypeIssues) aliases_type_statement.py:41:29 - error: "b" is not defined (reportUndefinedVariable) aliases_type_statement.py:42:22 - error: Call expression not allowed in type expression (reportInvalidTypeForm) -aliases_type_statement.py:43:22 - error: List expression not allowed in type annotation +aliases_type_statement.py:43:22 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) aliases_type_statement.py:43:22 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) aliases_type_statement.py:43:28 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues) -aliases_type_statement.py:44:22 - error: Ternary expression not allowed in type annotation (reportInvalidTypeForm) +aliases_type_statement.py:44:22 - error: Ternary expression not allowed in type expression (reportInvalidTypeForm) aliases_type_statement.py:45:22 - error: Variable not allowed in type expression (reportInvalidTypeForm) aliases_type_statement.py:46:23 - error: Expected class but received "Literal[True]" (reportGeneralTypeIssues) aliases_type_statement.py:47:23 - error: Expected class but received "Literal[1]" (reportGeneralTypeIssues) -aliases_type_statement.py:48:23 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) -aliases_type_statement.py:49:23 - error: Type annotations cannot use format string literals (f-strings) (reportGeneralTypeIssues) +aliases_type_statement.py:48:23 - error: Binary operator not allowed in type expression (reportInvalidTypeForm) +aliases_type_statement.py:49:23 - error: Type expressions cannot use format string literals (f-strings) (reportGeneralTypeIssues) aliases_type_statement.py:52:10 - error: Type alias declaration "BadTypeAlias14" is obscured by a declaration of the same name (reportRedeclaration) aliases_type_statement.py:58:10 - error: A type statement can be used only within a module or class scope (reportGeneralTypeIssues) aliases_type_statement.py:64:23 - error: Type parameter "V" is not included in the type parameter list for "TA1" (reportGeneralTypeIssues) aliases_type_statement.py:69:17 - error: Type parameter "T1" is not included in the type parameter list for "TA2" (reportGeneralTypeIssues) aliases_type_statement.py:79:7 - error: Could not specialize type "RecursiveTypeAlias2[S@RecursiveTypeAlias2, T@RecursiveTypeAlias2, P@RecursiveTypeAlias2]" -  Type "str" is incompatible with type "int" -    "str" is incompatible with "int" (reportInvalidTypeForm) +  Type "str" is not assignable to type "int" +    "str" is not assignable to "int" (reportInvalidTypeForm) aliases_type_statement.py:81:7 - error: Could not specialize type "RecursiveTypeAlias2[S@RecursiveTypeAlias2, T@RecursiveTypeAlias2, P@RecursiveTypeAlias2]" -  Type "int" is incompatible with type "str" -    "int" is incompatible with "str" (reportInvalidTypeForm) +  Type "int" is not assignable to type "str" +    "int" is not assignable to "str" (reportInvalidTypeForm) aliases_type_statement.py:84:28 - error: Type alias "RecursiveTypeAlias3" cannot use itself in its definition (reportGeneralTypeIssues) aliases_type_statement.py:86:31 - error: Type alias "RecursiveTypeAlias4" cannot use itself in its definition (reportGeneralTypeIssues) aliases_type_statement.py:90:28 - error: Type alias "RecursiveTypeAlias6" cannot use itself in its definition (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/aliases_typealiastype.toml b/conformance/results/pyright/aliases_typealiastype.toml index dc1e9900f..64ebf8cfe 100644 --- a/conformance/results/pyright/aliases_typealiastype.toml +++ b/conformance/results/pyright/aliases_typealiastype.toml @@ -3,8 +3,8 @@ output = """ aliases_typealiastype.py:32:18 - error: Cannot access attribute "other_attrib" for class "TypeAliasType"   Attribute "other_attrib" is unknown (reportAttributeAccessIssue) aliases_typealiastype.py:40:5 - error: Could not specialize type "GoodAlias5[S@GoodAlias5, TStr@GoodAlias5, P@GoodAlias5, Ts@GoodAlias5]" -  Type "int" is incompatible with type "str" -    "int" is incompatible with "str" (reportInvalidTypeForm) +  Type "int" is not assignable to type "str" +    "int" is not assignable to "str" (reportInvalidTypeForm) aliases_typealiastype.py:43:45 - error: Type variable "S" has no meaning in this context (reportGeneralTypeIssues) aliases_typealiastype.py:44:45 - error: Type variable "S" has no meaning in this context (reportGeneralTypeIssues) aliases_typealiastype.py:45:57 - error: Type parameter list must be a tuple containing only TypeVar, TypeVarTuple, or ParamSpec (reportGeneralTypeIssues) @@ -18,16 +18,16 @@ aliases_typealiastype.py:55:42 - error: Expected class but received "list[type[i aliases_typealiastype.py:56:42 - error: Expected class but received "dict[str, Unknown]" (reportGeneralTypeIssues) aliases_typealiastype.py:56:49 - error: "b" is not defined (reportUndefinedVariable) aliases_typealiastype.py:57:42 - error: Call expression not allowed in type expression (reportInvalidTypeForm) -aliases_typealiastype.py:58:42 - error: List expression not allowed in type annotation +aliases_typealiastype.py:58:42 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) aliases_typealiastype.py:58:42 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) aliases_typealiastype.py:58:48 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues) -aliases_typealiastype.py:59:42 - error: Ternary expression not allowed in type annotation (reportInvalidTypeForm) +aliases_typealiastype.py:59:42 - error: Ternary expression not allowed in type expression (reportInvalidTypeForm) aliases_typealiastype.py:60:42 - error: Variable not allowed in type expression (reportInvalidTypeForm) aliases_typealiastype.py:61:42 - error: Expected class but received "Literal[True]" (reportGeneralTypeIssues) aliases_typealiastype.py:62:42 - error: Expected class but received "Literal[1]" (reportGeneralTypeIssues) -aliases_typealiastype.py:63:42 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) -aliases_typealiastype.py:64:42 - error: Type annotations cannot use format string literals (f-strings) (reportGeneralTypeIssues) +aliases_typealiastype.py:63:42 - error: Binary operator not allowed in type expression (reportInvalidTypeForm) +aliases_typealiastype.py:64:42 - error: Type expressions cannot use format string literals (f-strings) (reportGeneralTypeIssues) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/annotations_forward_refs.toml b/conformance/results/pyright/annotations_forward_refs.toml index ae62e5d05..297096740 100644 --- a/conformance/results/pyright/annotations_forward_refs.toml +++ b/conformance/results/pyright/annotations_forward_refs.toml @@ -4,30 +4,30 @@ annotations_forward_refs.py:22:7 - error: "ClassA" is not defined (reportUndefin annotations_forward_refs.py:23:12 - error: "ClassA" is not defined (reportUndefinedVariable) annotations_forward_refs.py:24:7 - error: Union syntax cannot be used with string operand; use quotes around entire expression (reportGeneralTypeIssues) annotations_forward_refs.py:25:13 - error: Union syntax cannot be used with string operand; use quotes around entire expression (reportGeneralTypeIssues) -annotations_forward_refs.py:41:9 - error: Expected type but received a string literal (reportGeneralTypeIssues) -annotations_forward_refs.py:42:10 - error: List expression not allowed in type annotation +annotations_forward_refs.py:41:10 - error: Call expression not allowed in type expression (reportInvalidTypeForm) +annotations_forward_refs.py:42:10 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) annotations_forward_refs.py:42:10 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues) -annotations_forward_refs.py:43:10 - error: Tuple expression not allowed in type annotation +annotations_forward_refs.py:43:10 - error: Tuple expression not allowed in type expression   Use tuple[T1, ..., Tn] to indicate a tuple type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) -annotations_forward_refs.py:44:10 - error: List expression not allowed in type annotation +annotations_forward_refs.py:44:10 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) annotations_forward_refs.py:44:10 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) -annotations_forward_refs.py:45:10 - error: Dictionary expression not allowed in type annotation +annotations_forward_refs.py:45:10 - error: Dictionary expression not allowed in type expression   Use Dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm) annotations_forward_refs.py:45:10 - error: Expected class but received "dict[Unknown, Unknown]" (reportGeneralTypeIssues) annotations_forward_refs.py:46:10 - error: Call expression not allowed in type expression (reportInvalidTypeForm) -annotations_forward_refs.py:47:10 - error: List expression not allowed in type annotation +annotations_forward_refs.py:47:10 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) annotations_forward_refs.py:47:10 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) annotations_forward_refs.py:47:16 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues) -annotations_forward_refs.py:48:10 - error: Ternary expression not allowed in type annotation (reportInvalidTypeForm) +annotations_forward_refs.py:48:10 - error: Ternary expression not allowed in type expression (reportInvalidTypeForm) annotations_forward_refs.py:49:10 - error: Variable not allowed in type expression (reportInvalidTypeForm) annotations_forward_refs.py:50:11 - error: Expected class but received "Literal[True]" (reportGeneralTypeIssues) annotations_forward_refs.py:51:11 - error: Expected class but received "Literal[1]" (reportGeneralTypeIssues) -annotations_forward_refs.py:52:11 - error: Unary operator not allowed in type annotation (reportInvalidTypeForm) -annotations_forward_refs.py:53:11 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) -annotations_forward_refs.py:54:11 - error: Type annotations cannot use format string literals (f-strings) (reportGeneralTypeIssues) +annotations_forward_refs.py:52:11 - error: Unary operator not allowed in type expression (reportInvalidTypeForm) +annotations_forward_refs.py:53:11 - error: Binary operator not allowed in type expression (reportInvalidTypeForm) +annotations_forward_refs.py:54:11 - error: Type expressions cannot use format string literals (f-strings) (reportGeneralTypeIssues) annotations_forward_refs.py:55:10 - error: Module cannot be used as a type (reportGeneralTypeIssues) annotations_forward_refs.py:66:26 - error: "ClassB" is not defined (reportUndefinedVariable) annotations_forward_refs.py:80:14 - error: Type of "ClassF" could not be determined because it refers to itself (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/annotations_generators.toml b/conformance/results/pyright/annotations_generators.toml index 23081ff4f..fd4b61db3 100644 --- a/conformance/results/pyright/annotations_generators.toml +++ b/conformance/results/pyright/annotations_generators.toml @@ -1,35 +1,35 @@ conformant = "Pass" output = """ annotations_generators.py:51:21 - error: Function with declared return type "C" must return value on all code paths -  "None" is incompatible with "C" (reportReturnType) -annotations_generators.py:54:16 - error: Expression of type "Literal[False]" is incompatible with return type "C" -  "Literal[False]" is incompatible with "C" (reportReturnType) +  "None" is not assignable to "C" (reportReturnType) +annotations_generators.py:54:16 - error: Type "Literal[False]" is not assignable to return type "C" +  "Literal[False]" is not assignable to "C" (reportReturnType) annotations_generators.py:57:15 - error: Return type of generator function must be compatible with "Generator[Literal[3], Any, Any]" -  "Literal[3]" is incompatible with "A" (reportReturnType) +  "Literal[3]" is not assignable to "A" (reportReturnType) annotations_generators.py:66:15 - error: Return type of generator function must be compatible with "Generator[Literal[3], Any, Any]" -  "Literal[3]" is incompatible with "A" (reportReturnType) +  "Literal[3]" is not assignable to "A" (reportReturnType) annotations_generators.py:75:11 - error: Return type of generator function must be compatible with "Generator[B, Any, Any]" -  "B" is incompatible with "A" (reportReturnType) +  "B" is not assignable to "A" (reportReturnType) annotations_generators.py:86:21 - error: Return type of generator function must be compatible with "Generator[Any, Any, Any]" -  "Generator[Any, Any, Any]" is incompatible with "int" (reportInvalidTypeForm) +  "Generator[Any, Any, Any]" is not assignable to "int" (reportInvalidTypeForm) annotations_generators.py:87:11 - error: Return type of generator function must be compatible with "Generator[None, Any, Any]" -  "Generator[None, Unknown, Unknown]" is incompatible with "int" (reportReturnType) +  "Generator[None, Unknown, Unknown]" is not assignable to "int" (reportReturnType) annotations_generators.py:91:27 - error: Return type of async generator function must be compatible with "AsyncGenerator[Any, Any]" -  "AsyncGenerator[Any, Any, Any]" is incompatible with "int" (reportInvalidTypeForm) +  "AsyncGenerator[Any, Any, Any]" is not assignable to "int" (reportInvalidTypeForm) annotations_generators.py:92:11 - error: Return type of async generator function must be compatible with "AsyncGenerator[None, Any]" -  "AsyncGenerator[None, Unknown, Unknown]" is incompatible with "int" (reportReturnType) +  "AsyncGenerator[None, Unknown, Unknown]" is not assignable to "int" (reportReturnType) annotations_generators.py:118:16 - error: Return type of generator function must be compatible with "Generator[A, Any, Any]" -  "Generator[A, Unknown, Unknown]" is incompatible with "Iterator[B]" +  "Generator[A, Unknown, Unknown]" is not assignable to "Iterator[B]"     Type parameter "_T_co@Iterator" is covariant, but "A" is not a subtype of "B" -      "A" is incompatible with "B" (reportReturnType) +      "A" is not assignable to "B" (reportReturnType) annotations_generators.py:119:16 - error: Return type of generator function must be compatible with "Generator[int, Any, Any]" -  "Generator[int, Unknown, Unknown]" is incompatible with "Iterator[B]" +  "Generator[int, Unknown, Unknown]" is not assignable to "Iterator[B]"     Type parameter "_T_co@Iterator" is covariant, but "int" is not a subtype of "B" -      "int" is incompatible with "B" (reportReturnType) +      "int" is not assignable to "B" (reportReturnType) annotations_generators.py:135:16 - error: Return type of generator function must be compatible with "Generator[None, Any, Any]" -  "Generator[None, int, Unknown]" is incompatible with "Generator[None, str, None]" +  "Generator[None, int, Unknown]" is not assignable to "Generator[None, str, None]"     Type parameter "_SendT_contra@Generator" is contravariant, but "int" is not a supertype of "str" -      "str" is incompatible with "int" (reportReturnType) +      "str" is not assignable to "int" (reportReturnType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/annotations_methods.toml b/conformance/results/pyright/annotations_methods.toml index 120e85cae..27ff70b96 100644 --- a/conformance/results/pyright/annotations_methods.toml +++ b/conformance/results/pyright/annotations_methods.toml @@ -4,7 +4,7 @@ Type evaluation differs from other type checkers because of ambiguity in the spe """ output = """ annotations_methods.py:46:8 - error: Argument of type "A" cannot be assigned to parameter "self" of type "B" in function "copy" -  "A" is incompatible with "B" (reportArgumentType) +  "A" is not assignable to "B" (reportArgumentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/annotations_typeexpr.toml b/conformance/results/pyright/annotations_typeexpr.toml index 9eed10f39..5504e9464 100644 --- a/conformance/results/pyright/annotations_typeexpr.toml +++ b/conformance/results/pyright/annotations_typeexpr.toml @@ -1,29 +1,29 @@ conformant = "Pass" output = """ annotations_typeexpr.py:88:9 - error: Call expression not allowed in type expression (reportInvalidTypeForm) -annotations_typeexpr.py:89:9 - error: List expression not allowed in type annotation +annotations_typeexpr.py:89:9 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) annotations_typeexpr.py:89:9 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues) -annotations_typeexpr.py:90:9 - error: Tuple expression not allowed in type annotation +annotations_typeexpr.py:90:9 - error: Tuple expression not allowed in type expression   Use tuple[T1, ..., Tn] to indicate a tuple type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) -annotations_typeexpr.py:91:9 - error: List expression not allowed in type annotation +annotations_typeexpr.py:91:9 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) annotations_typeexpr.py:91:9 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) -annotations_typeexpr.py:92:9 - error: Dictionary expression not allowed in type annotation +annotations_typeexpr.py:92:9 - error: Dictionary expression not allowed in type expression   Use Dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm) annotations_typeexpr.py:92:9 - error: Expected class but received "dict[Unknown, Unknown]" (reportGeneralTypeIssues) annotations_typeexpr.py:93:9 - error: Call expression not allowed in type expression (reportInvalidTypeForm) -annotations_typeexpr.py:94:9 - error: List expression not allowed in type annotation +annotations_typeexpr.py:94:9 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) annotations_typeexpr.py:94:9 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) annotations_typeexpr.py:94:15 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues) -annotations_typeexpr.py:95:9 - error: Ternary expression not allowed in type annotation (reportInvalidTypeForm) +annotations_typeexpr.py:95:9 - error: Ternary expression not allowed in type expression (reportInvalidTypeForm) annotations_typeexpr.py:96:9 - error: Variable not allowed in type expression (reportInvalidTypeForm) annotations_typeexpr.py:97:10 - error: Expected class but received "Literal[True]" (reportGeneralTypeIssues) annotations_typeexpr.py:98:10 - error: Expected class but received "Literal[1]" (reportGeneralTypeIssues) -annotations_typeexpr.py:99:10 - error: Unary operator not allowed in type annotation (reportInvalidTypeForm) -annotations_typeexpr.py:100:10 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) -annotations_typeexpr.py:101:10 - error: Type annotations cannot use format string literals (f-strings) (reportGeneralTypeIssues) +annotations_typeexpr.py:99:10 - error: Unary operator not allowed in type expression (reportInvalidTypeForm) +annotations_typeexpr.py:100:10 - error: Binary operator not allowed in type expression (reportInvalidTypeForm) +annotations_typeexpr.py:101:10 - error: Type expressions cannot use format string literals (f-strings) (reportGeneralTypeIssues) annotations_typeexpr.py:102:10 - error: Module cannot be used as a type (reportGeneralTypeIssues) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/callables_annotation.toml b/conformance/results/pyright/callables_annotation.toml index 8da8432a5..66fdcb54e 100644 --- a/conformance/results/pyright/callables_annotation.toml +++ b/conformance/results/pyright/callables_annotation.toml @@ -2,7 +2,7 @@ conformant = "Pass" output = """ callables_annotation.py:25:5 - error: Expected 1 more positional argument (reportCallIssue) callables_annotation.py:26:11 - error: Argument of type "Literal[2]" cannot be assigned to parameter of type "str" -  "Literal[2]" is incompatible with "str" (reportArgumentType) +  "Literal[2]" is not assignable to "str" (reportArgumentType) callables_annotation.py:27:15 - error: Expected 2 positional arguments (reportCallIssue) callables_annotation.py:29:10 - error: Expected 2 more positional arguments (reportCallIssue) callables_annotation.py:35:8 - error: Expected 0 positional arguments (reportCallIssue) @@ -12,29 +12,29 @@ callables_annotation.py:57:18 - error: List expression not allowed for this type callables_annotation.py:58:14 - error: Expected parameter type list or "..." (reportInvalidTypeForm) callables_annotation.py:58:24 - error: Expected only two type arguments to "Callable" (reportInvalidTypeForm) callables_annotation.py:59:15 - error: "..." is not allowed in this context (reportInvalidTypeForm) -callables_annotation.py:91:7 - error: Expression of type "() -> str" is incompatible with declared type "(int, ...) -> str" -  Type "() -> str" is incompatible with type "(int, ...) -> str" +callables_annotation.py:91:7 - error: Type "() -> str" is not assignable to declared type "(int, ...) -> str" +  Type "() -> str" is not assignable to type "(int, ...) -> str"     Function accepts too many positional parameters; expected 0 but received 2 (reportAssignmentType) -callables_annotation.py:93:7 - error: Expression of type "(*, a: int) -> str" is incompatible with declared type "(int, ...) -> str" -  Type "(*, a: int) -> str" is incompatible with type "(int, ...) -> str" +callables_annotation.py:93:7 - error: Type "(*, a: int) -> str" is not assignable to declared type "(int, ...) -> str" +  Type "(*, a: int) -> str" is not assignable to type "(int, ...) -> str"     Function accepts too many positional parameters; expected 0 but received 2 (reportAssignmentType) -callables_annotation.py:159:25 - error: Expression of type "Proto8" is incompatible with declared type "Proto5[Any]" +callables_annotation.py:159:25 - error: Type "Proto8" is not assignable to declared type "Proto5[Any]"   "Proto8" is incompatible with protocol "Proto5[Any]"     "__call__" is an incompatible type -      Type "() -> None" is incompatible with type "(*args: T_contra@Proto5, **kwargs: T_contra@Proto5) -> None" +      Type "() -> None" is not assignable to type "(*args: T_contra@Proto5, **kwargs: T_contra@Proto5) -> None"         Parameter "*args" has no corresponding parameter         Parameter "**kwargs" has no corresponding parameter (reportAssignmentType) -callables_annotation.py:172:26 - error: Expression of type "() -> str" is incompatible with declared type "Callback2[...]" -  Type "() -> str" is incompatible with type "Callback2[...]" +callables_annotation.py:172:26 - error: Type "() -> str" is not assignable to declared type "Callback2[...]" +  Type "() -> str" is not assignable to type "Callback2[...]"     Function accepts too many positional parameters; expected 0 but received 2 (reportAssignmentType) -callables_annotation.py:187:48 - error: Expression of type "(int, str) -> str" is incompatible with declared type "(str, ...) -> str" -  Type "(int, str) -> str" is incompatible with type "(str, ...) -> str" +callables_annotation.py:187:48 - error: Type "(int, str) -> str" is not assignable to declared type "(str, ...) -> str" +  Type "(int, str) -> str" is not assignable to type "(str, ...) -> str"     Parameter 1: type "str" is incompatible with type "int" -      "str" is incompatible with "int" (reportAssignmentType) -callables_annotation.py:189:32 - error: Expression of type "(int, str) -> str" is incompatible with declared type "CallbackWithStr[...]" -  Type "(int, str) -> str" is incompatible with type "CallbackWithStr[...]" +      "str" is not assignable to "int" (reportAssignmentType) +callables_annotation.py:189:32 - error: Type "(int, str) -> str" is not assignable to declared type "CallbackWithStr[...]" +  Type "(int, str) -> str" is not assignable to type "CallbackWithStr[...]"     Parameter 1: type "str" is incompatible with type "int" -      "str" is incompatible with "int" (reportAssignmentType) +      "str" is not assignable to "int" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/callables_kwargs.toml b/conformance/results/pyright/callables_kwargs.toml index 51ad276db..b3e1e6c04 100644 --- a/conformance/results/pyright/callables_kwargs.toml +++ b/conformance/results/pyright/callables_kwargs.toml @@ -1,33 +1,38 @@ -conformant = "Pass" +conformant = "Partial" +notes = """ +Incorrectly handles assert_type for unpacked TypedDict. +""" output = """ callables_kwargs.py:28:5 - error: Could not access item in TypedDict   "v2" is not a required key in "*TD2", so access may result in runtime exception (reportTypedDictNotRequiredAccess) +callables_kwargs.py:41:17 - error: "assert_type" mismatch: expected "TD1" but received "*TD1" (reportAssertTypeFailure) callables_kwargs.py:46:5 - error: Arguments missing for parameters "v1", "v3" (reportCallIssue) callables_kwargs.py:51:32 - error: No parameter named "v4" (reportCallIssue) callables_kwargs.py:52:11 - error: Expected 0 positional arguments (reportCallIssue) callables_kwargs.py:58:13 - error: Argument of type "str" cannot be assigned to parameter "v1" of type "int" in function "func1" -  "str" is incompatible with "int" (reportArgumentType) +  "str" is not assignable to "int" (reportArgumentType) callables_kwargs.py:63:19 - error: Unable to match unpacked TypedDict argument to parameters   Parameter "v1" is already assigned (reportCallIssue) callables_kwargs.py:64:16 - error: Unable to match unpacked TypedDict argument to parameters   Parameter "v3" is already assigned (reportCallIssue) callables_kwargs.py:65:19 - error: Unable to match unpacked TypedDict argument to parameters   Parameter "v1" is already assigned (reportCallIssue) -callables_kwargs.py:101:19 - error: Expression of type "(**kwargs: **TD2) -> None" is incompatible with declared type "TDProtocol3" -  Type "(**kwargs: **TD2) -> None" is incompatible with type "(*, v1: int, v2: int, v3: str) -> None" +callables_kwargs.py:101:19 - error: Type "(**kwargs: **TD2) -> None" is not assignable to declared type "TDProtocol3" +  Type "(**kwargs: **TD2) -> None" is not assignable to type "(*, v1: int, v2: int, v3: str) -> None"     Keyword parameter "v2" of type "int" is incompatible with type "str" -      "int" is incompatible with "str" (reportAssignmentType) -callables_kwargs.py:102:19 - error: Expression of type "(**kwargs: **TD2) -> None" is incompatible with declared type "TDProtocol4" -  Type "(**kwargs: **TD2) -> None" is incompatible with type "(*, v1: int) -> None" +      "int" is not assignable to "str" (reportAssignmentType) +callables_kwargs.py:102:19 - error: Type "(**kwargs: **TD2) -> None" is not assignable to declared type "TDProtocol4" +  Type "(**kwargs: **TD2) -> None" is not assignable to type "(*, v1: int) -> None"     Extra parameter "v3" (reportAssignmentType) -callables_kwargs.py:103:19 - error: Expression of type "(**kwargs: **TD2) -> None" is incompatible with declared type "TDProtocol5" -  Type "(**kwargs: **TD2) -> None" is incompatible with type "(v1: int, v3: str) -> None" +callables_kwargs.py:103:19 - error: Type "(**kwargs: **TD2) -> None" is not assignable to declared type "TDProtocol5" +  Type "(**kwargs: **TD2) -> None" is not assignable to type "(v1: int, v3: str) -> None"     Function accepts too many positional parameters; expected 0 but received 2       Extra parameter "v1"       Extra parameter "v3" (reportAssignmentType) callables_kwargs.py:111:30 - error: Typed dictionary overlaps with keyword parameter: v1 (reportGeneralTypeIssues) callables_kwargs.py:122:21 - error: Expected TypedDict type argument for Unpack (reportGeneralTypeIssues) """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 41: Unexpected errors ['callables_kwargs.py:41:17 - error: "assert_type" mismatch: expected "TD1" but received "*TD1" (reportAssertTypeFailure)'] """ diff --git a/conformance/results/pyright/callables_protocol.toml b/conformance/results/pyright/callables_protocol.toml index df57b9b31..47af00471 100644 --- a/conformance/results/pyright/callables_protocol.toml +++ b/conformance/results/pyright/callables_protocol.toml @@ -1,62 +1,66 @@ conformant = "Pass" output = """ -callables_protocol.py:35:7 - error: Expression of type "(*vals: bytes, max_items: int | None) -> list[bytes]" is incompatible with declared type "Proto1" -  Type "(*vals: bytes, max_items: int | None) -> list[bytes]" is incompatible with type "(*vals: bytes, max_len: int | None = None) -> list[bytes]" +callables_protocol.py:35:7 - error: Type "(*vals: bytes, max_items: int | None) -> list[bytes]" is not assignable to declared type "Proto1" +  Type "(*vals: bytes, max_items: int | None) -> list[bytes]" is not assignable to type "(*vals: bytes, max_len: int | None = None) -> list[bytes]"     Extra parameter "max_items"     Missing keyword parameter "max_len" (reportAssignmentType) -callables_protocol.py:36:7 - error: Expression of type "(*vals: bytes) -> list[bytes]" is incompatible with declared type "Proto1" -  Type "(*vals: bytes) -> list[bytes]" is incompatible with type "(*vals: bytes, max_len: int | None = None) -> list[bytes]" +callables_protocol.py:36:7 - error: Type "(*vals: bytes) -> list[bytes]" is not assignable to declared type "Proto1" +  Type "(*vals: bytes) -> list[bytes]" is not assignable to type "(*vals: bytes, max_len: int | None = None) -> list[bytes]"     Missing keyword parameter "max_len" (reportAssignmentType) -callables_protocol.py:37:7 - error: Expression of type "(*vals: bytes, max_len: str | None) -> list[bytes]" is incompatible with declared type "Proto1" -  Type "(*vals: bytes, max_len: str | None) -> list[bytes]" is incompatible with type "(*vals: bytes, max_len: int | None = None) -> list[bytes]" +callables_protocol.py:37:7 - error: Type "(*vals: bytes, max_len: str | None) -> list[bytes]" is not assignable to declared type "Proto1" +  Type "(*vals: bytes, max_len: str | None) -> list[bytes]" is not assignable to type "(*vals: bytes, max_len: int | None = None) -> list[bytes]"     Keyword parameter "max_len" of type "int | None" is incompatible with type "str | None" +      Type "int | None" is not assignable to type "str | None" +        Type "int" is not assignable to type "str | None" +          "int" is not assignable to "str" +          "int" is not assignable to "None"     Parameter "max_len" is missing default argument (reportAssignmentType) -callables_protocol.py:67:7 - error: Expression of type "(*a: bytes) -> None" is incompatible with declared type "Proto2" -  Type "(*a: bytes) -> None" is incompatible with type "(*vals: bytes, **kwargs: str) -> None" +callables_protocol.py:67:7 - error: Type "(*a: bytes) -> None" is not assignable to declared type "Proto2" +  Type "(*a: bytes) -> None" is not assignable to type "(*vals: bytes, **kwargs: str) -> None"     Parameter "**kwargs" has no corresponding parameter (reportAssignmentType) -callables_protocol.py:68:7 - error: Expression of type "(*a: str, **b: str) -> None" is incompatible with declared type "Proto2" -  Type "(*a: str, **b: str) -> None" is incompatible with type "(*vals: bytes, **kwargs: str) -> None" +callables_protocol.py:68:7 - error: Type "(*a: str, **b: str) -> None" is not assignable to declared type "Proto2" +  Type "(*a: str, **b: str) -> None" is not assignable to type "(*vals: bytes, **kwargs: str) -> None"     Parameter 1: type "*tuple[bytes, ...]" is incompatible with type "*tuple[str, ...]" -      "*tuple[bytes, ...]" is incompatible with "*tuple[str, ...]" +      "*tuple[bytes, ...]" is not assignable to "*tuple[str, ...]"         Tuple entry 1 is incorrect type -          "bytes" is incompatible with "str" (reportAssignmentType) -callables_protocol.py:69:7 - error: Expression of type "(*a: bytes, **b: bytes) -> None" is incompatible with declared type "Proto2" -  Type "(*a: bytes, **b: bytes) -> None" is incompatible with type "(*vals: bytes, **kwargs: str) -> None" +          "bytes" is not assignable to "str" (reportAssignmentType) +callables_protocol.py:69:7 - error: Type "(*a: bytes, **b: bytes) -> None" is not assignable to declared type "Proto2" +  Type "(*a: bytes, **b: bytes) -> None" is not assignable to type "(*vals: bytes, **kwargs: str) -> None"     Parameter 2: type "str" is incompatible with type "bytes" -      "str" is incompatible with "bytes" (reportAssignmentType) -callables_protocol.py:70:7 - error: Expression of type "(**b: str) -> None" is incompatible with declared type "Proto2" -  Type "(**b: str) -> None" is incompatible with type "(*vals: bytes, **kwargs: str) -> None" +      "str" is not assignable to "bytes" (reportAssignmentType) +callables_protocol.py:70:7 - error: Type "(**b: str) -> None" is not assignable to declared type "Proto2" +  Type "(**b: str) -> None" is not assignable to type "(*vals: bytes, **kwargs: str) -> None"     Parameter "*vals" has no corresponding parameter (reportAssignmentType) -callables_protocol.py:97:16 - error: Expression of type "(x: int) -> None" is incompatible with declared type "Proto4" +callables_protocol.py:97:16 - error: Type "(x: int) -> None" is not assignable to declared type "Proto4"   "function" is incompatible with protocol "Proto4"     "other_attribute" is not present     "__call__" is not present (reportAssignmentType) -callables_protocol.py:121:18 - error: Expression of type "(*vals: bytes, max_len: int | None = None) -> list[bytes]" is incompatible with declared type "NotProto6" -  "function" is incompatible with "NotProto6" (reportAssignmentType) -callables_protocol.py:169:7 - error: Expression of type "(x: int) -> Any" is incompatible with declared type "Proto8" +callables_protocol.py:121:18 - error: Type "(*vals: bytes, max_len: int | None = None) -> list[bytes]" is not assignable to declared type "NotProto6" +  "function" is not assignable to "NotProto6" (reportAssignmentType) +callables_protocol.py:169:7 - error: Type "(x: int) -> Any" is not assignable to declared type "Proto8"   One or more overloads of "__call__" is not assignable -    Type "(x: int) -> Any" is incompatible with type "(x: str) -> str" +    Type "(x: int) -> Any" is not assignable to type "(x: str) -> str"       Parameter 1: type "str" is incompatible with type "int" -        "str" is incompatible with "int" (reportAssignmentType) +        "str" is not assignable to "int" (reportAssignmentType) callables_protocol.py:186:33 - error: Cannot assign to attribute "other_attribute" for class "Proto9[P@decorator1, R@decorator1]" -  "Literal['str']" is incompatible with "int" (reportAttributeAccessIssue) +  "Literal['str']" is not assignable to "int" (reportAttributeAccessIssue) callables_protocol.py:187:15 - error: Cannot assign to attribute "xxx" for class "Proto9[P@decorator1, R@decorator1]"   Attribute "xxx" is unknown (reportAttributeAccessIssue) callables_protocol.py:197:16 - error: Cannot access attribute "other_attribute2" for class "Proto9[(x: int), str]"   Attribute "other_attribute2" is unknown (reportAttributeAccessIssue) -callables_protocol.py:238:8 - error: Expression of type "(x: int, y: str, /) -> Any" is incompatible with declared type "Proto11" -  Type "(x: int, y: str, /) -> Any" is incompatible with type "(x: int, /, y: str) -> Any" +callables_protocol.py:238:8 - error: Type "(x: int, y: str, /) -> Any" is not assignable to declared type "Proto11" +  Type "(x: int, y: str, /) -> Any" is not assignable to type "(x: int, /, y: str) -> Any"     Missing keyword parameter "y"       Position-only parameter mismatch; parameter "y" is not position-only       Position-only parameter mismatch; expected 2 but received 1 (reportAssignmentType) -callables_protocol.py:260:8 - error: Expression of type "(*args: Any, kwarg0: Any) -> None" is incompatible with declared type "Proto12" -  Type "(*args: Any, kwarg0: Any) -> None" is incompatible with type "(*args: Any, kwarg0: Any, kwarg1: Any) -> None" +callables_protocol.py:260:8 - error: Type "(*args: Any, kwarg0: Any) -> None" is not assignable to declared type "Proto12" +  Type "(*args: Any, kwarg0: Any) -> None" is not assignable to type "(*args: Any, kwarg0: Any, kwarg1: Any) -> None"     Missing keyword parameter "kwarg1" (reportAssignmentType) -callables_protocol.py:284:27 - error: Expression of type "(path: str) -> str" is incompatible with declared type "Proto13_Default" -  Type "(path: str) -> str" is incompatible with type "(path: str = ...) -> str" +callables_protocol.py:284:27 - error: Type "(path: str) -> str" is not assignable to declared type "Proto13_Default" +  Type "(path: str) -> str" is not assignable to type "(path: str = ...) -> str"     Parameter "path" is missing default argument (reportAssignmentType) -callables_protocol.py:311:27 - error: Expression of type "(*, path: str) -> str" is incompatible with declared type "Proto14_Default" -  Type "(*, path: str) -> str" is incompatible with type "(*, path: str = ...) -> str" +callables_protocol.py:311:27 - error: Type "(*, path: str) -> str" is not assignable to declared type "Proto14_Default" +  Type "(*, path: str) -> str" is not assignable to type "(*, path: str = ...) -> str"     Parameter "path" is missing default argument (reportAssignmentType) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/callables_subtyping.toml b/conformance/results/pyright/callables_subtyping.toml index 932c0799b..134de40c9 100644 --- a/conformance/results/pyright/callables_subtyping.toml +++ b/conformance/results/pyright/callables_subtyping.toml @@ -2,199 +2,199 @@ conformant = "Pass" errors_diff = """ """ output = """ -callables_subtyping.py:26:36 - error: Expression of type "(int) -> int" is incompatible with declared type "(float) -> float" -  Type "(int) -> int" is incompatible with type "(float) -> float" +callables_subtyping.py:26:36 - error: Type "(int) -> int" is not assignable to declared type "(float) -> float" +  Type "(int) -> int" is not assignable to type "(float) -> float"     Parameter 1: type "float" is incompatible with type "int" -      "float" is incompatible with "int" (reportAssignmentType) -callables_subtyping.py:29:32 - error: Expression of type "(float) -> float" is incompatible with declared type "(int) -> int" -  Type "(float) -> float" is incompatible with type "(int) -> int" +      "float" is not assignable to "int" (reportAssignmentType) +callables_subtyping.py:29:32 - error: Type "(float) -> float" is not assignable to declared type "(int) -> int" +  Type "(float) -> float" is not assignable to type "(int) -> int"     Function return type "float" is incompatible with type "int" -      "float" is incompatible with "int" (reportAssignmentType) -callables_subtyping.py:51:21 - error: Expression of type "PosOnly2" is incompatible with declared type "Standard2" +      "float" is not assignable to "int" (reportAssignmentType) +callables_subtyping.py:51:21 - error: Type "PosOnly2" is not assignable to declared type "Standard2"   "PosOnly2" is incompatible with protocol "Standard2"     "__call__" is an incompatible type -      Type "(b: int, a: int, /) -> None" is incompatible with type "(a: int, b: int) -> None" +      Type "(b: int, a: int, /) -> None" is not assignable to type "(a: int, b: int) -> None"         Missing keyword parameter "a"         Missing keyword parameter "b"           Position-only parameter mismatch; parameter "a" is not position-only           Position-only parameter mismatch; parameter "b" is not position-only           Position-only parameter mismatch; expected 2 but received 0 (reportAssignmentType) -callables_subtyping.py:52:21 - error: Expression of type "KwOnly2" is incompatible with declared type "Standard2" +callables_subtyping.py:52:21 - error: Type "KwOnly2" is not assignable to declared type "Standard2"   "KwOnly2" is incompatible with protocol "Standard2"     "__call__" is an incompatible type -      Type "(*, b: int, a: int) -> None" is incompatible with type "(a: int, b: int) -> None" +      Type "(*, b: int, a: int) -> None" is not assignable to type "(a: int, b: int) -> None"         Function accepts too many positional parameters; expected 0 but received 2           Extra parameter "b"           Extra parameter "a" (reportAssignmentType) -callables_subtyping.py:55:20 - error: Expression of type "KwOnly2" is incompatible with declared type "PosOnly2" +callables_subtyping.py:55:20 - error: Type "KwOnly2" is not assignable to declared type "PosOnly2"   "KwOnly2" is incompatible with protocol "PosOnly2"     "__call__" is an incompatible type -      Type "(*, b: int, a: int) -> None" is incompatible with type "(b: int, a: int, /) -> None" +      Type "(*, b: int, a: int) -> None" is not assignable to type "(b: int, a: int, /) -> None"         Function accepts too many positional parameters; expected 0 but received 2           Extra parameter "b"           Extra parameter "a" (reportAssignmentType) -callables_subtyping.py:58:19 - error: Expression of type "PosOnly2" is incompatible with declared type "KwOnly2" +callables_subtyping.py:58:19 - error: Type "PosOnly2" is not assignable to declared type "KwOnly2"   "PosOnly2" is incompatible with protocol "KwOnly2"     "__call__" is an incompatible type -      Type "(b: int, a: int, /) -> None" is incompatible with type "(*, b: int, a: int) -> None" +      Type "(b: int, a: int, /) -> None" is not assignable to type "(*, b: int, a: int) -> None"         Position-only parameter mismatch; expected 2 but received 0         Function accepts too few positional parameters; expected 2 but received 0         Missing keyword parameter "b"         Missing keyword parameter "a" (reportAssignmentType) -callables_subtyping.py:82:20 - error: Expression of type "NoArgs3" is incompatible with declared type "IntArgs3" +callables_subtyping.py:82:20 - error: Type "NoArgs3" is not assignable to declared type "IntArgs3"   "NoArgs3" is incompatible with protocol "IntArgs3"     "__call__" is an incompatible type -      Type "() -> None" is incompatible with type "(*args: int) -> None" +      Type "() -> None" is not assignable to type "(*args: int) -> None"         Parameter "*args" has no corresponding parameter (reportAssignmentType) -callables_subtyping.py:85:22 - error: Expression of type "NoArgs3" is incompatible with declared type "FloatArgs3" +callables_subtyping.py:85:22 - error: Type "NoArgs3" is not assignable to declared type "FloatArgs3"   "NoArgs3" is incompatible with protocol "FloatArgs3"     "__call__" is an incompatible type -      Type "() -> None" is incompatible with type "(*args: float) -> None" +      Type "() -> None" is not assignable to type "(*args: float) -> None"         Parameter "*args" has no corresponding parameter (reportAssignmentType) -callables_subtyping.py:86:22 - error: Expression of type "IntArgs3" is incompatible with declared type "FloatArgs3" +callables_subtyping.py:86:22 - error: Type "IntArgs3" is not assignable to declared type "FloatArgs3"   "IntArgs3" is incompatible with protocol "FloatArgs3"     "__call__" is an incompatible type -      Type "(*args: int) -> None" is incompatible with type "(*args: float) -> None" +      Type "(*args: int) -> None" is not assignable to type "(*args: float) -> None"         Parameter 1: type "*tuple[float, ...]" is incompatible with type "*tuple[int, ...]" -          "*tuple[float, ...]" is incompatible with "*tuple[int, ...]" (reportAssignmentType) -callables_subtyping.py:116:20 - error: Expression of type "IntArgs4" is incompatible with declared type "PosOnly4" +          "*tuple[float, ...]" is not assignable to "*tuple[int, ...]" (reportAssignmentType) +callables_subtyping.py:116:20 - error: Type "IntArgs4" is not assignable to declared type "PosOnly4"   "IntArgs4" is incompatible with protocol "PosOnly4"     "__call__" is an incompatible type -      Type "(*args: int) -> None" is incompatible with type "(a: int, b: str, /) -> None" +      Type "(*args: int) -> None" is not assignable to type "(a: int, b: str, /) -> None"         Parameter 2: type "str" is incompatible with type "int" -          "str" is incompatible with "int" (reportAssignmentType) -callables_subtyping.py:119:23 - error: Expression of type "StrArgs4" is incompatible with declared type "IntStrArgs4" +          "str" is not assignable to "int" (reportAssignmentType) +callables_subtyping.py:119:23 - error: Type "StrArgs4" is not assignable to declared type "IntStrArgs4"   "StrArgs4" is incompatible with protocol "IntStrArgs4"     "__call__" is an incompatible type -      Type "(a: int, /, *args: str) -> None" is incompatible with type "(*args: int | str) -> None" +      Type "(a: int, /, *args: str) -> None" is not assignable to type "(*args: int | str) -> None"         Parameter 2: type "int | str" is incompatible with type "str" -          Type "int | str" is incompatible with type "str" +          Type "int | str" is not assignable to type "str"         Parameter 1: type "*tuple[int | str, ...]" is incompatible with type "*tuple[str, ...]" -          "*tuple[int | str, ...]" is incompatible with "*tuple[str, ...]" (reportAssignmentType) -callables_subtyping.py:120:23 - error: Expression of type "IntArgs4" is incompatible with declared type "IntStrArgs4" +          "*tuple[int | str, ...]" is not assignable to "*tuple[str, ...]" (reportAssignmentType) +callables_subtyping.py:120:23 - error: Type "IntArgs4" is not assignable to declared type "IntStrArgs4"   "IntArgs4" is incompatible with protocol "IntStrArgs4"     "__call__" is an incompatible type -      Type "(*args: int) -> None" is incompatible with type "(*args: int | str) -> None" +      Type "(*args: int) -> None" is not assignable to type "(*args: int | str) -> None"         Parameter 1: type "*tuple[int | str, ...]" is incompatible with type "*tuple[int, ...]" -          "*tuple[int | str, ...]" is incompatible with "*tuple[int, ...]" (reportAssignmentType) -callables_subtyping.py:122:20 - error: Expression of type "IntArgs4" is incompatible with declared type "StrArgs4" +          "*tuple[int | str, ...]" is not assignable to "*tuple[int, ...]" (reportAssignmentType) +callables_subtyping.py:122:20 - error: Type "IntArgs4" is not assignable to declared type "StrArgs4"   "IntArgs4" is incompatible with protocol "StrArgs4"     "__call__" is an incompatible type -      Type "(*args: int) -> None" is incompatible with type "(a: int, /, *args: str) -> None" +      Type "(*args: int) -> None" is not assignable to type "(a: int, /, *args: str) -> None"         Parameter 2: type "str" is incompatible with type "int" -          "str" is incompatible with "int" +          "str" is not assignable to "int"         Parameter 3: type "*tuple[str, ...]" is incompatible with type "*tuple[int, ...]" -          "*tuple[str, ...]" is incompatible with "*tuple[int, ...]" (reportAssignmentType) -callables_subtyping.py:124:20 - error: Expression of type "StrArgs4" is incompatible with declared type "IntArgs4" +          "*tuple[str, ...]" is not assignable to "*tuple[int, ...]" (reportAssignmentType) +callables_subtyping.py:124:20 - error: Type "StrArgs4" is not assignable to declared type "IntArgs4"   "StrArgs4" is incompatible with protocol "IntArgs4"     "__call__" is an incompatible type -      Type "(a: int, /, *args: str) -> None" is incompatible with type "(*args: int) -> None" +      Type "(a: int, /, *args: str) -> None" is not assignable to type "(*args: int) -> None"         Parameter 2: type "int" is incompatible with type "str" -          "int" is incompatible with "str" +          "int" is not assignable to "str"         Parameter 1: type "*tuple[int, ...]" is incompatible with type "*tuple[str, ...]" -          "*tuple[int, ...]" is incompatible with "*tuple[str, ...]" (reportAssignmentType) -callables_subtyping.py:125:22 - error: Expression of type "IntStrArgs4" is incompatible with declared type "Standard4" +          "*tuple[int, ...]" is not assignable to "*tuple[str, ...]" (reportAssignmentType) +callables_subtyping.py:125:22 - error: Type "IntStrArgs4" is not assignable to declared type "Standard4"   "IntStrArgs4" is incompatible with protocol "Standard4"     "__call__" is an incompatible type -      Type "(*args: int | str) -> None" is incompatible with type "(a: int, b: str) -> None" +      Type "(*args: int | str) -> None" is not assignable to type "(a: int, b: str) -> None"         Missing keyword parameter "a"         Missing keyword parameter "b" (reportAssignmentType) -callables_subtyping.py:126:22 - error: Expression of type "StrArgs4" is incompatible with declared type "Standard4" +callables_subtyping.py:126:22 - error: Type "StrArgs4" is not assignable to declared type "Standard4"   "StrArgs4" is incompatible with protocol "Standard4"     "__call__" is an incompatible type -      Type "(a: int, /, *args: str) -> None" is incompatible with type "(a: int, b: str) -> None" +      Type "(a: int, /, *args: str) -> None" is not assignable to type "(a: int, b: str) -> None"         Missing keyword parameter "a"         Missing keyword parameter "b"           Position-only parameter mismatch; parameter "a" is not position-only           Position-only parameter mismatch; expected 1 but received 0 (reportAssignmentType) -callables_subtyping.py:151:22 - error: Expression of type "NoKwargs5" is incompatible with declared type "IntKwargs5" +callables_subtyping.py:151:22 - error: Type "NoKwargs5" is not assignable to declared type "IntKwargs5"   "NoKwargs5" is incompatible with protocol "IntKwargs5"     "__call__" is an incompatible type -      Type "() -> None" is incompatible with type "(**kwargs: int) -> None" +      Type "() -> None" is not assignable to type "(**kwargs: int) -> None"         Parameter "**kwargs" has no corresponding parameter (reportAssignmentType) -callables_subtyping.py:154:24 - error: Expression of type "NoKwargs5" is incompatible with declared type "FloatKwargs5" +callables_subtyping.py:154:24 - error: Type "NoKwargs5" is not assignable to declared type "FloatKwargs5"   "NoKwargs5" is incompatible with protocol "FloatKwargs5"     "__call__" is an incompatible type -      Type "() -> None" is incompatible with type "(**kwargs: float) -> None" +      Type "() -> None" is not assignable to type "(**kwargs: float) -> None"         Parameter "**kwargs" has no corresponding parameter (reportAssignmentType) -callables_subtyping.py:155:24 - error: Expression of type "IntKwargs5" is incompatible with declared type "FloatKwargs5" +callables_subtyping.py:155:24 - error: Type "IntKwargs5" is not assignable to declared type "FloatKwargs5"   "IntKwargs5" is incompatible with protocol "FloatKwargs5"     "__call__" is an incompatible type -      Type "(**kwargs: int) -> None" is incompatible with type "(**kwargs: float) -> None" +      Type "(**kwargs: int) -> None" is not assignable to type "(**kwargs: float) -> None"         Parameter 1: type "float" is incompatible with type "int" -          "float" is incompatible with "int" (reportAssignmentType) -callables_subtyping.py:187:19 - error: Expression of type "IntKwargs6" is incompatible with declared type "KwOnly6" +          "float" is not assignable to "int" (reportAssignmentType) +callables_subtyping.py:187:19 - error: Type "IntKwargs6" is not assignable to declared type "KwOnly6"   "IntKwargs6" is incompatible with protocol "KwOnly6"     "__call__" is an incompatible type -      Type "(**kwargs: int) -> None" is incompatible with type "(*, a: int, b: str) -> None" +      Type "(**kwargs: int) -> None" is not assignable to type "(*, a: int, b: str) -> None"         Parameter 3: type "str" is incompatible with type "int" -          "str" is incompatible with "int" (reportAssignmentType) -callables_subtyping.py:190:25 - error: Expression of type "StrKwargs6" is incompatible with declared type "IntStrKwargs6" +          "str" is not assignable to "int" (reportAssignmentType) +callables_subtyping.py:190:25 - error: Type "StrKwargs6" is not assignable to declared type "IntStrKwargs6"   "StrKwargs6" is incompatible with protocol "IntStrKwargs6"     "__call__" is an incompatible type -      Type "(*, a: int, **kwargs: str) -> None" is incompatible with type "(**kwargs: int | str) -> None" +      Type "(*, a: int, **kwargs: str) -> None" is not assignable to type "(**kwargs: int | str) -> None"         Parameter 1: type "int | str" is incompatible with type "int" -          Type "int | str" is incompatible with type "int" +          Type "int | str" is not assignable to type "int"         Parameter 1: type "int | str" is incompatible with type "str" -          Type "int | str" is incompatible with type "str" (reportAssignmentType) -callables_subtyping.py:191:25 - error: Expression of type "IntKwargs6" is incompatible with declared type "IntStrKwargs6" +          Type "int | str" is not assignable to type "str" (reportAssignmentType) +callables_subtyping.py:191:25 - error: Type "IntKwargs6" is not assignable to declared type "IntStrKwargs6"   "IntKwargs6" is incompatible with protocol "IntStrKwargs6"     "__call__" is an incompatible type -      Type "(**kwargs: int) -> None" is incompatible with type "(**kwargs: int | str) -> None" +      Type "(**kwargs: int) -> None" is not assignable to type "(**kwargs: int | str) -> None"         Parameter 1: type "int | str" is incompatible with type "int" -          Type "int | str" is incompatible with type "int" (reportAssignmentType) -callables_subtyping.py:193:22 - error: Expression of type "IntKwargs6" is incompatible with declared type "StrKwargs6" +          Type "int | str" is not assignable to type "int" (reportAssignmentType) +callables_subtyping.py:193:22 - error: Type "IntKwargs6" is not assignable to declared type "StrKwargs6"   "IntKwargs6" is incompatible with protocol "StrKwargs6"     "__call__" is an incompatible type -      Type "(**kwargs: int) -> None" is incompatible with type "(*, a: int, **kwargs: str) -> None" +      Type "(**kwargs: int) -> None" is not assignable to type "(*, a: int, **kwargs: str) -> None"         Parameter 3: type "str" is incompatible with type "int" -          "str" is incompatible with "int" (reportAssignmentType) -callables_subtyping.py:195:22 - error: Expression of type "StrKwargs6" is incompatible with declared type "IntKwargs6" +          "str" is not assignable to "int" (reportAssignmentType) +callables_subtyping.py:195:22 - error: Type "StrKwargs6" is not assignable to declared type "IntKwargs6"   "StrKwargs6" is incompatible with protocol "IntKwargs6"     "__call__" is an incompatible type -      Type "(*, a: int, **kwargs: str) -> None" is incompatible with type "(**kwargs: int) -> None" +      Type "(*, a: int, **kwargs: str) -> None" is not assignable to type "(**kwargs: int) -> None"         Parameter 1: type "int" is incompatible with type "str" -          "int" is incompatible with "str" (reportAssignmentType) -callables_subtyping.py:196:22 - error: Expression of type "IntStrKwargs6" is incompatible with declared type "Standard6" +          "int" is not assignable to "str" (reportAssignmentType) +callables_subtyping.py:196:22 - error: Type "IntStrKwargs6" is not assignable to declared type "Standard6"   "IntStrKwargs6" is incompatible with protocol "Standard6"     "__call__" is an incompatible type -      Type "(**kwargs: int | str) -> None" is incompatible with type "(a: int, b: str) -> None" +      Type "(**kwargs: int | str) -> None" is not assignable to type "(a: int, b: str) -> None"         Function accepts too many positional parameters; expected 0 but received 2 (reportAssignmentType) -callables_subtyping.py:197:22 - error: Expression of type "StrKwargs6" is incompatible with declared type "Standard6" +callables_subtyping.py:197:22 - error: Type "StrKwargs6" is not assignable to declared type "Standard6"   "StrKwargs6" is incompatible with protocol "Standard6"     "__call__" is an incompatible type -      Type "(*, a: int, **kwargs: str) -> None" is incompatible with type "(a: int, b: str) -> None" +      Type "(*, a: int, **kwargs: str) -> None" is not assignable to type "(a: int, b: str) -> None"         Function accepts too many positional parameters; expected 0 but received 2           Extra parameter "a" (reportAssignmentType) -callables_subtyping.py:236:23 - error: Expression of type "NoDefaultArg8" is incompatible with declared type "DefaultArg8" +callables_subtyping.py:236:23 - error: Type "NoDefaultArg8" is not assignable to declared type "DefaultArg8"   "NoDefaultArg8" is incompatible with protocol "DefaultArg8"     "__call__" is an incompatible type -      Type "(x: int) -> None" is incompatible with type "(x: int = 0) -> None" +      Type "(x: int) -> None" is not assignable to type "(x: int = 0) -> None"         Parameter "x" is missing default argument (reportAssignmentType) -callables_subtyping.py:237:23 - error: Expression of type "NoX8" is incompatible with declared type "DefaultArg8" +callables_subtyping.py:237:23 - error: Type "NoX8" is not assignable to declared type "DefaultArg8"   "NoX8" is incompatible with protocol "DefaultArg8"     "__call__" is an incompatible type -      Type "() -> None" is incompatible with type "(x: int = 0) -> None" +      Type "() -> None" is not assignable to type "(x: int = 0) -> None"         Function accepts too many positional parameters; expected 0 but received 1 (reportAssignmentType) -callables_subtyping.py:240:25 - error: Expression of type "NoX8" is incompatible with declared type "NoDefaultArg8" +callables_subtyping.py:240:25 - error: Type "NoX8" is not assignable to declared type "NoDefaultArg8"   "NoX8" is incompatible with protocol "NoDefaultArg8"     "__call__" is an incompatible type -      Type "() -> None" is incompatible with type "(x: int) -> None" +      Type "() -> None" is not assignable to type "(x: int) -> None"         Function accepts too many positional parameters; expected 0 but received 1 (reportAssignmentType) -callables_subtyping.py:243:16 - error: Expression of type "NoDefaultArg8" is incompatible with declared type "NoX8" +callables_subtyping.py:243:16 - error: Type "NoDefaultArg8" is not assignable to declared type "NoX8"   "NoDefaultArg8" is incompatible with protocol "NoX8"     "__call__" is an incompatible type -      Type "(x: int) -> None" is incompatible with type "() -> None" +      Type "(x: int) -> None" is not assignable to type "() -> None"         Extra parameter "x" (reportAssignmentType) -callables_subtyping.py:273:21 - error: Expression of type "Overloaded9" is incompatible with declared type "FloatArg9" +callables_subtyping.py:273:21 - error: Type "Overloaded9" is not assignable to declared type "FloatArg9"   "Overloaded9" is incompatible with protocol "FloatArg9"     "__call__" is an incompatible type       No overloaded function matches type "(x: float) -> float" (reportAssignmentType) -callables_subtyping.py:297:24 - error: Expression of type "StrArg10" is incompatible with declared type "Overloaded10" +callables_subtyping.py:297:24 - error: Type "StrArg10" is not assignable to declared type "Overloaded10"   "StrArg10" is incompatible with protocol "Overloaded10"     "__call__" is an incompatible type       One or more overloads of "__call__" is not assignable -        Type "(x: str) -> complex" is incompatible with type "(x: int, y: str) -> float" +        Type "(x: str) -> complex" is not assignable to type "(x: int, y: str) -> float"           Function accepts too many positional parameters; expected 1 but received 2 (reportAssignmentType) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/classes_classvar.toml b/conformance/results/pyright/classes_classvar.toml index f18dfc60e..42c7a249c 100644 --- a/conformance/results/pyright/classes_classvar.toml +++ b/conformance/results/pyright/classes_classvar.toml @@ -6,7 +6,7 @@ classes_classvar.py:40:14 - error: "var" is not defined (reportUndefinedVariable classes_classvar.py:45:20 - error: "ClassVar" type cannot include type variables (reportGeneralTypeIssues) classes_classvar.py:46:20 - error: "ClassVar" type cannot include type variables (reportGeneralTypeIssues) classes_classvar.py:47:20 - error: "ClassVar" type cannot include type variables (reportGeneralTypeIssues) -classes_classvar.py:52:33 - error: Expression of type "dict[Any, Any]" is incompatible with declared type "list[str]" (reportAssignmentType) +classes_classvar.py:52:33 - error: Type "dict[Any, Any]" is not assignable to declared type "list[str]" (reportAssignmentType) classes_classvar.py:54:17 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) classes_classvar.py:55:17 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) classes_classvar.py:63:26 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) @@ -16,9 +16,8 @@ classes_classvar.py:67:26 - error: "ClassVar" is not allowed in this context (re classes_classvar.py:71:8 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) classes_classvar.py:72:20 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) classes_classvar.py:105:14 - error: Cannot assign to attribute "stats" for class "Starship" -  Attribute "stats" cannot be assigned through a class instance because it is a ClassVar -    Attribute "__set__" is unknown (reportAttributeAccessIssue) -classes_classvar.py:134:13 - error: Expression of type "ProtoAImpl" is incompatible with declared type "ProtoA" +  Attribute "stats" cannot be assigned through a class instance because it is a ClassVar (reportAttributeAccessIssue) +classes_classvar.py:134:13 - error: Type "ProtoAImpl" is not assignable to declared type "ProtoA"   "ProtoAImpl" is incompatible with protocol "ProtoA"     "x" is defined as a ClassVar in protocol     "y" is defined as a ClassVar in protocol (reportAssignmentType) diff --git a/conformance/results/pyright/constructors_call_init.toml b/conformance/results/pyright/constructors_call_init.toml index dc74b3f90..4d6672588 100644 --- a/conformance/results/pyright/constructors_call_init.toml +++ b/conformance/results/pyright/constructors_call_init.toml @@ -4,14 +4,14 @@ errors_diff = """ """ output = """ constructors_call_init.py:21:13 - error: Argument of type "float" cannot be assigned to parameter "x" of type "int" in function "__init__" -  "float" is incompatible with "int" (reportArgumentType) +  "float" is not assignable to "int" (reportArgumentType) constructors_call_init.py:42:8 - error: Argument of type "Class2[Unknown]" cannot be assigned to parameter "x" of type "Class3 | None" in function "__init__" -  Type "Class2[Unknown]" is incompatible with type "Class3 | None" -    "Class2[Unknown]" is incompatible with "Class3" -    "Class2[Unknown]" is incompatible with "None" (reportArgumentType) +  Type "Class2[Unknown]" is not assignable to type "Class3 | None" +    "Class2[Unknown]" is not assignable to "Class3" +    "Class2[Unknown]" is not assignable to "None" (reportArgumentType) constructors_call_init.py:56:1 - error:   Could not bind method "__init__" because "Class4[str]" is not assignable to parameter "self" -    "Class4[str]" is incompatible with "Class4[int]" +    "Class4[str]" is not assignable to "Class4[int]"       Type parameter "T@Class4" is invariant, but "str" is not the same as "int" (reportGeneralTypeIssues) constructors_call_init.py:107:24 - warning: Type annotation for "self" parameter of "__init__" method cannot contain class-scoped type variables (reportInvalidTypeVarUse) constructors_call_init.py:130:9 - error: Expected 0 positional arguments (reportCallIssue) diff --git a/conformance/results/pyright/constructors_call_new.toml b/conformance/results/pyright/constructors_call_new.toml index 5880ad7fc..1585d37d1 100644 --- a/conformance/results/pyright/constructors_call_new.toml +++ b/conformance/results/pyright/constructors_call_new.toml @@ -3,11 +3,11 @@ errors_diff = """ """ output = """ constructors_call_new.py:21:13 - error: Argument of type "float" cannot be assigned to parameter "x" of type "int" in function "__new__" -  "float" is incompatible with "int" (reportArgumentType) +  "float" is not assignable to "int" (reportArgumentType) constructors_call_new.py:145:1 - error:   Could not bind method "__new__" because "type[Class11[str]]" is not assignable to parameter "cls" -    "type[Class11[str]]" is incompatible with "type[Class11[int]]" -    Type "type[Class11[str]]" is incompatible with type "type[Class11[int]]" +    "type[Class11[str]]" is not assignable to "type[Class11[int]]" +    Type "type[Class11[str]]" is not assignable to type "type[Class11[int]]"       Type parameter "T@Class11" is invariant, but "str" is not the same as "int" (reportGeneralTypeIssues) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/constructors_call_type.toml b/conformance/results/pyright/constructors_call_type.toml index 70f197b88..2e33755c3 100644 --- a/conformance/results/pyright/constructors_call_type.toml +++ b/conformance/results/pyright/constructors_call_type.toml @@ -1,15 +1,18 @@ -conformant = "Pass" +conformant = "Partial" +notes = """ +Fails to report error when passing incorrect arguments for metaclass __call__ method. +""" errors_diff = """ +Line 30: Expected 1 errors +Line 72: Expected 1 errors """ output = """ -constructors_call_type.py:30:5 - error: Arguments missing for parameters "x", "y" (reportCallIssue) constructors_call_type.py:40:5 - error: Arguments missing for parameters "x", "y" (reportCallIssue) constructors_call_type.py:50:5 - error: Arguments missing for parameters "x", "y" (reportCallIssue) constructors_call_type.py:59:9 - error: Expected 0 positional arguments (reportCallIssue) constructors_call_type.py:64:9 - error: Expected 0 positional arguments (reportCallIssue) -constructors_call_type.py:72:5 - error: Arguments missing for parameters "x", "y" (reportCallIssue) constructors_call_type.py:81:5 - error: Argument missing for parameter "y" (reportCallIssue) constructors_call_type.py:82:12 - error: Argument of type "Literal[2]" cannot be assigned to parameter "y" of type "str" in function "__new__" -  "Literal[2]" is incompatible with "str" (reportArgumentType) +  "Literal[2]" is not assignable to "str" (reportArgumentType) """ -conformance_automated = "Pass" +conformance_automated = "Fail" diff --git a/conformance/results/pyright/constructors_callable.toml b/conformance/results/pyright/constructors_callable.toml index 6c0039665..708e4555b 100644 --- a/conformance/results/pyright/constructors_callable.toml +++ b/conformance/results/pyright/constructors_callable.toml @@ -26,8 +26,8 @@ constructors_callable.py:144:8 - error: Expected 0 positional arguments (reportC constructors_callable.py:162:5 - information: Type of "r7" is "Overload[(x: int) -> Class7[int], (x: str) -> Class7[str]]" constructors_callable.py:182:13 - information: Type of "r8" is "(x: list[T@Class8], y: list[T@Class8]) -> Class8[T@Class8]" constructors_callable.py:184:10 - error: Argument of type "list[str]" cannot be assigned to parameter "y" of type "list[T@Class8]" -  "Literal['']" is incompatible with "int" (reportArgumentType) +  "Literal['']" is not assignable to "int" (reportArgumentType) constructors_callable.py:193:13 - information: Type of "r9" is "(x: list[T@__init__], y: list[T@__init__]) -> Class9" constructors_callable.py:195:10 - error: Argument of type "list[str]" cannot be assigned to parameter "y" of type "list[T@__init__]" -  "Literal['']" is incompatible with "int" (reportArgumentType) +  "Literal['']" is not assignable to "int" (reportArgumentType) """ diff --git a/conformance/results/pyright/dataclasses_final.toml b/conformance/results/pyright/dataclasses_final.toml index a0ab43daa..9b85ad5ab 100644 --- a/conformance/results/pyright/dataclasses_final.toml +++ b/conformance/results/pyright/dataclasses_final.toml @@ -4,18 +4,13 @@ errors_diff = """ """ output = """ dataclasses_final.py:27:3 - error: Cannot assign to attribute "final_classvar" for class "type[D]" -  "final_classvar" is declared as Final and cannot be reassigned -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  "final_classvar" is declared as Final and cannot be reassigned (reportAttributeAccessIssue) dataclasses_final.py:35:3 - error: Cannot assign to attribute "final_no_default" for class "D" -  "final_no_default" is declared as Final and cannot be reassigned -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  "final_no_default" is declared as Final and cannot be reassigned (reportAttributeAccessIssue) dataclasses_final.py:36:3 - error: Cannot assign to attribute "final_with_default" for class "D" -  "final_with_default" is declared as Final and cannot be reassigned -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  "final_with_default" is declared as Final and cannot be reassigned (reportAttributeAccessIssue) dataclasses_final.py:37:3 - error: Cannot assign to attribute "final_no_default" for class "type[D]" -  "final_no_default" is declared as Final and cannot be reassigned -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  "final_no_default" is declared as Final and cannot be reassigned (reportAttributeAccessIssue) dataclasses_final.py:38:3 - error: Cannot assign to attribute "final_with_default" for class "type[D]" -  "final_with_default" is declared as Final and cannot be reassigned -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  "final_with_default" is declared as Final and cannot be reassigned (reportAttributeAccessIssue) """ diff --git a/conformance/results/pyright/dataclasses_frozen.toml b/conformance/results/pyright/dataclasses_frozen.toml index 4175c762d..87a046e23 100644 --- a/conformance/results/pyright/dataclasses_frozen.toml +++ b/conformance/results/pyright/dataclasses_frozen.toml @@ -1,11 +1,9 @@ conformant = "Pass" output = """ dataclasses_frozen.py:16:5 - error: Cannot assign to attribute "a" for class "DC1" -  "DC1" is frozen -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  Attribute "a" is read-only (reportAttributeAccessIssue) dataclasses_frozen.py:17:5 - error: Cannot assign to attribute "b" for class "DC1" -  "DC1" is frozen -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  Attribute "b" is read-only (reportAttributeAccessIssue) dataclasses_frozen.py:22:1 - error: A non-frozen class cannot inherit from a class that is frozen (reportGeneralTypeIssues) dataclasses_frozen.py:32:12 - error: A frozen class cannot inherit from a class that is not frozen (reportGeneralTypeIssues) """ diff --git a/conformance/results/pyright/dataclasses_hash.toml b/conformance/results/pyright/dataclasses_hash.toml index 748f32bdb..bd6c15f84 100644 --- a/conformance/results/pyright/dataclasses_hash.toml +++ b/conformance/results/pyright/dataclasses_hash.toml @@ -1,13 +1,13 @@ conformant = "Pass" output = """ -dataclasses_hash.py:15:16 - error: Expression of type "DC1" is incompatible with declared type "Hashable" +dataclasses_hash.py:15:16 - error: Type "DC1" is not assignable to declared type "Hashable"   "DC1" is incompatible with protocol "Hashable"     "__hash__" is an incompatible type -      Type "None" is incompatible with type "() -> int" (reportAssignmentType) -dataclasses_hash.py:32:16 - error: Expression of type "DC3" is incompatible with declared type "Hashable" +      Type "None" is not assignable to type "() -> int" (reportAssignmentType) +dataclasses_hash.py:32:16 - error: Type "DC3" is not assignable to declared type "Hashable"   "DC3" is incompatible with protocol "Hashable"     "__hash__" is an incompatible type -      Type "None" is incompatible with type "() -> int" (reportAssignmentType) +      Type "None" is not assignable to type "() -> int" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/dataclasses_postinit.toml b/conformance/results/pyright/dataclasses_postinit.toml index 029868bc5..9ba5550ab 100644 --- a/conformance/results/pyright/dataclasses_postinit.toml +++ b/conformance/results/pyright/dataclasses_postinit.toml @@ -1,7 +1,7 @@ conformant = "Pass" output = """ dataclasses_postinit.py:19:40 - error: Dataclass __post_init__ method parameter type mismatch for field "y" -  "str" is incompatible with "int" (reportGeneralTypeIssues) +  "str" is not assignable to "int" (reportGeneralTypeIssues) dataclasses_postinit.py:28:11 - error: Cannot access attribute "x" for class "DC1"   "x" is an init-only field (reportAttributeAccessIssue) dataclasses_postinit.py:29:11 - error: Cannot access attribute "y" for class "DC1" diff --git a/conformance/results/pyright/dataclasses_transform_class.toml b/conformance/results/pyright/dataclasses_transform_class.toml index b7bf3083f..25b8ccc83 100644 --- a/conformance/results/pyright/dataclasses_transform_class.toml +++ b/conformance/results/pyright/dataclasses_transform_class.toml @@ -2,14 +2,12 @@ conformant = "Pass" output = """ dataclasses_transform_class.py:51:7 - error: A non-frozen class cannot inherit from a class that is frozen (reportGeneralTypeIssues) dataclasses_transform_class.py:63:6 - error: Cannot assign to attribute "id" for class "Customer1" -  "Customer1" is frozen -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  Attribute "id" is read-only (reportAttributeAccessIssue) dataclasses_transform_class.py:66:18 - error: Expected 0 positional arguments (reportCallIssue) dataclasses_transform_class.py:72:6 - error: Operator "<" not supported for types "Customer1" and "Customer1" (reportOperatorIssue) dataclasses_transform_class.py:82:18 - error: Expected 0 positional arguments (reportCallIssue) dataclasses_transform_class.py:122:6 - error: Cannot assign to attribute "id" for class "Customer3" -  "Customer3" is frozen -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  Attribute "id" is read-only (reportAttributeAccessIssue) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/dataclasses_transform_converter.toml b/conformance/results/pyright/dataclasses_transform_converter.toml index ec34af35b..479f0d759 100644 --- a/conformance/results/pyright/dataclasses_transform_converter.toml +++ b/conformance/results/pyright/dataclasses_transform_converter.toml @@ -4,41 +4,41 @@ errors_diff = """ """ output = """ dataclasses_transform_converter.py:48:31 - error: Argument of type "() -> int" is not a valid converter for field "field1" of type "int" -  Type "() -> int" is incompatible with type "(__converterInput) -> int" +  Type "() -> int" is not assignable to type "(__converterInput) -> int"     Function accepts too many positional parameters; expected 0 but received 1 (reportGeneralTypeIssues) dataclasses_transform_converter.py:48:41 - error: Argument of type "() -> int" cannot be assigned to parameter "converter" of type "(S@model_field) -> T@model_field" in function "model_field" -  Type "() -> int" is incompatible with type "(S@model_field) -> int" +  Type "() -> int" is not assignable to type "(S@model_field) -> int"     Function accepts too many positional parameters; expected 0 but received 1 (reportArgumentType) dataclasses_transform_converter.py:49:31 - error: Argument of type "(*, x: int) -> int" is not a valid converter for field "field2" of type "int" -  Type "(*, x: int) -> int" is incompatible with type "(__converterInput) -> int" +  Type "(*, x: int) -> int" is not assignable to type "(__converterInput) -> int"     Function accepts too many positional parameters; expected 0 but received 1       Extra parameter "x" (reportGeneralTypeIssues) dataclasses_transform_converter.py:49:41 - error: Argument of type "(*, x: int) -> int" cannot be assigned to parameter "converter" of type "(S@model_field) -> T@model_field" in function "model_field" -  Type "(*, x: int) -> int" is incompatible with type "(S@model_field) -> int" +  Type "(*, x: int) -> int" is not assignable to type "(S@model_field) -> int"     Function accepts too many positional parameters; expected 0 but received 1       Extra parameter "x" (reportArgumentType) dataclasses_transform_converter.py:107:5 - error: Argument of type "Literal[1]" cannot be assigned to parameter "field0" of type "str" in function "__init__" -  "Literal[1]" is incompatible with "str" (reportArgumentType) +  "Literal[1]" is not assignable to "str" (reportArgumentType) dataclasses_transform_converter.py:108:23 - error: Argument of type "Literal[1]" cannot be assigned to parameter "field3" of type "str | bytes" in function "__init__" -  Type "Literal[1]" is incompatible with type "str | bytes" -    "Literal[1]" is incompatible with "str" -    "Literal[1]" is incompatible with "bytes" (reportArgumentType) +  Type "Literal[1]" is not assignable to type "str | bytes" +    "Literal[1]" is not assignable to "str" +    "Literal[1]" is not assignable to "bytes" (reportArgumentType) dataclasses_transform_converter.py:109:29 - error: Argument of type "complex" cannot be assigned to parameter "field4" of type "str | list[str]" in function "__init__" -  Type "complex" is incompatible with type "str | list[str]" -    "complex" is incompatible with "str" -    "complex" is incompatible with "list[str]" (reportArgumentType) +  Type "complex" is not assignable to type "str | list[str]" +    "complex" is not assignable to "str" +    "complex" is not assignable to "list[str]" (reportArgumentType) dataclasses_transform_converter.py:118:14 - error: Cannot assign to attribute "field0" for class "DC2" -  "Literal[1]" is incompatible with "str" (reportAttributeAccessIssue) +  "Literal[1]" is not assignable to "str" (reportAttributeAccessIssue) dataclasses_transform_converter.py:119:14 - error: Cannot assign to attribute "field3" for class "DC2" -  Type "Literal[1]" is incompatible with type "str | bytes" -    "Literal[1]" is incompatible with "str" -    "Literal[1]" is incompatible with "bytes" (reportAttributeAccessIssue) +  Type "Literal[1]" is not assignable to type "str | bytes" +    "Literal[1]" is not assignable to "str" +    "Literal[1]" is not assignable to "bytes" (reportAttributeAccessIssue) dataclasses_transform_converter.py:130:67 - error: Argument of type "Literal[1]" cannot be assigned to parameter "default" of type "S@model_field | None" in function "model_field" -  Type "Literal[1]" is incompatible with type "str | None" -    "Literal[1]" is incompatible with "str" -    "Literal[1]" is incompatible with "None" (reportArgumentType) +  Type "Literal[1]" is not assignable to type "str | None" +    "Literal[1]" is not assignable to "str" +    "Literal[1]" is not assignable to "None" (reportArgumentType) dataclasses_transform_converter.py:133:75 - error: Argument of type "type[int]" cannot be assigned to parameter "default_factory" of type "(() -> S@model_field) | None" in function "model_field" -  Type "type[int]" is incompatible with type "(() -> str) | None" +  Type "type[int]" is not assignable to type "(() -> str) | None"     No overloaded function matches type "() -> str" -    "type[type]" is incompatible with "type[None]" (reportArgumentType) +    "type[type]" is not assignable to "type[None]" (reportArgumentType) """ diff --git a/conformance/results/pyright/dataclasses_transform_func.toml b/conformance/results/pyright/dataclasses_transform_func.toml index 55a0df3e3..164f93379 100644 --- a/conformance/results/pyright/dataclasses_transform_func.toml +++ b/conformance/results/pyright/dataclasses_transform_func.toml @@ -1,14 +1,13 @@ conformant = "Pass" output = """ dataclasses_transform_func.py:57:13 - error: Cannot assign to attribute "name" for class "Customer1" -  "Literal[3]" is incompatible with "str" (reportAttributeAccessIssue) +  "Literal[3]" is not assignable to "str" (reportAttributeAccessIssue) dataclasses_transform_func.py:61:6 - error: Operator "<" not supported for types "Customer1" and "Customer1" (reportOperatorIssue) dataclasses_transform_func.py:65:36 - error: No parameter named "salary" (reportCallIssue) dataclasses_transform_func.py:71:18 - error: Expected 0 positional arguments (reportCallIssue) dataclasses_transform_func.py:89:1 - error: A non-frozen class cannot inherit from a class that is frozen (reportGeneralTypeIssues) dataclasses_transform_func.py:97:6 - error: Cannot assign to attribute "id" for class "Customer3" -  "Customer3" is frozen -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  Attribute "id" is read-only (reportAttributeAccessIssue) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/dataclasses_transform_meta.toml b/conformance/results/pyright/dataclasses_transform_meta.toml index d59747196..392f95a70 100644 --- a/conformance/results/pyright/dataclasses_transform_meta.toml +++ b/conformance/results/pyright/dataclasses_transform_meta.toml @@ -2,14 +2,12 @@ conformant = "Pass" output = """ dataclasses_transform_meta.py:51:36 - error: A non-frozen class cannot inherit from a class that is frozen (reportGeneralTypeIssues) dataclasses_transform_meta.py:63:6 - error: Cannot assign to attribute "id" for class "Customer1" -  "Customer1" is frozen -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  Attribute "id" is read-only (reportAttributeAccessIssue) dataclasses_transform_meta.py:66:18 - error: Expected 0 positional arguments (reportCallIssue) dataclasses_transform_meta.py:73:6 - error: Operator "<" not supported for types "Customer1" and "Customer1" (reportOperatorIssue) dataclasses_transform_meta.py:83:18 - error: Expected 0 positional arguments (reportCallIssue) dataclasses_transform_meta.py:103:6 - error: Cannot assign to attribute "id" for class "Customer3" -  "Customer3" is frozen -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  Attribute "id" is read-only (reportAttributeAccessIssue) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/dataclasses_usage.toml b/conformance/results/pyright/dataclasses_usage.toml index cb3906bf0..67ec33f28 100644 --- a/conformance/results/pyright/dataclasses_usage.toml +++ b/conformance/results/pyright/dataclasses_usage.toml @@ -2,14 +2,14 @@ conformant = "Pass" output = """ dataclasses_usage.py:50:6 - error: Argument missing for parameter "unit_price" (reportCallIssue) dataclasses_usage.py:51:28 - error: Argument of type "Literal['price']" cannot be assigned to parameter "unit_price" of type "float" in function "__init__" -  "Literal['price']" is incompatible with "float" (reportArgumentType) +  "Literal['price']" is not assignable to "float" (reportArgumentType) dataclasses_usage.py:52:36 - error: Expected 3 positional arguments (reportCallIssue) dataclasses_usage.py:61:5 - error: Fields without default values cannot appear after fields with default values (reportGeneralTypeIssues) dataclasses_usage.py:67:5 - error: Fields without default values cannot appear after fields with default values (reportGeneralTypeIssues) dataclasses_usage.py:73:5 - error: Fields without default values cannot appear after fields with default values (reportGeneralTypeIssues) dataclasses_usage.py:83:13 - error: Expected 1 positional argument (reportCallIssue) -dataclasses_usage.py:88:14 - error: Expression of type "str" is incompatible with declared type "int" -  "str" is incompatible with "int" (reportAssignmentType) +dataclasses_usage.py:88:14 - error: Type "str" is not assignable to declared type "int" +  "str" is not assignable to "int" (reportAssignmentType) dataclasses_usage.py:127:8 - error: Expected 1 positional argument (reportCallIssue) dataclasses_usage.py:130:1 - error: Argument missing for parameter "y" (reportCallIssue) dataclasses_usage.py:179:6 - error: Expected 0 positional arguments (reportCallIssue) diff --git a/conformance/results/pyright/directives_no_type_check.toml b/conformance/results/pyright/directives_no_type_check.toml index 9f73f7153..858c581eb 100644 --- a/conformance/results/pyright/directives_no_type_check.toml +++ b/conformance/results/pyright/directives_no_type_check.toml @@ -3,8 +3,8 @@ notes = """ Does not honor `@no_type_check` class decorator (allowed). """ output = """ -directives_no_type_check.py:15:14 - error: Expression of type "Literal['']" is incompatible with declared type "int" -  "Literal['']" is incompatible with "int" (reportAssignmentType) +directives_no_type_check.py:15:14 - error: Type "Literal['']" is not assignable to declared type "int" +  "Literal['']" is not assignable to "int" (reportAssignmentType) directives_no_type_check.py:32:1 - error: Arguments missing for parameters "a", "b" (reportCallIssue) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/directives_type_ignore_file2.toml b/conformance/results/pyright/directives_type_ignore_file2.toml index 21a0a593b..667eeb77b 100644 --- a/conformance/results/pyright/directives_type_ignore_file2.toml +++ b/conformance/results/pyright/directives_type_ignore_file2.toml @@ -1,7 +1,7 @@ conformant = "Pass" output = """ -directives_type_ignore_file2.py:14:10 - error: Expression of type "Literal['']" is incompatible with declared type "int" -  "Literal['']" is incompatible with "int" (reportAssignmentType) +directives_type_ignore_file2.py:14:10 - error: Type "Literal['']" is not assignable to declared type "int" +  "Literal['']" is not assignable to "int" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/enums_member_values.toml b/conformance/results/pyright/enums_member_values.toml index 566fcd4f5..2efe3d766 100644 --- a/conformance/results/pyright/enums_member_values.toml +++ b/conformance/results/pyright/enums_member_values.toml @@ -7,8 +7,8 @@ enums_member_values.py:50:12 - error: Argument missing for parameter "radius" (r enums_member_values.py:51:15 - error: Arguments missing for parameters "mass", "radius" (reportCallIssue) enums_member_values.py:54:13 - error: "assert_type" mismatch: expected "Literal[1]" but received "Any" (reportAssertTypeFailure) enums_member_values.py:68:13 - error: "assert_type" mismatch: expected "Literal[1]" but received "int" (reportAssertTypeFailure) -enums_member_values.py:78:13 - error: Expression of type "Literal['green']" is incompatible with declared type "int" -  "Literal['green']" is incompatible with "int" (reportAssignmentType) +enums_member_values.py:78:13 - error: Type "Literal['green']" is not assignable to declared type "int" +  "Literal['green']" is not assignable to "int" (reportAssignmentType) enums_member_values.py:85:24 - error: Cannot assign to attribute "_value_" for class "Planet2*" -  "int" is incompatible with "str" (reportAttributeAccessIssue) +  "int" is not assignable to "str" (reportAttributeAccessIssue) """ diff --git a/conformance/results/pyright/generics_base_class.toml b/conformance/results/pyright/generics_base_class.toml index a008e5e3f..fa4abde3d 100644 --- a/conformance/results/pyright/generics_base_class.toml +++ b/conformance/results/pyright/generics_base_class.toml @@ -1,7 +1,7 @@ conformant = "Pass" output = """ generics_base_class.py:26:26 - error: Argument of type "SymbolTable" cannot be assigned to parameter "x" of type "dict[str, list[object]]" in function "takes_dict_incorrect" -  "SymbolTable" is incompatible with "dict[str, list[object]]" +  "SymbolTable" is not assignable to "dict[str, list[object]]"     Type parameter "_VT@dict" is invariant, but "list[Node]" is not the same as "list[object]"     Consider switching from "dict" to "Mapping" which is covariant in the value type (reportArgumentType) generics_base_class.py:29:14 - error: "Generic" is not valid in this context (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/generics_basic.toml b/conformance/results/pyright/generics_basic.toml index b57456ed3..290ffe414 100644 --- a/conformance/results/pyright/generics_basic.toml +++ b/conformance/results/pyright/generics_basic.toml @@ -1,18 +1,18 @@ conformant = "Pass" output = """ generics_basic.py:40:15 - error: Argument of type "bytes" cannot be assigned to parameter "y" of type "AnyStr@concat" in function "concat" -  "bytes" is incompatible with "str" (reportArgumentType) +  "bytes" is not assignable to "str" (reportArgumentType) generics_basic.py:41:15 - error: Argument of type "str" cannot be assigned to parameter "y" of type "AnyStr@concat" in function "concat" -  "str" is incompatible with "bytes" (reportArgumentType) +  "str" is not assignable to "bytes" (reportArgumentType) generics_basic.py:49:44 - error: TypeVar must have at least two constrained types (reportGeneralTypeIssues) generics_basic.py:55:53 - error: TypeVar constraint type cannot be generic (reportGeneralTypeIssues) generics_basic.py:69:15 - error: Argument of type "bytes" cannot be assigned to parameter "y" of type "AnyStr@concat" in function "concat" -  "bytes" is incompatible with "str" (reportArgumentType) +  "bytes" is not assignable to "str" (reportArgumentType) generics_basic.py:121:24 - error: Type arguments for "Generic" must be unique (reportInvalidTypeForm) generics_basic.py:157:5 - error: Argument of type "Literal[0]" cannot be assigned to parameter "key" of type "str" in function "__getitem__" -  "Literal[0]" is incompatible with "str" (reportArgumentType) +  "Literal[0]" is not assignable to "str" (reportArgumentType) generics_basic.py:158:5 - error: Argument of type "Literal[0]" cannot be assigned to parameter "key" of type "str" in function "__getitem__" -  "Literal[0]" is incompatible with "str" (reportArgumentType) +  "Literal[0]" is not assignable to "str" (reportArgumentType) generics_basic.py:191:37 - error: Metaclass cannot be generic (reportGeneralTypeIssues) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/generics_defaults_referential.toml b/conformance/results/pyright/generics_defaults_referential.toml index ff318bc3e..229c13d30 100644 --- a/conformance/results/pyright/generics_defaults_referential.toml +++ b/conformance/results/pyright/generics_defaults_referential.toml @@ -1,9 +1,9 @@ conformant = "Pass" output = """ generics_defaults_referential.py:36:13 - error: Argument of type "Literal['']" cannot be assigned to parameter "b" of type "int" in function "__init__" -  "Literal['']" is incompatible with "int" (reportArgumentType) +  "Literal['']" is not assignable to "int" (reportArgumentType) generics_defaults_referential.py:37:10 - error: Argument of type "Literal['']" cannot be assigned to parameter "a" of type "int" in function "__init__" -  "Literal['']" is incompatible with "int" (reportArgumentType) +  "Literal['']" is not assignable to "int" (reportArgumentType) generics_defaults_referential.py:53:7 - error: Type parameter "Start2T" has a default type that refers to one or more type variables that are out of scope   Type variable "StopT" is not in scope (reportGeneralTypeIssues) generics_defaults_referential.py:60:11 - error: Type parameter "S2" has a default type that refers to one or more type variables that are out of scope diff --git a/conformance/results/pyright/generics_paramspec_components.toml b/conformance/results/pyright/generics_paramspec_components.toml index fb7b7d5b3..91d07a572 100644 --- a/conformance/results/pyright/generics_paramspec_components.toml +++ b/conformance/results/pyright/generics_paramspec_components.toml @@ -18,9 +18,9 @@ generics_paramspec_components.py:70:12 - error: Expected 1 positional argument ( generics_paramspec_components.py:72:12 - error: Expected 1 positional argument (reportCallIssue) generics_paramspec_components.py:83:19 - error: Expected 1 positional argument (reportCallIssue) generics_paramspec_components.py:98:20 - error: Argument of type "Literal['A']" cannot be assigned to parameter "a" of type "int" -  "Literal['A']" is incompatible with "int" (reportArgumentType) +  "Literal['A']" is not assignable to "int" (reportArgumentType) generics_paramspec_components.py:98:25 - error: Argument of type "Literal[1]" cannot be assigned to parameter "b" of type "str" -  "Literal[1]" is incompatible with "str" (reportArgumentType) +  "Literal[1]" is not assignable to "str" (reportArgumentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/generics_paramspec_semantics.toml b/conformance/results/pyright/generics_paramspec_semantics.toml index df1e43dc2..e24a0a9c8 100644 --- a/conformance/results/pyright/generics_paramspec_semantics.toml +++ b/conformance/results/pyright/generics_paramspec_semantics.toml @@ -5,30 +5,30 @@ Constraint solver doesn't find common type for two signatures captured by a sing output = """ generics_paramspec_semantics.py:26:6 - error: Expected 2 more positional arguments (reportCallIssue) generics_paramspec_semantics.py:27:9 - error: Argument of type "Literal['A']" cannot be assigned to parameter "b" of type "bool" -  "Literal['A']" is incompatible with "bool" (reportArgumentType) +  "Literal['A']" is not assignable to "bool" (reportArgumentType) generics_paramspec_semantics.py:46:17 - error: Argument of type "(y: int, x: str) -> int" cannot be assigned to parameter "y" of type "(**P@func1) -> int" in function "func1" -  Type "(y: int, x: str) -> int" is incompatible with type "(x: int, y: str) -> int" +  Type "(y: int, x: str) -> int" is not assignable to type "(x: int, y: str) -> int"     Parameter name mismatch: "x" versus "y"     Parameter name mismatch: "y" versus "x" (reportArgumentType) generics_paramspec_semantics.py:61:23 - error: Argument of type "(*, y: int) -> int" cannot be assigned to parameter "y" of type "(**P@func1) -> int" in function "func1" -  Type "(*, y: int) -> int" is incompatible with type "(*, x: int) -> int" +  Type "(*, y: int) -> int" is not assignable to type "(*, x: int) -> int"     Extra parameter "y"     Missing keyword parameter "x" (reportArgumentType) generics_paramspec_semantics.py:98:4 - error: Argument of type "Literal[1]" cannot be assigned to parameter of type "str" -  "Literal[1]" is incompatible with "str" (reportArgumentType) +  "Literal[1]" is not assignable to "str" (reportArgumentType) generics_paramspec_semantics.py:108:4 - error: Argument of type "Literal[1]" cannot be assigned to parameter "args" of type "bool" -  "Literal[1]" is incompatible with "bool" (reportArgumentType) +  "Literal[1]" is not assignable to "bool" (reportArgumentType) generics_paramspec_semantics.py:120:4 - error: Argument of type "Literal[1]" cannot be assigned to parameter of type "str" -  "Literal[1]" is incompatible with "str" (reportArgumentType) +  "Literal[1]" is not assignable to "str" (reportArgumentType) generics_paramspec_semantics.py:127:2 - error: Argument of type "(x: str) -> int" cannot be assigned to parameter "x" of type "(int, **P@expects_int_first) -> int" in function "expects_int_first" -  Type "(x: str) -> int" is incompatible with type "(int, **P@expects_int_first) -> int" +  Type "(x: str) -> int" is not assignable to type "(int, **P@expects_int_first) -> int"     Parameter 1: type "int" is incompatible with type "str" -      "int" is incompatible with "str" (reportArgumentType) +      "int" is not assignable to "str" (reportArgumentType) generics_paramspec_semantics.py:132:2 - error: Argument of type "(*, x: int) -> int" cannot be assigned to parameter "x" of type "(int, **P@expects_int_first) -> int" in function "expects_int_first" -  Type "(*, x: int) -> int" is incompatible with type "(int, **P@expects_int_first) -> int" +  Type "(*, x: int) -> int" is not assignable to type "(int, **P@expects_int_first) -> int"     Function accepts too many positional parameters; expected 0 but received 1 (reportArgumentType) generics_paramspec_semantics.py:137:2 - error: Argument of type "(**kwargs: int) -> int" cannot be assigned to parameter "x" of type "(int, **P@expects_int_first) -> int" in function "expects_int_first" -  Type "(**kwargs: int) -> int" is incompatible with type "(int, **P@expects_int_first) -> int" +  Type "(**kwargs: int) -> int" is not assignable to type "(int, **P@expects_int_first) -> int"     Function accepts too many positional parameters; expected 0 but received 1 (reportArgumentType) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/generics_paramspec_specialization.toml b/conformance/results/pyright/generics_paramspec_specialization.toml index 525051f47..af1ab6764 100644 --- a/conformance/results/pyright/generics_paramspec_specialization.toml +++ b/conformance/results/pyright/generics_paramspec_specialization.toml @@ -3,13 +3,13 @@ output = """ generics_paramspec_specialization.py:44:27 - error: Type "int" cannot be assigned to type variable "P1@ClassA"   Type "int" is incompatible with ParamSpec "P1@ClassA" (reportInvalidTypeArguments) generics_paramspec_specialization.py:54:9 - error: Argument of type "Literal['']" cannot be assigned to parameter of type "int" -  "Literal['']" is incompatible with "int" (reportArgumentType) +  "Literal['']" is not assignable to "int" (reportArgumentType) generics_paramspec_specialization.py:55:16 - error: Argument of type "Literal['']" cannot be assigned to parameter of type "bool" -  "Literal['']" is incompatible with "bool" (reportArgumentType) +  "Literal['']" is not assignable to "bool" (reportArgumentType) generics_paramspec_specialization.py:60:9 - error: Argument of type "Literal['']" cannot be assigned to parameter of type "int" -  "Literal['']" is incompatible with "int" (reportArgumentType) +  "Literal['']" is not assignable to "int" (reportArgumentType) generics_paramspec_specialization.py:61:16 - error: Argument of type "Literal['']" cannot be assigned to parameter of type "bool" -  "Literal['']" is incompatible with "bool" (reportArgumentType) +  "Literal['']" is not assignable to "bool" (reportArgumentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/generics_scoping.toml b/conformance/results/pyright/generics_scoping.toml index bb679b438..2e352ca74 100644 --- a/conformance/results/pyright/generics_scoping.toml +++ b/conformance/results/pyright/generics_scoping.toml @@ -1,7 +1,7 @@ conformant = "Pass" output = """ generics_scoping.py:29:10 - error: Argument of type "Literal['a']" cannot be assigned to parameter "x" of type "int" in function "meth_2" -  "Literal['a']" is incompatible with "int" (reportArgumentType) +  "Literal['a']" is not assignable to "int" (reportArgumentType) generics_scoping.py:50:13 - error: Type variable "S" has no meaning in this context (reportGeneralTypeIssues) generics_scoping.py:54:19 - error: Type variable "S" has no meaning in this context (reportGeneralTypeIssues) generics_scoping.py:65:29 - error: TypeVar "T" is already in use by an outer scope (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/generics_self_attributes.toml b/conformance/results/pyright/generics_self_attributes.toml index 6b439eb2e..b5c9fe45c 100644 --- a/conformance/results/pyright/generics_self_attributes.toml +++ b/conformance/results/pyright/generics_self_attributes.toml @@ -1,16 +1,14 @@ conformant = "Pass" output = """ generics_self_attributes.py:26:38 - error: Argument of type "LinkedList[int]" cannot be assigned to parameter "next" of type "OrdinalLinkedList | None" in function "__init__" -  Type "LinkedList[int]" is incompatible with type "OrdinalLinkedList | None" -    "LinkedList[int]" is incompatible with "OrdinalLinkedList" -    "LinkedList[int]" is incompatible with "None" (reportArgumentType) +  Type "LinkedList[int]" is not assignable to type "OrdinalLinkedList | None" +    "LinkedList[int]" is not assignable to "OrdinalLinkedList" +    "LinkedList[int]" is not assignable to "None" (reportArgumentType) generics_self_attributes.py:32:8 - error: Cannot assign to attribute "next" for class "OrdinalLinkedList"   Expression of type "LinkedList[int]" cannot be assigned to attribute "next" of class "OrdinalLinkedList" -    Attribute "__set__" is unknown -    Attribute "__set__" is unknown -    Type "LinkedList[int]" is incompatible with type "OrdinalLinkedList | None" -      "LinkedList[int]" is incompatible with "OrdinalLinkedList" -      "LinkedList[int]" is incompatible with "None" (reportAttributeAccessIssue) +    Type "LinkedList[int]" is not assignable to type "OrdinalLinkedList | None" +      "LinkedList[int]" is not assignable to "OrdinalLinkedList" +      "LinkedList[int]" is not assignable to "None" (reportAttributeAccessIssue) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/generics_self_basic.toml b/conformance/results/pyright/generics_self_basic.toml index a7a676071..6ce2caef1 100644 --- a/conformance/results/pyright/generics_self_basic.toml +++ b/conformance/results/pyright/generics_self_basic.toml @@ -1,9 +1,9 @@ conformant = "Pass" output = """ -generics_self_basic.py:20:16 - error: Expression of type "Shape" is incompatible with return type "Self@Shape" -  Type "Shape" is incompatible with type "Self@Shape" (reportReturnType) -generics_self_basic.py:33:16 - error: Expression of type "Shape" is incompatible with return type "Self@Shape" -  Type "Shape" is incompatible with type "Self@Shape" (reportReturnType) +generics_self_basic.py:20:16 - error: Type "Shape" is not assignable to return type "Self@Shape" +  Type "Shape" is not assignable to type "Self@Shape" (reportReturnType) +generics_self_basic.py:33:16 - error: Type "Shape" is not assignable to return type "Self@Shape" +  Type "Shape" is not assignable to type "Self@Shape" (reportReturnType) generics_self_basic.py:67:31 - error: Expected no type arguments for class "Self" (reportInvalidTypeArguments) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/generics_self_protocols.toml b/conformance/results/pyright/generics_self_protocols.toml index 9f77ef795..aa6455302 100644 --- a/conformance/results/pyright/generics_self_protocols.toml +++ b/conformance/results/pyright/generics_self_protocols.toml @@ -3,15 +3,15 @@ output = """ generics_self_protocols.py:61:19 - error: Argument of type "BadReturnType" cannot be assigned to parameter "shape" of type "ShapeProtocol" in function "accepts_shape"   "BadReturnType" is incompatible with protocol "ShapeProtocol"     "set_scale" is an incompatible type -      Type "(scale: float) -> int" is incompatible with type "(scale: float) -> BadReturnType" +      Type "(scale: float) -> int" is not assignable to type "(scale: float) -> BadReturnType"         Function return type "int" is incompatible with type "BadReturnType" -          "int" is incompatible with "BadReturnType" (reportArgumentType) +          "int" is not assignable to "BadReturnType" (reportArgumentType) generics_self_protocols.py:64:19 - error: Argument of type "ReturnDifferentClass" cannot be assigned to parameter "shape" of type "ShapeProtocol" in function "accepts_shape"   "ReturnDifferentClass" is incompatible with protocol "ShapeProtocol"     "set_scale" is an incompatible type -      Type "(scale: float) -> ReturnConcreteShape" is incompatible with type "(scale: float) -> ReturnDifferentClass" +      Type "(scale: float) -> ReturnConcreteShape" is not assignable to type "(scale: float) -> ReturnDifferentClass"         Function return type "ReturnConcreteShape" is incompatible with type "ReturnDifferentClass" -          "ReturnConcreteShape" is incompatible with "ReturnDifferentClass" (reportArgumentType) +          "ReturnConcreteShape" is not assignable to "ReturnDifferentClass" (reportArgumentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/generics_self_usage.toml b/conformance/results/pyright/generics_self_usage.toml index 5e7184bac..95f5ac1a0 100644 --- a/conformance/results/pyright/generics_self_usage.toml +++ b/conformance/results/pyright/generics_self_usage.toml @@ -6,8 +6,8 @@ generics_self_usage.py:76:6 - error: "Self" is not valid in this context (report generics_self_usage.py:82:44 - warning: TypeVar "TFoo2" appears only once in generic function signature   Use "Foo2" instead (reportInvalidTypeVarUse) generics_self_usage.py:82:54 - error: "Self" cannot be used in a function with a `self` or `cls` parameter that has a type annotation other than "Self" (reportGeneralTypeIssues) -generics_self_usage.py:86:16 - error: Expression of type "Foo3" is incompatible with return type "Self@Foo3" -  Type "Foo3" is incompatible with type "Self@Foo3" (reportReturnType) +generics_self_usage.py:86:16 - error: Type "Foo3" is not assignable to return type "Self@Foo3" +  Type "Foo3" is not assignable to type "Self@Foo3" (reportReturnType) generics_self_usage.py:101:15 - error: "Self" is not valid in this context (reportGeneralTypeIssues) generics_self_usage.py:103:12 - error: "Self" is not valid in this context (reportGeneralTypeIssues) generics_self_usage.py:106:30 - error: "Self" is not valid in this context (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/generics_syntax_declarations.toml b/conformance/results/pyright/generics_syntax_declarations.toml index 93995d626..4321bdb36 100644 --- a/conformance/results/pyright/generics_syntax_declarations.toml +++ b/conformance/results/pyright/generics_syntax_declarations.toml @@ -5,7 +5,7 @@ generics_syntax_declarations.py:27:20 - error: Type arguments are not allowed wi generics_syntax_declarations.py:34:11 - error: Cannot access attribute "is_integer" for class "str*"   Attribute "is_integer" is unknown (reportAttributeAccessIssue) generics_syntax_declarations.py:46:21 - error: TypeVar constraint type cannot be generic (reportGeneralTypeIssues) -generics_syntax_declarations.py:50:17 - error: List expression not allowed in type annotation +generics_syntax_declarations.py:50:17 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) generics_syntax_declarations.py:50:17 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues) generics_syntax_declarations.py:62:17 - error: TypeVar must have at least two constrained types (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/generics_syntax_infer_variance.toml b/conformance/results/pyright/generics_syntax_infer_variance.toml index d8bd2bd94..b23985d59 100644 --- a/conformance/results/pyright/generics_syntax_infer_variance.toml +++ b/conformance/results/pyright/generics_syntax_infer_variance.toml @@ -2,64 +2,60 @@ 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: Expression of type "ShouldBeCovariant1[float]" is incompatible with declared type "ShouldBeCovariant1[int]" -  "ShouldBeCovariant1[float]" is incompatible with "ShouldBeCovariant1[int]" +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 incompatible with "int" (reportAssignmentType) -generics_syntax_infer_variance.py:37:35 - error: Expression of type "ShouldBeCovariant2[float]" is incompatible with declared type "ShouldBeCovariant2[int]" -  "ShouldBeCovariant2[float]" is incompatible with "ShouldBeCovariant2[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]" +  "ShouldBeCovariant2[float]" is not assignable to "ShouldBeCovariant2[int]"     Type parameter "T@ShouldBeCovariant2" is covariant, but "float" is not a subtype of "int" -      "float" is incompatible with "int" (reportAssignmentType) -generics_syntax_infer_variance.py:46:35 - error: Expression of type "ShouldBeCovariant3[float]" is incompatible with declared type "ShouldBeCovariant3[int]" -  "ShouldBeCovariant3[float]" is incompatible with "ShouldBeCovariant3[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]" +  "ShouldBeCovariant3[float]" is not assignable to "ShouldBeCovariant3[int]"     Type parameter "T@ShouldBeCovariant3" is covariant, but "float" is not a subtype of "int" -      "float" is incompatible with "int" (reportAssignmentType) -generics_syntax_infer_variance.py:55:34 - error: Expression of type "ShouldBeCovariant4[float]" is incompatible with declared type "ShouldBeCovariant4[int]" -  "ShouldBeCovariant4[float]" is incompatible with "ShouldBeCovariant4[int]" -    Type parameter "T@ShouldBeCovariant4" is covariant, but "float" is not a subtype of "int" -      "float" is incompatible with "int" (reportAssignmentType) -generics_syntax_infer_variance.py:68:34 - error: Expression of type "ShouldBeCovariant5[float]" is incompatible with declared type "ShouldBeCovariant5[int]" -  "ShouldBeCovariant5[float]" is incompatible with "ShouldBeCovariant5[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]" +  "ShouldBeCovariant5[float]" is not assignable to "ShouldBeCovariant5[int]"     Type parameter "T@ShouldBeCovariant5" is covariant, but "float" is not a subtype of "int" -      "float" is incompatible with "int" (reportAssignmentType) -generics_syntax_infer_variance.py:79:34 - error: Expression of type "ShouldBeCovariant6[float]" is incompatible with declared type "ShouldBeCovariant6[int]" -  "ShouldBeCovariant6[float]" is incompatible with "ShouldBeCovariant6[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]" +  "ShouldBeCovariant6[float]" is not assignable to "ShouldBeCovariant6[int]"     Type parameter "T@ShouldBeCovariant6" is covariant, but "float" is not a subtype of "int" -      "float" is incompatible with "int" (reportAssignmentType) -generics_syntax_infer_variance.py:95:38 - error: Expression of type "ShouldBeInvariant1[int]" is incompatible with declared type "ShouldBeInvariant1[float]" -  "ShouldBeInvariant1[int]" is incompatible with "ShouldBeInvariant1[float]" +      "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]" +  "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:96:36 - error: Expression of type "ShouldBeInvariant1[float]" is incompatible with declared type "ShouldBeInvariant1[int]" -  "ShouldBeInvariant1[float]" is incompatible with "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:110:38 - error: Expression of type "ShouldBeInvariant2[int]" is incompatible with declared type "ShouldBeInvariant2[float]" -  "ShouldBeInvariant2[int]" is incompatible with "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:111:36 - error: Expression of type "ShouldBeInvariant2[float]" is incompatible with declared type "ShouldBeInvariant2[int]" -  "ShouldBeInvariant2[float]" is incompatible with "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:118:43 - error: Expression of type "ShouldBeInvariant3[int, str]" is incompatible with declared type "ShouldBeInvariant3[float, str]" -  "ShouldBeInvariant3[int, str]" is incompatible with "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:119:41 - error: Expression of type "ShouldBeInvariant3[float, str]" is incompatible with declared type "ShouldBeInvariant3[int, str]" -  "ShouldBeInvariant3[float, str]" is incompatible with "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:120:43 - error: Expression of type "ShouldBeInvariant3[str, int]" is incompatible with declared type "ShouldBeInvariant3[str, float]" -  "ShouldBeInvariant3[str, int]" is incompatible with "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:121:41 - error: Expression of type "ShouldBeInvariant3[str, float]" is incompatible with declared type "ShouldBeInvariant3[str, int]" -  "ShouldBeInvariant3[str, float]" is incompatible with "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:129:38 - error: Expression of type "ShouldBeInvariant4[int]" is incompatible with declared type "ShouldBeInvariant4[float]" -  "ShouldBeInvariant4[int]" is incompatible with "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:137:38 - error: Expression of type "ShouldBeInvariant5[int]" is incompatible with declared type "ShouldBeInvariant5[float]" -  "ShouldBeInvariant5[int]" is incompatible with "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:148:45 - error: Expression of type "ShouldBeContravariant1[int]" is incompatible with declared type "ShouldBeContravariant1[float]" -  "ShouldBeContravariant1[int]" is incompatible with "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 incompatible with "int" (reportAssignmentType) +      "float" is not assignable to "int" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/generics_type_erasure.toml b/conformance/results/pyright/generics_type_erasure.toml index caf122a4e..cbbc0d1c6 100644 --- a/conformance/results/pyright/generics_type_erasure.toml +++ b/conformance/results/pyright/generics_type_erasure.toml @@ -1,13 +1,13 @@ conformant = "Pass" output = """ generics_type_erasure.py:38:16 - error: Argument of type "Literal['']" cannot be assigned to parameter "label" of type "int | None" in function "__init__" -  Type "Literal['']" is incompatible with type "int | None" -    "Literal['']" is incompatible with "int" -    "Literal['']" is incompatible with "None" (reportArgumentType) +  Type "Literal['']" is not assignable to type "int | None" +    "Literal['']" is not assignable to "int" +    "Literal['']" is not assignable to "None" (reportArgumentType) generics_type_erasure.py:40:16 - error: Argument of type "Literal[0]" cannot be assigned to parameter "label" of type "str | None" in function "__init__" -  Type "Literal[0]" is incompatible with type "str | None" -    "Literal[0]" is incompatible with "str" -    "Literal[0]" is incompatible with "None" (reportArgumentType) +  Type "Literal[0]" is not assignable to type "str | None" +    "Literal[0]" is not assignable to "str" +    "Literal[0]" is not assignable to "None" (reportArgumentType) generics_type_erasure.py:42:11 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) generics_type_erasure.py:43:11 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) generics_type_erasure.py:44:6 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/generics_typevartuple_args.toml b/conformance/results/pyright/generics_typevartuple_args.toml index 6e0ee4b27..04a4cc5b5 100644 --- a/conformance/results/pyright/generics_typevartuple_args.toml +++ b/conformance/results/pyright/generics_typevartuple_args.toml @@ -1,22 +1,23 @@ conformant = "Pass" output = """ generics_typevartuple_args.py:33:16 - error: Argument of type "Literal['']" cannot be assigned to parameter of type "Env" in function "exec_le" -  "Literal['']" is incompatible with "Env" (reportArgumentType) +  "Literal['']" is not assignable to "Env" (reportArgumentType) generics_typevartuple_args.py:34:16 - error: Argument of type "Literal['']" cannot be assigned to parameter of type "Env" in function "exec_le" -  "Literal['']" is incompatible with "Env" (reportArgumentType) +  "Literal['']" is not assignable to "Env" (reportArgumentType) generics_typevartuple_args.py:48:10 - error: Argument of type "Literal['2']" cannot be assigned to parameter of type "int" in function "func1" -  "Literal['2']" is incompatible with "int" (reportArgumentType) +  "Literal['2']" is not assignable to "int" (reportArgumentType) generics_typevartuple_args.py:57:10 - error: Argument of type "Literal[1]" cannot be assigned to parameter of type "str" in function "func2" -  "Literal[1]" is incompatible with "str" (reportArgumentType) -generics_typevartuple_args.py:58:1 - error: Argument missing for parameter "args[2]" (reportCallIssue) -generics_typevartuple_args.py:59:1 - error: Argument missing for parameter "args[2]" (reportCallIssue) -generics_typevartuple_args.py:67:1 - error: Argument missing for parameter "args[1]" (reportCallIssue) +  "Literal[1]" is not assignable to "str" (reportArgumentType) +generics_typevartuple_args.py:59:7 - error: Argument of type "Literal['']" cannot be assigned to parameter of type "int" in function "func2" +  "Literal['']" is not assignable to "int" (reportArgumentType) generics_typevartuple_args.py:75:13 - error: Argument of type "tuple[Literal[1], Literal[2]]" cannot be assigned to parameter "args" of type "tuple[*Ts@func4]" in function "func4" -  "tuple[Literal[1], Literal[2]]" is incompatible with "tuple[int]" +  "tuple[Literal[1], Literal[2]]" is not assignable to "tuple[int]"     Tuple size mismatch; expected 1 but received 2 (reportArgumentType) generics_typevartuple_args.py:76:14 - error: Argument of type "tuple[Literal['1']]" cannot be assigned to parameter "args" of type "tuple[*Ts@func4]" in function "func4" -  "Literal['1']" is incompatible with "int" (reportArgumentType) +  "Literal['1']" is not assignable to "int" (reportArgumentType) """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 58: Expected 1 errors +Line 67: Expected 1 errors """ diff --git a/conformance/results/pyright/generics_typevartuple_basic.toml b/conformance/results/pyright/generics_typevartuple_basic.toml index 03878ccf0..862827ae0 100644 --- a/conformance/results/pyright/generics_typevartuple_basic.toml +++ b/conformance/results/pyright/generics_typevartuple_basic.toml @@ -1,12 +1,12 @@ conformant = "Pass" output = """ generics_typevartuple_basic.py:42:34 - error: Argument of type "Height" cannot be assigned to parameter "shape" of type "tuple[*Shape@Array]" in function "__init__" -  "Height" is incompatible with "tuple[*Shape@Array]" (reportArgumentType) -generics_typevartuple_basic.py:43:35 - error: Expression of type "Array[Batch, Width]" is incompatible with declared type "Array[Batch, Height, Width]" -  "Array[Batch, Width]" is incompatible with "Array[Batch, Height, Width]" +  "Height" is not assignable to "tuple[*Shape@Array]" (reportArgumentType) +generics_typevartuple_basic.py:43:35 - error: Type "Array[Batch, Width]" is not assignable to declared type "Array[Batch, Height, Width]" +  "Array[Batch, Width]" is not assignable to "Array[Batch, Height, Width]"     Type parameter "Shape@Array" is invariant, but "*tuple[Batch, Width]" is not the same as "*tuple[Batch, Height, Width]" (reportAssignmentType) -generics_typevartuple_basic.py:44:41 - error: Expression of type "Array[Time, Batch, Width, Height]" is incompatible with declared type "Array[Time, Batch, Height, Width]" -  "Array[Time, Batch, Width, Height]" is incompatible with "Array[Time, Batch, Height, Width]" +generics_typevartuple_basic.py:44:41 - error: Type "Array[Time, Batch, Width, Height]" is not assignable to declared type "Array[Time, Batch, Height, Width]" +  "Array[Time, Batch, Width, Height]" is not assignable to "Array[Time, Batch, Height, Width]"     Type parameter "Shape@Array" is invariant, but "*tuple[Time, Batch, Width, Height]" is not the same as "*tuple[Time, Batch, Height, Width]" (reportAssignmentType) generics_typevartuple_basic.py:52:22 - error: Expected unpacked TypeVarTuple; use Unpack[Shape] or *Shape (reportInvalidTypeForm) generics_typevartuple_basic.py:53:37 - error: Expected unpacked TypeVarTuple; use Unpack[Shape] or *Shape (reportInvalidTypeForm) @@ -17,15 +17,15 @@ generics_typevartuple_basic.py:66:27 - error: TypeVarTuple cannot have value con generics_typevartuple_basic.py:66:32 - error: TypeVarTuple cannot have value constraints (reportGeneralTypeIssues) generics_typevartuple_basic.py:67:27 - error: "bound" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues) generics_typevartuple_basic.py:89:14 - error: Argument of type "tuple[Literal['0']]" cannot be assigned to parameter "arg2" of type "tuple[*Ts@func2]" in function "func2" -  "Literal['0']" is incompatible with "int" (reportArgumentType) +  "Literal['0']" is not assignable to "int" (reportArgumentType) generics_typevartuple_basic.py:90:15 - error: Argument of type "tuple[Literal[0]]" cannot be assigned to parameter "arg2" of type "tuple[*Ts@func2]" in function "func2" -  "tuple[Literal[0]]" is incompatible with "tuple[int, int]" +  "tuple[Literal[0]]" is not assignable to "tuple[int, int]"     Tuple size mismatch; expected 2 but received 1 (reportArgumentType) generics_typevartuple_basic.py:99:17 - error: Argument of type "Array[Width]" cannot be assigned to parameter "y" of type "Array[*Shape@multiply]" in function "multiply" -  "Array[Width]" is incompatible with "Array[Height]" +  "Array[Width]" is not assignable to "Array[Height]"     Type parameter "Shape@Array" is invariant, but "*tuple[Width]" is not the same as "*tuple[Height]" (reportArgumentType) generics_typevartuple_basic.py:100:17 - error: Argument of type "Array[Height, Width]" cannot be assigned to parameter "y" of type "Array[*Shape@multiply]" in function "multiply" -  "Array[Height, Width]" is incompatible with "Array[Height]" +  "Array[Height, Width]" is not assignable to "Array[Height]"     Type parameter "Shape@Array" is invariant, but "*tuple[Height, Width]" is not the same as "*tuple[Height]" (reportArgumentType) generics_typevartuple_basic.py:106:14 - error: Generic class can have at most one TypeVarTuple type parameter but received multiple ("Ts1", "Ts2") (reportGeneralTypeIssues) generics_typevartuple_basic.py:106:29 - error: Type argument list can have at most one unpacked TypeVarTuple or tuple (reportInvalidTypeForm) diff --git a/conformance/results/pyright/generics_typevartuple_callable.toml b/conformance/results/pyright/generics_typevartuple_callable.toml index 7c22ef0e8..fb569c88c 100644 --- a/conformance/results/pyright/generics_typevartuple_callable.toml +++ b/conformance/results/pyright/generics_typevartuple_callable.toml @@ -1,8 +1,8 @@ conformant = "Pass" output = """ generics_typevartuple_callable.py:26:28 - error: Argument of type "tuple[Literal[''], Literal[0]]" cannot be assigned to parameter "args" of type "tuple[*Ts@__init__]" in function "__init__" -  "Literal['']" is incompatible with "int" -  "Literal[0]" is incompatible with "str" (reportArgumentType) +  "Literal['']" is not assignable to "int" +  "Literal[0]" is not assignable to "str" (reportArgumentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/generics_typevartuple_unpack.toml b/conformance/results/pyright/generics_typevartuple_unpack.toml index 22576b797..a6484a5a2 100644 --- a/conformance/results/pyright/generics_typevartuple_unpack.toml +++ b/conformance/results/pyright/generics_typevartuple_unpack.toml @@ -1,7 +1,7 @@ conformant = "Pass" output = """ generics_typevartuple_unpack.py:30:28 - error: Argument of type "Array[Batch]" cannot be assigned to parameter "x" of type "Array[Batch, *tuple[Any, ...], Channels]" in function "process_batch_channels" -  "Array[Batch]" is incompatible with "Array[Batch, *tuple[Any, ...], Channels]" +  "Array[Batch]" is not assignable to "Array[Batch, *tuple[Any, ...], Channels]"     Type parameter "Ts@Array" is invariant, but "*tuple[Batch]" is not the same as "*tuple[Batch, *tuple[Any, ...], Channels]" (reportArgumentType) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/generics_upper_bound.toml b/conformance/results/pyright/generics_upper_bound.toml index 280be61a7..ed479279f 100644 --- a/conformance/results/pyright/generics_upper_bound.toml +++ b/conformance/results/pyright/generics_upper_bound.toml @@ -2,11 +2,11 @@ conformant = "Pass" output = """ generics_upper_bound.py:24:38 - error: TypeVar bound type cannot be generic (reportGeneralTypeIssues) generics_upper_bound.py:51:8 - error: Argument of type "Literal[3]" cannot be assigned to parameter "x" of type "ST@longer" in function "longer" -  Type "Literal[3]" is incompatible with type "Sized" +  Type "Literal[3]" is not assignable to type "Sized"     "Literal[3]" is incompatible with protocol "Sized"       "__len__" is not present (reportArgumentType) generics_upper_bound.py:51:11 - error: Argument of type "Literal[3]" cannot be assigned to parameter "y" of type "ST@longer" in function "longer" -  Type "Literal[3]" is incompatible with type "Sized" +  Type "Literal[3]" is not assignable to type "Sized"     "Literal[3]" is incompatible with protocol "Sized"       "__len__" is not present (reportArgumentType) generics_upper_bound.py:56:44 - error: TypeVar cannot be both bound and constrained (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/generics_variance_inference.toml b/conformance/results/pyright/generics_variance_inference.toml index e2b3de347..5c0f32e2a 100644 --- a/conformance/results/pyright/generics_variance_inference.toml +++ b/conformance/results/pyright/generics_variance_inference.toml @@ -1,85 +1,88 @@ conformant = "Pass" output = """ -generics_variance_inference.py:24:33 - error: Expression of type "ClassA[float, int, int]" is incompatible with declared type "ClassA[int, int, int]" -  "ClassA[float, int, int]" is incompatible with "ClassA[int, int, int]" +generics_variance_inference.py:24:33 - error: Type "ClassA[float, int, int]" is not assignable to declared type "ClassA[int, int, int]" +  "ClassA[float, int, int]" is not assignable to "ClassA[int, int, int]"     Type parameter "T1@ClassA" is invariant, but "float" is not the same as "int" (reportAssignmentType) -generics_variance_inference.py:25:37 - error: Expression of type "ClassA[float, int, int]" is incompatible with declared type "ClassA[float, float, int]" -  "ClassA[float, int, int]" is incompatible with "ClassA[float, float, int]" +generics_variance_inference.py:25:37 - error: Type "ClassA[float, int, int]" is not assignable to declared type "ClassA[float, float, int]" +  "ClassA[float, int, int]" is not assignable to "ClassA[float, float, int]"     Type parameter "T2@ClassA" is contravariant, but "int" is not a supertype of "float" -      "float" is incompatible with "int" (reportAssignmentType) -generics_variance_inference.py:28:33 - error: Expression of type "ClassA[int, float, float]" is incompatible with declared type "ClassA[int, int, int]" -  "ClassA[int, float, float]" is incompatible with "ClassA[int, int, int]" +      "float" is not assignable to "int" (reportAssignmentType) +generics_variance_inference.py:28:33 - error: Type "ClassA[int, float, float]" is not assignable to declared type "ClassA[int, int, int]" +  "ClassA[int, float, float]" is not assignable to "ClassA[int, int, int]"     Type parameter "T3@ClassA" is covariant, but "float" is not a subtype of "int" -      "float" is incompatible with "int" (reportAssignmentType) -generics_variance_inference.py:41:35 - error: Expression of type "ShouldBeCovariant1[float]" is incompatible with declared type "ShouldBeCovariant1[int]" -  "ShouldBeCovariant1[float]" is incompatible with "ShouldBeCovariant1[int]" +      "float" is not assignable to "int" (reportAssignmentType) +generics_variance_inference.py:41: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 incompatible with "int" (reportAssignmentType) -generics_variance_inference.py:49:35 - error: Expression of type "ShouldBeCovariant2[float]" is incompatible with declared type "ShouldBeCovariant2[int]" -  "ShouldBeCovariant2[float]" is incompatible with "ShouldBeCovariant2[int]" +      "float" is not assignable to "int" (reportAssignmentType) +generics_variance_inference.py:49: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 incompatible with "int" (reportAssignmentType) -generics_variance_inference.py:58:35 - error: Expression of type "ShouldBeCovariant3[float]" is incompatible with declared type "ShouldBeCovariant3[int]" -  "ShouldBeCovariant3[float]" is incompatible with "ShouldBeCovariant3[int]" +      "float" is not assignable to "int" (reportAssignmentType) +generics_variance_inference.py:58: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 incompatible with "int" (reportAssignmentType) -generics_variance_inference.py:67:34 - error: Expression of type "ShouldBeCovariant4[float]" is incompatible with declared type "ShouldBeCovariant4[int]" -  "ShouldBeCovariant4[float]" is incompatible with "ShouldBeCovariant4[int]" -    Type parameter "T@ShouldBeCovariant4" is covariant, but "float" is not a subtype of "int" -      "float" is incompatible with "int" (reportAssignmentType) -generics_variance_inference.py:80:34 - error: Expression of type "ShouldBeCovariant5[float]" is incompatible with declared type "ShouldBeCovariant5[int]" -  "ShouldBeCovariant5[float]" is incompatible with "ShouldBeCovariant5[int]" +      "float" is not assignable to "int" (reportAssignmentType) +generics_variance_inference.py:66:36 - error: Type "ShouldBeCovariant4[int]" is not assignable to declared type "ShouldBeCovariant4[float]" +  "ShouldBeCovariant4[int]" is not assignable to "ShouldBeCovariant4[float]" +    Type parameter "T@ShouldBeCovariant4" is invariant, but "int" is not the same as "float" (reportAssignmentType) +generics_variance_inference.py:67:34 - error: Type "ShouldBeCovariant4[float]" is not assignable to declared type "ShouldBeCovariant4[int]" +  "ShouldBeCovariant4[float]" is not assignable to "ShouldBeCovariant4[int]" +    Type parameter "T@ShouldBeCovariant4" is invariant, but "float" is not the same as "int" (reportAssignmentType) +generics_variance_inference.py:80: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 incompatible with "int" (reportAssignmentType) -generics_variance_inference.py:96:38 - error: Expression of type "ShouldBeInvariant1[int]" is incompatible with declared type "ShouldBeInvariant1[float]" -  "ShouldBeInvariant1[int]" is incompatible with "ShouldBeInvariant1[float]" +      "float" is not assignable to "int" (reportAssignmentType) +generics_variance_inference.py:96: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_variance_inference.py:97:36 - error: Expression of type "ShouldBeInvariant1[float]" is incompatible with declared type "ShouldBeInvariant1[int]" -  "ShouldBeInvariant1[float]" is incompatible with "ShouldBeInvariant1[int]" +generics_variance_inference.py:97: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_variance_inference.py:111:38 - error: Expression of type "ShouldBeInvariant2[int]" is incompatible with declared type "ShouldBeInvariant2[float]" -  "ShouldBeInvariant2[int]" is incompatible with "ShouldBeInvariant2[float]" +generics_variance_inference.py:111: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_variance_inference.py:112:36 - error: Expression of type "ShouldBeInvariant2[float]" is incompatible with declared type "ShouldBeInvariant2[int]" -  "ShouldBeInvariant2[float]" is incompatible with "ShouldBeInvariant2[int]" +generics_variance_inference.py:112: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_variance_inference.py:119:43 - error: Expression of type "ShouldBeInvariant3[int, str]" is incompatible with declared type "ShouldBeInvariant3[float, str]" -  "ShouldBeInvariant3[int, str]" is incompatible with "ShouldBeInvariant3[float, str]" +generics_variance_inference.py:119: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_variance_inference.py:120:41 - error: Expression of type "ShouldBeInvariant3[float, str]" is incompatible with declared type "ShouldBeInvariant3[int, str]" -  "ShouldBeInvariant3[float, str]" is incompatible with "ShouldBeInvariant3[int, str]" +generics_variance_inference.py:120: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_variance_inference.py:121:43 - error: Expression of type "ShouldBeInvariant3[str, int]" is incompatible with declared type "ShouldBeInvariant3[str, float]" -  "ShouldBeInvariant3[str, int]" is incompatible with "ShouldBeInvariant3[str, float]" +generics_variance_inference.py:121: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_variance_inference.py:122:41 - error: Expression of type "ShouldBeInvariant3[str, float]" is incompatible with declared type "ShouldBeInvariant3[str, int]" -  "ShouldBeInvariant3[str, float]" is incompatible with "ShouldBeInvariant3[str, int]" +generics_variance_inference.py:122: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_variance_inference.py:130:38 - error: Expression of type "ShouldBeInvariant4[int]" is incompatible with declared type "ShouldBeInvariant4[float]" -  "ShouldBeInvariant4[int]" is incompatible with "ShouldBeInvariant4[float]" +generics_variance_inference.py:130: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_variance_inference.py:138:38 - error: Expression of type "ShouldBeInvariant5[int]" is incompatible with declared type "ShouldBeInvariant5[float]" -  "ShouldBeInvariant5[int]" is incompatible with "ShouldBeInvariant5[float]" +generics_variance_inference.py:138: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_variance_inference.py:149:45 - error: Expression of type "ShouldBeContravariant1[int]" is incompatible with declared type "ShouldBeContravariant1[float]" -  "ShouldBeContravariant1[int]" is incompatible with "ShouldBeContravariant1[float]" +generics_variance_inference.py:149: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 incompatible with "int" (reportAssignmentType) -generics_variance_inference.py:169:31 - error: Expression of type "ShouldBeInvariant6[float]" is incompatible with declared type "ShouldBeInvariant6[int]" -  "ShouldBeInvariant6[float]" is incompatible with "ShouldBeInvariant6[int]" +      "float" is not assignable to "int" (reportAssignmentType) +generics_variance_inference.py:169:31 - error: Type "ShouldBeInvariant6[float]" is not assignable to declared type "ShouldBeInvariant6[int]" +  "ShouldBeInvariant6[float]" is not assignable to "ShouldBeInvariant6[int]"     Type parameter "T@ShouldBeInvariant6" is invariant, but "float" is not the same as "int" (reportAssignmentType) -generics_variance_inference.py:170:33 - error: Expression of type "ShouldBeInvariant6[int]" is incompatible with declared type "ShouldBeInvariant6[float]" -  "ShouldBeInvariant6[int]" is incompatible with "ShouldBeInvariant6[float]" +generics_variance_inference.py:170:33 - error: Type "ShouldBeInvariant6[int]" is not assignable to declared type "ShouldBeInvariant6[float]" +  "ShouldBeInvariant6[int]" is not assignable to "ShouldBeInvariant6[float]"     Type parameter "T@ShouldBeInvariant6" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_variance_inference.py:181:31 - error: Expression of type "ShouldBeCovariant6[float]" is incompatible with declared type "ShouldBeCovariant6[int]" -  "ShouldBeCovariant6[float]" is incompatible with "ShouldBeCovariant6[int]" +generics_variance_inference.py:181:31 - 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 incompatible with "int" (reportAssignmentType) -generics_variance_inference.py:194:37 - error: Expression of type "ShouldBeContravariant2[int]" is incompatible with declared type "ShouldBeContravariant2[float]" -  "ShouldBeContravariant2[int]" is incompatible with "ShouldBeContravariant2[float]" +      "float" is not assignable to "int" (reportAssignmentType) +generics_variance_inference.py:194:37 - error: Type "ShouldBeContravariant2[int]" is not assignable to declared type "ShouldBeContravariant2[float]" +  "ShouldBeContravariant2[int]" is not assignable to "ShouldBeContravariant2[float]"     Type parameter "T@ShouldBeContravariant2" is contravariant, but "int" is not a supertype of "float" -      "float" is incompatible with "int" (reportAssignmentType) +      "float" is not assignable to "int" (reportAssignmentType) """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 66: Unexpected errors ['generics_variance_inference.py:66:36 - error: Type "ShouldBeCovariant4[int]" is not assignable to declared type "ShouldBeCovariant4[float]"'] """ diff --git a/conformance/results/pyright/literals_literalstring.toml b/conformance/results/pyright/literals_literalstring.toml index 7c1778def..2146bdb47 100644 --- a/conformance/results/pyright/literals_literalstring.toml +++ b/conformance/results/pyright/literals_literalstring.toml @@ -2,22 +2,22 @@ conformant = "Pass" output = """ literals_literalstring.py:36:29 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) literals_literalstring.py:37:22 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) -literals_literalstring.py:43:23 - error: Expression of type "Literal['two']" is incompatible with declared type "Literal['']" -  "Literal['two']" is incompatible with type "Literal['']" (reportAssignmentType) -literals_literalstring.py:66:25 - error: Expression of type "str" is incompatible with declared type "LiteralString" -  "str" is incompatible with "LiteralString" (reportAssignmentType) -literals_literalstring.py:74:25 - error: Expression of type "Literal[3]" is incompatible with declared type "LiteralString" -  "Literal[3]" is incompatible with "LiteralString" (reportAssignmentType) -literals_literalstring.py:75:25 - error: Expression of type "Literal[b"test"]" is incompatible with declared type "LiteralString" -  "Literal[b"test"]" is incompatible with "LiteralString" (reportAssignmentType) +literals_literalstring.py:43:23 - error: Type "Literal['two']" is not assignable to declared type "Literal['']" +  "Literal['two']" is not assignable to type "Literal['']" (reportAssignmentType) +literals_literalstring.py:66:25 - error: Type "str" is not assignable to declared type "LiteralString" +  "str" is not assignable to "LiteralString" (reportAssignmentType) +literals_literalstring.py:74:25 - error: Type "Literal[3]" is not assignable to declared type "LiteralString" +  "Literal[3]" is not assignable to "LiteralString" (reportAssignmentType) +literals_literalstring.py:75:25 - error: Type "Literal[b"test"]" is not assignable to declared type "LiteralString" +  "Literal[b"test"]" is not assignable to "LiteralString" (reportAssignmentType) literals_literalstring.py:120:22 - error: Argument of type "str" cannot be assigned to parameter "s" of type "TLiteral@literal_identity" in function "literal_identity" -  Type "str" is incompatible with type "LiteralString" -    "str" is incompatible with "LiteralString" (reportArgumentType) +  Type "str" is not assignable to type "LiteralString" +    "str" is not assignable to "LiteralString" (reportArgumentType) literals_literalstring.py:134:51 - error: Argument of type "str" cannot be assigned to parameter "value" of type "T@Container" in function "__init__" -  Type "str" is incompatible with type "LiteralString" -    "str" is incompatible with "LiteralString" (reportArgumentType) -literals_literalstring.py:171:21 - error: Expression of type "list[LiteralString]" is incompatible with declared type "list[str]" -  "list[LiteralString]" is incompatible with "list[str]" +  Type "str" is not assignable to type "LiteralString" +    "str" is not assignable to "LiteralString" (reportArgumentType) +literals_literalstring.py:171:21 - error: Type "list[LiteralString]" is not assignable to declared type "list[str]" +  "list[LiteralString]" is not assignable to "list[str]"     Type parameter "_T@list" is invariant, but "LiteralString" is not the same as "str"     Consider switching from "list" to "Sequence" which is covariant (reportAssignmentType) """ diff --git a/conformance/results/pyright/literals_parameterizations.toml b/conformance/results/pyright/literals_parameterizations.toml index 16811ca13..bad4ec5e3 100644 --- a/conformance/results/pyright/literals_parameterizations.toml +++ b/conformance/results/pyright/literals_parameterizations.toml @@ -1,31 +1,31 @@ conformant = "Pass" output = """ -literals_parameterizations.py:41:15 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) +literals_parameterizations.py:41:15 - error: Binary operator not allowed in type expression (reportInvalidTypeForm) literals_parameterizations.py:41:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) literals_parameterizations.py:42:15 - error: Call expression not allowed in type expression (reportInvalidTypeForm) literals_parameterizations.py:42:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) -literals_parameterizations.py:43:15 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) +literals_parameterizations.py:43:15 - error: Binary operator not allowed in type expression (reportInvalidTypeForm) literals_parameterizations.py:43:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) -literals_parameterizations.py:44:15 - error: Unary operator not allowed in type annotation (reportInvalidTypeForm) +literals_parameterizations.py:44:15 - error: Unary operator not allowed in type expression (reportInvalidTypeForm) literals_parameterizations.py:44:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) -literals_parameterizations.py:45:15 - error: Unary operator not allowed in type annotation (reportInvalidTypeForm) +literals_parameterizations.py:45:15 - error: Unary operator not allowed in type expression (reportInvalidTypeForm) literals_parameterizations.py:45:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) literals_parameterizations.py:46:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) literals_parameterizations.py:47:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) literals_parameterizations.py:48:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) literals_parameterizations.py:49:15 - error: Variable not allowed in type expression (reportInvalidTypeForm) literals_parameterizations.py:49:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) -literals_parameterizations.py:50:16 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) literals_parameterizations.py:50:16 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) literals_parameterizations.py:51:16 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) literals_parameterizations.py:52:16 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) +literals_parameterizations.py:53:16 - error: "..." is not allowed in this context (reportInvalidTypeForm) literals_parameterizations.py:53:16 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) -literals_parameterizations.py:56:28 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) +literals_parameterizations.py:56:28 - error: Binary operator not allowed in type expression (reportInvalidTypeForm) literals_parameterizations.py:56:28 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) literals_parameterizations.py:60:4 - error: "Literal" cannot be used in this context without a type argument (reportInvalidTypeForm) literals_parameterizations.py:61:12 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) -literals_parameterizations.py:65:32 - error: Expression of type "Literal[Color.RED]" is incompatible with declared type "Literal['Color.RED']" -  "Literal[Color.RED]" is incompatible with type "Literal['Color.RED']" (reportAssignmentType) +literals_parameterizations.py:65:32 - error: Type "Literal[Color.RED]" is not assignable to declared type "Literal['Color.RED']" +  "Literal[Color.RED]" is not assignable to "Literal['Color.RED']" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/literals_semantics.toml b/conformance/results/pyright/literals_semantics.toml index 2606d3f0e..7d8b8af5f 100644 --- a/conformance/results/pyright/literals_semantics.toml +++ b/conformance/results/pyright/literals_semantics.toml @@ -1,12 +1,17 @@ conformant = "Pass" output = """ -literals_semantics.py:10:18 - error: Expression of type "Literal[4]" is incompatible with declared type "Literal[3]" -  "Literal[4]" is incompatible with type "Literal[3]" (reportAssignmentType) -literals_semantics.py:24:26 - error: Expression of type "Literal[0]" is incompatible with declared type "Literal[False]" -  "Literal[0]" is incompatible with type "Literal[False]" (reportAssignmentType) -literals_semantics.py:25:22 - error: Expression of type "Literal[False]" is incompatible with declared type "Literal[0]" -  "Literal[False]" is incompatible with type "Literal[0]" (reportAssignmentType) -literals_semantics.py:33:10 - error: Expression of type "Literal[6, 7, 8]" is incompatible with declared type "Literal[3, 4, 5]" (reportAssignmentType) +literals_semantics.py:10:18 - error: Type "Literal[4]" is not assignable to declared type "Literal[3]" +  "Literal[4]" is not assignable to type "Literal[3]" (reportAssignmentType) +literals_semantics.py:24:26 - error: Type "Literal[0]" is not assignable to declared type "Literal[False]" +  "Literal[0]" is not assignable to "Literal[False]" (reportAssignmentType) +literals_semantics.py:25:22 - error: Type "Literal[False]" is not assignable to declared type "Literal[0]" +  "Literal[False]" is not assignable to "Literal[0]" (reportAssignmentType) +literals_semantics.py:33:10 - error: Type "Literal[6, 7, 8]" is not assignable to declared type "Literal[3, 4, 5]" +  Type "Literal[6, 7, 8]" is not assignable to type "Literal[3, 4, 5]" +    Type "Literal[6]" is not assignable to type "Literal[3, 4, 5]" +      "Literal[6]" is not assignable to type "Literal[3]" +      "Literal[6]" is not assignable to type "Literal[4]" +      "Literal[6]" is not assignable to type "Literal[5]" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/namedtuples_define_class.toml b/conformance/results/pyright/namedtuples_define_class.toml index 2da523d93..19f9aadcb 100644 --- a/conformance/results/pyright/namedtuples_define_class.toml +++ b/conformance/results/pyright/namedtuples_define_class.toml @@ -5,15 +5,15 @@ namedtuples_define_class.py:33:7 - error: Index -4 is out of range for type Poin namedtuples_define_class.py:44:6 - error: Argument missing for parameter "y" (reportCallIssue) namedtuples_define_class.py:45:6 - error: Argument missing for parameter "y" (reportCallIssue) namedtuples_define_class.py:46:15 - error: Argument of type "Literal['']" cannot be assigned to parameter "y" of type "int" in function "__new__" -  "Literal['']" is incompatible with "int" (reportArgumentType) +  "Literal['']" is not assignable to "int" (reportArgumentType) namedtuples_define_class.py:47:24 - error: Argument of type "Literal[3]" cannot be assigned to parameter "units" of type "str" in function "__new__" -  "Literal[3]" is incompatible with "str" (reportArgumentType) +  "Literal[3]" is not assignable to "str" (reportArgumentType) namedtuples_define_class.py:48:22 - error: Expected 3 positional arguments (reportCallIssue) namedtuples_define_class.py:49:23 - error: No parameter named "other" (reportCallIssue) namedtuples_define_class.py:59:5 - error: Fields without default values cannot appear after fields with default values (reportGeneralTypeIssues) namedtuples_define_class.py:79:5 - error: Cannot override "x" because parent class "Point" is a named tuple (reportIncompatibleVariableOverride) namedtuples_define_class.py:98:19 - error: Argument of type "float" cannot be assigned to parameter "value" of type "str" in function "__new__" -  "float" is incompatible with "str" (reportArgumentType) +  "float" is not assignable to "str" (reportArgumentType) namedtuples_define_class.py:105:7 - error: Multiple inheritance with NamedTuple is not supported (reportGeneralTypeIssues) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/namedtuples_define_functional.toml b/conformance/results/pyright/namedtuples_define_functional.toml index c76f18e84..07c432045 100644 --- a/conformance/results/pyright/namedtuples_define_functional.toml +++ b/conformance/results/pyright/namedtuples_define_functional.toml @@ -6,12 +6,12 @@ namedtuples_define_functional.py:26:21 - error: Expected 2 positional arguments namedtuples_define_functional.py:31:8 - error: Argument missing for parameter "y" (reportCallIssue) namedtuples_define_functional.py:31:18 - error: No parameter named "z" (reportCallIssue) namedtuples_define_functional.py:36:18 - error: Argument of type "Literal['1']" cannot be assigned to parameter "y" of type "int" in function "__new__" -  "Literal['1']" is incompatible with "int" (reportArgumentType) +  "Literal['1']" is not assignable to "int" (reportArgumentType) namedtuples_define_functional.py:37:21 - error: Expected 2 positional arguments (reportCallIssue) namedtuples_define_functional.py:42:18 - error: Argument of type "Literal['1']" cannot be assigned to parameter "y" of type "int" in function "__new__" -  "Literal['1']" is incompatible with "int" (reportArgumentType) +  "Literal['1']" is not assignable to "int" (reportArgumentType) namedtuples_define_functional.py:43:17 - error: Argument of type "float" cannot be assigned to parameter "x" of type "int" in function "__new__" -  "float" is incompatible with "int" (reportArgumentType) +  "float" is not assignable to "int" (reportArgumentType) namedtuples_define_functional.py:52:31 - error: Names within a named tuple must be unique (reportGeneralTypeIssues) namedtuples_define_functional.py:53:33 - error: Field names cannot be a keyword (reportGeneralTypeIssues) namedtuples_define_functional.py:54:33 - error: Field names cannot be a keyword (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/namedtuples_type_compat.toml b/conformance/results/pyright/namedtuples_type_compat.toml index aa8f69e63..c31192fc8 100644 --- a/conformance/results/pyright/namedtuples_type_compat.toml +++ b/conformance/results/pyright/namedtuples_type_compat.toml @@ -1,12 +1,12 @@ conformant = "Pass" output = """ -namedtuples_type_compat.py:22:23 - error: Expression of type "Point" is incompatible with declared type "tuple[int, int]" -  "Point" is incompatible with "tuple[int, int]" +namedtuples_type_compat.py:22:23 - error: Type "Point" is not assignable to declared type "tuple[int, int]" +  "Point" is not assignable to "tuple[int, int]"     Tuple size mismatch; expected 2 but received 3 (reportAssignmentType) -namedtuples_type_compat.py:23:28 - error: Expression of type "Point" is incompatible with declared type "tuple[int, str, str]" -  "Point" is incompatible with "tuple[int, str, str]" +namedtuples_type_compat.py:23:28 - error: Type "Point" is not assignable to declared type "tuple[int, str, str]" +  "Point" is not assignable to "tuple[int, str, str]"     Tuple entry 2 is incorrect type -      "int" is incompatible with "str" (reportAssignmentType) +      "int" is not assignable to "str" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/namedtuples_usage.toml b/conformance/results/pyright/namedtuples_usage.toml index 693e8c389..76f53162e 100644 --- a/conformance/results/pyright/namedtuples_usage.toml +++ b/conformance/results/pyright/namedtuples_usage.toml @@ -3,12 +3,10 @@ output = """ namedtuples_usage.py:34:7 - error: Index 3 is out of range for type Point (reportGeneralTypeIssues) namedtuples_usage.py:35:7 - error: Index -4 is out of range for type Point (reportGeneralTypeIssues) namedtuples_usage.py:40:3 - error: Cannot assign to attribute "x" for class "Point" -  Attribute "x" is read-only -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  Attribute "x" is read-only (reportAttributeAccessIssue) namedtuples_usage.py:41:1 - error: "__setitem__" method not defined on type "Point" (reportIndexIssue) namedtuples_usage.py:42:7 - error: Cannot delete attribute "x" for class "Point" -  Attribute "x" is read-only -    Attribute "__delete__" is unknown (reportAttributeAccessIssue) +  Attribute "x" is read-only (reportAttributeAccessIssue) namedtuples_usage.py:43:5 - error: "__delitem__" method not defined on type "Point" (reportIndexIssue) namedtuples_usage.py:52:1 - error: Expression with type "Point" cannot be assigned to target tuple   Type "Point" is incompatible with target tuple diff --git a/conformance/results/pyright/narrowing_typeguard.toml b/conformance/results/pyright/narrowing_typeguard.toml index ecab95858..a363ec8f3 100644 --- a/conformance/results/pyright/narrowing_typeguard.toml +++ b/conformance/results/pyright/narrowing_typeguard.toml @@ -3,15 +3,15 @@ output = """ narrowing_typeguard.py:102:9 - error: User-defined type guard functions and methods must have at least one input parameter (reportGeneralTypeIssues) narrowing_typeguard.py:107:9 - error: User-defined type guard functions and methods must have at least one input parameter (reportGeneralTypeIssues) narrowing_typeguard.py:128:20 - error: Argument of type "(val: object) -> TypeGuard[int]" cannot be assigned to parameter "f" of type "(object) -> str" in function "takes_callable_str" -  Type "(val: object) -> TypeGuard[int]" is incompatible with type "(object) -> str" +  Type "(val: object) -> TypeGuard[int]" is not assignable to type "(object) -> str"     Function return type "TypeGuard[int]" is incompatible with type "str" -      "TypeGuard[int]" is incompatible with "str" -      "bool" is incompatible with "str" (reportArgumentType) +      "TypeGuard[int]" is not assignable to "str" +      "bool" is not assignable to "str" (reportArgumentType) narrowing_typeguard.py:148:26 - error: Argument of type "(val: object) -> TypeGuard[int]" cannot be assigned to parameter "f" of type "CallableStrProto" in function "takes_callable_str_proto" -  Type "(val: object) -> TypeGuard[int]" is incompatible with type "(val: object) -> str" +  Type "(val: object) -> TypeGuard[int]" is not assignable to type "(val: object) -> str"     Function return type "TypeGuard[int]" is incompatible with type "str" -      "TypeGuard[int]" is incompatible with "str" -      "bool" is incompatible with "str" (reportArgumentType) +      "TypeGuard[int]" is not assignable to "str" +      "bool" is not assignable to "str" (reportArgumentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/narrowing_typeis.toml b/conformance/results/pyright/narrowing_typeis.toml index 731a636e8..ca6a42a9e 100644 --- a/conformance/results/pyright/narrowing_typeis.toml +++ b/conformance/results/pyright/narrowing_typeis.toml @@ -6,31 +6,31 @@ output = """ narrowing_typeis.py:105:9 - error: User-defined type guard functions and methods must have at least one input parameter (reportGeneralTypeIssues) narrowing_typeis.py:110:9 - error: User-defined type guard functions and methods must have at least one input parameter (reportGeneralTypeIssues) narrowing_typeis.py:132:20 - error: Argument of type "(val: object) -> TypeIs[int]" cannot be assigned to parameter "f" of type "(object) -> str" in function "takes_callable_str" -  Type "(val: object) -> TypeIs[int]" is incompatible with type "(object) -> str" +  Type "(val: object) -> TypeIs[int]" is not assignable to type "(object) -> str"     Function return type "TypeIs[int]" is incompatible with type "str" -      "TypeIs[int]" is incompatible with "str" -      "bool" is incompatible with "str" (reportArgumentType) +      "TypeIs[int]" is not assignable to "str" +      "bool" is not assignable to "str" (reportArgumentType) narrowing_typeis.py:152:26 - error: Argument of type "(val: object) -> TypeIs[int]" cannot be assigned to parameter "f" of type "CallableStrProto" in function "takes_callable_str_proto" -  Type "(val: object) -> TypeIs[int]" is incompatible with type "(val: object) -> str" +  Type "(val: object) -> TypeIs[int]" is not assignable to type "(val: object) -> str"     Function return type "TypeIs[int]" is incompatible with type "str" -      "TypeIs[int]" is incompatible with "str" -      "bool" is incompatible with "str" (reportArgumentType) +      "TypeIs[int]" is not assignable to "str" +      "bool" is not assignable to "str" (reportArgumentType) narrowing_typeis.py:169:17 - error: Argument of type "(val: object) -> TypeIs[int]" cannot be assigned to parameter "f" of type "(object) -> TypeGuard[int]" in function "takes_typeguard" -  Type "(val: object) -> TypeIs[int]" is incompatible with type "(object) -> TypeGuard[int]" +  Type "(val: object) -> TypeIs[int]" is not assignable to type "(object) -> TypeGuard[int]"     Function return type "TypeIs[int]" is incompatible with type "TypeGuard[int]" -      "TypeIs[int]" is incompatible with "TypeGuard[int]" -      "bool" is incompatible with "TypeGuard[int]" (reportArgumentType) +      "TypeIs[int]" is not assignable to "TypeGuard[int]" +      "bool" is not assignable to "TypeGuard[int]" (reportArgumentType) narrowing_typeis.py:170:14 - error: Argument of type "(val: object) -> TypeGuard[int]" cannot be assigned to parameter "f" of type "(object) -> TypeIs[int]" in function "takes_typeis" -  Type "(val: object) -> TypeGuard[int]" is incompatible with type "(object) -> TypeIs[int]" +  Type "(val: object) -> TypeGuard[int]" is not assignable to type "(object) -> TypeIs[int]"     Function return type "TypeGuard[int]" is incompatible with type "TypeIs[int]" -      "TypeGuard[int]" is incompatible with "TypeIs[int]" -      "bool" is incompatible with "TypeIs[int]" (reportArgumentType) +      "TypeGuard[int]" is not assignable to "TypeIs[int]" +      "bool" is not assignable to "TypeIs[int]" (reportArgumentType) narrowing_typeis.py:191:18 - error: Argument of type "(val: object) -> TypeIs[bool]" cannot be assigned to parameter "f" of type "(object) -> TypeIs[int]" in function "takes_int_typeis" -  Type "(val: object) -> TypeIs[bool]" is incompatible with type "(object) -> TypeIs[int]" +  Type "(val: object) -> TypeIs[bool]" is not assignable to type "(object) -> TypeIs[int]"     Function return type "TypeIs[bool]" is incompatible with type "TypeIs[int]" -      "TypeIs[bool]" is incompatible with "TypeIs[int]" +      "TypeIs[bool]" is not assignable to "TypeIs[int]"         Type parameter "T@TypeIs" is invariant, but "bool" is not the same as "int" -      "bool" is incompatible with "TypeIs[int]" (reportArgumentType) +      "bool" is not assignable to "TypeIs[int]" (reportArgumentType) narrowing_typeis.py:195:27 - error: Return type of TypeIs ("str") is not consistent with value parameter type ("int") (reportGeneralTypeIssues) narrowing_typeis.py:199:45 - error: Return type of TypeIs ("list[int]") is not consistent with value parameter type ("list[object]") (reportGeneralTypeIssues) """ diff --git a/conformance/results/pyright/overloads_basic.toml b/conformance/results/pyright/overloads_basic.toml index a4f03e2f5..b4148bcc8 100644 --- a/conformance/results/pyright/overloads_basic.toml +++ b/conformance/results/pyright/overloads_basic.toml @@ -2,7 +2,7 @@ conformant = "Pass" output = """ overloads_basic.py:37:1 - error: No overloads for "__getitem__" match the provided arguments (reportCallIssue) overloads_basic.py:37:1 - error: Argument of type "Literal['']" cannot be assigned to parameter "__s" of type "slice" in function "__getitem__" -  "Literal['']" is incompatible with "slice" (reportArgumentType) +  "Literal['']" is not assignable to "slice" (reportArgumentType) overloads_basic.py:63:5 - error: "func1" is marked as overload, but additional overloads are missing (reportInconsistentOverload) overloads_basic.py:75:5 - error: "func2" is marked as overload, but no implementation is provided (reportNoOverloadImplementation) """ diff --git a/conformance/results/pyright/protocols_class_objects.toml b/conformance/results/pyright/protocols_class_objects.toml index 47e31dabf..2c3bfe0f6 100644 --- a/conformance/results/pyright/protocols_class_objects.toml +++ b/conformance/results/pyright/protocols_class_objects.toml @@ -2,27 +2,27 @@ conformant = "Pass" output = """ protocols_class_objects.py:29:5 - error: Argument of type "type[Proto]" cannot be assigned to parameter "cls" of type "type[Proto]" in function "fun"   "Proto" is not a concrete class type and cannot be assigned to type "type[Proto]" (reportArgumentType) -protocols_class_objects.py:34:7 - error: Expression of type "type[Proto]" is incompatible with declared type "type[Proto]" +protocols_class_objects.py:34:7 - error: Type "type[Proto]" is not assignable to declared type "type[Proto]"   "Proto" is not a concrete class type and cannot be assigned to type "type[Proto]" (reportAssignmentType) -protocols_class_objects.py:58:16 - error: Expression of type "type[ConcreteA]" is incompatible with declared type "ProtoA1" -  "type[type]" is incompatible with "type[ConcreteA]" -  "type[type]" is incompatible with "type[ConcreteA]" +protocols_class_objects.py:58:16 - error: Type "type[ConcreteA]" is not assignable to declared type "ProtoA1" +  "type[type]" is not assignable to "type[ConcreteA]" +  "type[type]" is not assignable to "type[ConcreteA]"   "method1" is an incompatible type -    Type "(self: ConcreteA, x: int) -> int" is incompatible with type "(x: int) -> int" +    Type "(self: ConcreteA, x: int) -> int" is not assignable to type "(x: int) -> int"       Parameter name mismatch: "x" versus "self"       Parameter 1: type "int" is incompatible with type "ConcreteA" -        "int" is incompatible with "ConcreteA" +        "int" is not assignable to "ConcreteA"       Extra parameter "x" (reportAssignmentType) -protocols_class_objects.py:74:16 - error: Expression of type "type[ConcreteB]" is incompatible with declared type "ProtoB1" +protocols_class_objects.py:74:16 - error: Type "type[ConcreteB]" is not assignable to declared type "ProtoB1"   "prop1" is an incompatible type -    "property" is incompatible with "int" (reportAssignmentType) -protocols_class_objects.py:104:16 - error: Expression of type "type[ConcreteC1]" is incompatible with declared type "ProtoC1" +    "property" is not assignable to "int" (reportAssignmentType) +protocols_class_objects.py:104:16 - error: Type "type[ConcreteC1]" is not assignable to declared type "ProtoC1"   "attr1" is defined as a ClassVar in protocol (reportAssignmentType) -protocols_class_objects.py:106:16 - error: Expression of type "type[ConcreteC2]" is incompatible with declared type "ProtoC1" +protocols_class_objects.py:106:16 - error: Type "type[ConcreteC2]" is not assignable to declared type "ProtoC1"   "attr1" is defined as a ClassVar in protocol (reportAssignmentType) -protocols_class_objects.py:107:16 - error: Expression of type "type[ConcreteC2]" is incompatible with declared type "ProtoC2" +protocols_class_objects.py:107:16 - error: Type "type[ConcreteC2]" is not assignable to declared type "ProtoC2"   "attr1" must be defined as a ClassVar to be compatible with protocol (reportAssignmentType) -protocols_class_objects.py:108:16 - error: Expression of type "type[ConcreteC3]" is incompatible with declared type "ProtoC1" +protocols_class_objects.py:108:16 - error: Type "type[ConcreteC3]" is not assignable to declared type "ProtoC1"   "attr1" is defined as a ClassVar in protocol (reportAssignmentType) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/protocols_definition.toml b/conformance/results/pyright/protocols_definition.toml index 23536ece6..c27a3753d 100644 --- a/conformance/results/pyright/protocols_definition.toml +++ b/conformance/results/pyright/protocols_definition.toml @@ -4,97 +4,99 @@ protocols_definition.py:30:12 - error: Argument of type "list[int]" cannot be as   "Literal[1]" is incompatible with protocol "SupportsClose"     "close" is not present (reportArgumentType) protocols_definition.py:67:14 - error: Instance or class variables within a Protocol class must be explicitly declared within the class body (reportGeneralTypeIssues) -protocols_definition.py:114:22 - error: Expression of type "Concrete2_Bad1" is incompatible with declared type "Template2" +protocols_definition.py:114:22 - error: Type "Concrete2_Bad1" is not assignable to declared type "Template2"   "Concrete2_Bad1" is incompatible with protocol "Template2"     "val1" is not present (reportAssignmentType) -protocols_definition.py:115:22 - error: Expression of type "Concrete2_Bad2" is incompatible with declared type "Template2" +protocols_definition.py:115:22 - error: Type "Concrete2_Bad2" is not assignable to declared type "Template2"   "Concrete2_Bad2" is incompatible with protocol "Template2"     "val1" is invariant because it is mutable     "val1" is an incompatible type     "val1" is defined as a ClassVar in protocol -      "Sequence[float]" is incompatible with "Sequence[int]" (reportAssignmentType) -protocols_definition.py:116:22 - error: Expression of type "Concrete2_Bad3" is incompatible with declared type "Template2" +      "Sequence[float]" is not assignable to "Sequence[int]" (reportAssignmentType) +protocols_definition.py:116:22 - error: Type "Concrete2_Bad3" is not assignable to declared type "Template2"   "Concrete2_Bad3" is incompatible with protocol "Template2"     "val1" is invariant because it is mutable     "val1" is an incompatible type     "val1" is defined as a ClassVar in protocol -      "list[int]" is incompatible with "Sequence[int]" (reportAssignmentType) -protocols_definition.py:117:22 - error: Expression of type "Concrete2_Bad4" is incompatible with declared type "Template2" +      "list[int]" is not assignable to "Sequence[int]" (reportAssignmentType) +protocols_definition.py:117:22 - error: Type "Concrete2_Bad4" is not assignable to declared type "Template2"   "Concrete2_Bad4" is incompatible with protocol "Template2"     "val1" is defined as a ClassVar in protocol (reportAssignmentType) -protocols_definition.py:156:22 - error: Expression of type "Concrete3_Bad1" is incompatible with declared type "Template3" +protocols_definition.py:156:22 - error: Type "Concrete3_Bad1" is not assignable to declared type "Template3"   "Concrete3_Bad1" is incompatible with protocol "Template3"     "val1" is not present (reportAssignmentType) -protocols_definition.py:157:22 - error: Expression of type "Concrete3_Bad2" is incompatible with declared type "Template3" +protocols_definition.py:157:22 - error: Type "Concrete3_Bad2" is not assignable to declared type "Template3"   "Concrete3_Bad2" is incompatible with protocol "Template3"     "val1" is not defined as a ClassVar in protocol (reportAssignmentType) -protocols_definition.py:158:22 - error: Expression of type "Concrete3_Bad3" is incompatible with declared type "Template3" +protocols_definition.py:158:22 - error: Type "Concrete3_Bad3" is not assignable to declared type "Template3"   "Concrete3_Bad3" is incompatible with protocol "Template3"     "val1" is invariant because it is mutable     "val1" is an incompatible type -      "property" is incompatible with "Sequence[int]" (reportAssignmentType) -protocols_definition.py:159:22 - error: Expression of type "Concrete3_Bad4" is incompatible with declared type "Template3" +      "property" is not assignable to "Sequence[int]" (reportAssignmentType) +protocols_definition.py:159:22 - error: Type "Concrete3_Bad4" is not assignable to declared type "Template3"   "Concrete3_Bad4" is incompatible with protocol "Template3"     "val1" is invariant because it is mutable     "val1" is an incompatible type -      "Sequence[float]" is incompatible with "Sequence[int]" (reportAssignmentType) -protocols_definition.py:160:22 - error: Expression of type "Concrete3_Bad5" is incompatible with declared type "Template3" +      "Sequence[float]" is not assignable to "Sequence[int]" (reportAssignmentType) +protocols_definition.py:160:22 - error: Type "Concrete3_Bad5" is not assignable to declared type "Template3"   "Concrete3_Bad5" is incompatible with protocol "Template3"     "val1" is invariant because it is mutable     "val1" is an incompatible type -      "list[int]" is incompatible with "Sequence[int]" (reportAssignmentType) -protocols_definition.py:218:22 - error: Expression of type "Concrete4_Bad1" is incompatible with declared type "Template4" +      "list[int]" is not assignable to "Sequence[int]" (reportAssignmentType) +protocols_definition.py:218:22 - error: Type "Concrete4_Bad1" is not assignable to declared type "Template4"   "Concrete4_Bad1" is incompatible with protocol "Template4"     "val1" is an incompatible type -      "function" is incompatible with "Sequence[float]" (reportAssignmentType) -protocols_definition.py:219:22 - error: Expression of type "Concrete4_Bad2" is incompatible with declared type "Template4" +      "function" is not assignable to "Sequence[float]" (reportAssignmentType) +protocols_definition.py:219:22 - error: Type "Concrete4_Bad2" is not assignable to declared type "Template4"   "Concrete4_Bad2" is incompatible with protocol "Template4"     "val1" is not present (reportAssignmentType) protocols_definition.py:276:17 - warning: Static methods should not take a "self" or "cls" parameter (reportSelfClsParameterName) -protocols_definition.py:285:22 - error: Expression of type "Concrete5_Bad1" is incompatible with declared type "Template5" +protocols_definition.py:285:22 - error: Type "Concrete5_Bad1" is not assignable to declared type "Template5"   "Concrete5_Bad1" is incompatible with protocol "Template5"     "method1" is an incompatible type -      Type "(a: Unknown, c: Unknown) -> int" is incompatible with type "(a: int, b: int) -> float" +      Type "(a: Unknown, c: Unknown) -> int" is not assignable to type "(a: int, b: int) -> float"         Parameter name mismatch: "b" versus "c" (reportAssignmentType) -protocols_definition.py:286:22 - error: Expression of type "Concrete5_Bad2" is incompatible with declared type "Template5" +protocols_definition.py:286:22 - error: Type "Concrete5_Bad2" is not assignable to declared type "Template5"   "Concrete5_Bad2" is incompatible with protocol "Template5"     "method1" is an incompatible type -      Type "(a: int, c: int) -> int" is incompatible with type "(a: int, b: int) -> float" +      Type "(a: int, c: int) -> int" is not assignable to type "(a: int, b: int) -> float"         Parameter name mismatch: "b" versus "c" (reportAssignmentType) -protocols_definition.py:287:22 - error: Expression of type "Concrete5_Bad3" is incompatible with declared type "Template5" +protocols_definition.py:287:22 - error: Type "Concrete5_Bad3" is not assignable to declared type "Template5"   "Concrete5_Bad3" is incompatible with protocol "Template5"     "method1" is an incompatible type -      Type "(*, a: int, b: int) -> float" is incompatible with type "(a: int, b: int) -> float" +      Type "(*, a: int, b: int) -> float" is not assignable to type "(a: int, b: int) -> float"         Function accepts too many positional parameters; expected 0 but received 2           Extra parameter "a"           Extra parameter "b" (reportAssignmentType) -protocols_definition.py:288:22 - error: Expression of type "Concrete5_Bad4" is incompatible with declared type "Template5" +protocols_definition.py:288:22 - error: Type "Concrete5_Bad4" is not assignable to declared type "Template5"   "Concrete5_Bad4" is incompatible with protocol "Template5"     "method1" is an incompatible type -      Type "(a: int, b: int, /) -> float" is incompatible with type "(a: int, b: int) -> float" +      Type "(a: int, b: int, /) -> float" is not assignable to type "(a: int, b: int) -> float"         Missing keyword parameter "a"         Missing keyword parameter "b"           Position-only parameter mismatch; parameter "a" is not position-only           Position-only parameter mismatch; parameter "b" is not position-only           Position-only parameter mismatch; expected 2 but received 0 (reportAssignmentType) -protocols_definition.py:289:22 - error: Expression of type "Concrete5_Bad5" is incompatible with declared type "Template5" +protocols_definition.py:289:22 - error: Type "Concrete5_Bad5" is not assignable to declared type "Template5"   "Concrete5_Bad5" is incompatible with protocol "Template5"     "method1" is an incompatible type -      Type "(self: Unknown, a: int, b: int) -> float" is incompatible with type "(a: int, b: int) -> float" +      Type "(self: Unknown, a: int, b: int) -> float" is not assignable to type "(a: int, b: int) -> float"         Parameter name mismatch: "a" versus "self"         Parameter name mismatch: "b" versus "a"         Extra parameter "b" (reportAssignmentType) -protocols_definition.py:339:22 - error: Expression of type "Concrete6_Bad1" is incompatible with declared type "Template6" +protocols_definition.py:339:22 - error: Type "Concrete6_Bad1" is not assignable to declared type "Template6"   "Concrete6_Bad1" is incompatible with protocol "Template6"     "val1" is an incompatible type       Property setter method is missing -        "Template6" is incompatible with "Concrete6_Bad1" (reportAssignmentType) -protocols_definition.py:340:22 - error: Expression of type "Concrete6_Bad2" is incompatible with declared type "Template6" +        "Template6" is not assignable to "Concrete6_Bad1" (reportAssignmentType) +protocols_definition.py:340:22 - error: Type "Concrete6_Bad2" is not assignable to declared type "Template6"   "Concrete6_Bad2" is incompatible with protocol "Template6" -    "val1" is writable in protocol (reportAssignmentType) -protocols_definition.py:341:22 - error: Expression of type "Concrete6_Bad3" is incompatible with declared type "Template6" +    "val1" is writable in protocol +    "val1" is not read-only in protocol (reportAssignmentType) +protocols_definition.py:341:22 - error: Type "Concrete6_Bad3" is not assignable to declared type "Template6"   "Concrete6_Bad3" is incompatible with protocol "Template6" -    "val1" is writable in protocol (reportAssignmentType) +    "val1" is writable in protocol +    "val1" is not read-only in protocol (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/protocols_explicit.toml b/conformance/results/pyright/protocols_explicit.toml index 4ee4fca06..cdb926916 100644 --- a/conformance/results/pyright/protocols_explicit.toml +++ b/conformance/results/pyright/protocols_explicit.toml @@ -2,13 +2,12 @@ conformant = "Pass" output = """ protocols_explicit.py:27:16 - error: Method "draw" cannot be called because it is abstract and unimplemented (reportAbstractUsage) protocols_explicit.py:56:32 - error: Cannot assign to attribute "rgb" for class "Point*" -  "str" is incompatible with "int" (reportAttributeAccessIssue) +  "str" is not assignable to "int" (reportAttributeAccessIssue) protocols_explicit.py:60:5 - error: Cannot instantiate abstract class "Point"   "RGB.intensity" is not implemented   "RGB.transparency" is not implemented (reportAbstractUsage) protocols_explicit.py:85:14 - error: Cannot assign to attribute "cm1" for class "Concrete1*" -  Attribute "cm1" cannot be assigned through a class instance because it is a ClassVar -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  Attribute "cm1" cannot be assigned through a class instance because it is a ClassVar (reportAttributeAccessIssue) protocols_explicit.py:135:6 - error: Cannot instantiate abstract class "Concrete5"   "Proto5.method1" is not implemented (reportAbstractUsage) protocols_explicit.py:165:7 - error: Cannot instantiate abstract class "Concrete7A" diff --git a/conformance/results/pyright/protocols_generic.toml b/conformance/results/pyright/protocols_generic.toml index 6e653d432..d15dd1cea 100644 --- a/conformance/results/pyright/protocols_generic.toml +++ b/conformance/results/pyright/protocols_generic.toml @@ -1,43 +1,61 @@ -conformant = "Pass" +conformant = "Partial" +notes = """ +Incorrectly generates type violation for protocol that uses method-scoped type variables. +""" output = """ -protocols_generic.py:40:24 - error: Expression of type "Concrete1" is incompatible with declared type "Proto1[int, str]" +protocols_generic.py:40:24 - error: Type "Concrete1" is not assignable to declared type "Proto1[int, str]"   "Concrete1" is incompatible with protocol "Proto1[int, str]"     "method1" is an incompatible type -      Type "(x: str) -> str" is incompatible with type "(x: S@Proto1) -> S@Proto1" +      Type "(x: str) -> str" is not assignable to type "(x: S@Proto1) -> S@Proto1"         Parameter 1: type "S@Proto1" is incompatible with type "str" -          "int" is incompatible with "str" +          "int" is not assignable to "str"         Function return type "str" is incompatible with type "S@Proto1" -          Type "int | str" is incompatible with type "int" +          Type "int | str" is not assignable to type "int"     "__iter__" is an incompatible type ... (reportAssignmentType) protocols_generic.py:44:30 - error: Only one Generic[...] or Protocol[...] base class allowed (reportGeneralTypeIssues) -protocols_generic.py:56:20 - error: Expression of type "Box[float]" is incompatible with declared type "Box[int]" -  "Box[float]" is incompatible with "Box[int]" +protocols_generic.py:56:20 - error: Type "Box[float]" is not assignable to declared type "Box[int]" +  "Box[float]" is not assignable to "Box[int]"     Type parameter "T_co@Box" is covariant, but "float" is not a subtype of "int" -      "float" is incompatible with "int" (reportAssignmentType) -protocols_generic.py:66:25 - error: Expression of type "Sender[int]" is incompatible with declared type "Sender[float]" -  "Sender[int]" is incompatible with "Sender[float]" +      "float" is not assignable to "int" (reportAssignmentType) +protocols_generic.py:66:25 - error: Type "Sender[int]" is not assignable to declared type "Sender[float]" +  "Sender[int]" is not assignable to "Sender[float]"     Type parameter "T_contra@Sender" is contravariant, but "int" is not a supertype of "float" -      "float" is incompatible with "int" (reportAssignmentType) -protocols_generic.py:74:28 - error: Expression of type "AttrProto[int]" is incompatible with declared type "AttrProto[float]" -  "AttrProto[int]" is incompatible with "AttrProto[float]" +      "float" is not assignable to "int" (reportAssignmentType) +protocols_generic.py:74:28 - error: Type "AttrProto[int]" is not assignable to declared type "AttrProto[float]" +  "AttrProto[int]" is not assignable to "AttrProto[float]"     Type parameter "T@AttrProto" is invariant, but "int" is not the same as "float" (reportAssignmentType) -protocols_generic.py:75:26 - error: Expression of type "AttrProto[float]" is incompatible with declared type "AttrProto[int]" -  "AttrProto[float]" is incompatible with "AttrProto[int]" +protocols_generic.py:75:26 - error: Type "AttrProto[float]" is not assignable to declared type "AttrProto[int]" +  "AttrProto[float]" is not assignable to "AttrProto[int]"     Type parameter "T@AttrProto" is invariant, but "float" is not the same as "int" (reportAssignmentType) -protocols_generic.py:146:25 - error: Expression of type "ConcreteHasProperty3" is incompatible with declared type "HasPropertyProto" +protocols_generic.py:145:25 - error: Type "ConcreteHasProperty2" is not assignable to declared type "HasPropertyProto" +  "ConcreteHasProperty2" is incompatible with protocol "HasPropertyProto" +    "m" is an incompatible type +      Type "(item: int, callback: (int) -> str) -> str" is not assignable to type "(item: T@m, callback: (T@m) -> str) -> str" +        Parameter 1: type "T@m" is incompatible with type "int" +          "object*" is not assignable to "int" +        Parameter 2: type "(T@m) -> str" is incompatible with type "(int) -> str" +          Type "(T@m) -> str" is not assignable to type "(int) -> str" (reportAssignmentType) +protocols_generic.py:146:25 - error: Type "ConcreteHasProperty3" is not assignable to declared type "HasPropertyProto"   "ConcreteHasProperty3" is incompatible with protocol "HasPropertyProto"     "f" is an incompatible type -      Type "() -> int" is incompatible with type "() -> HasPropertyProto" +      Type "() -> int" is not assignable to type "() -> HasPropertyProto"         Function return type "int" is incompatible with type "HasPropertyProto" -          "int" is incompatible with protocol "HasPropertyProto" (reportAssignmentType) -protocols_generic.py:147:25 - error: Expression of type "ConcreteHasProperty4" is incompatible with declared type "HasPropertyProto" +          "int" is incompatible with protocol "HasPropertyProto" +    "m" is an incompatible type +      Type "(item: int, callback: (int) -> str) -> str" is not assignable to type "(item: T@m, callback: (T@m) -> str) -> str" +        Parameter 1: type "T@m" is incompatible with type "int" + ... (reportAssignmentType) +protocols_generic.py:147:25 - error: Type "ConcreteHasProperty4" is not assignable to declared type "HasPropertyProto"   "ConcreteHasProperty4" is incompatible with protocol "HasPropertyProto"     "m" is an incompatible type -      Type "(item: str, callback: (int) -> str) -> str" is incompatible with type "(item: T@m, callback: (T@m) -> str) -> str" +      Type "(item: str, callback: (int) -> str) -> str" is not assignable to type "(item: T@m, callback: (T@m) -> str) -> str" +        Parameter 1: type "T@m" is incompatible with type "str" +          "object*" is not assignable to "str"         Parameter 2: type "(T@m) -> str" is incompatible with type "(int) -> str" -          Type "(str) -> str" is incompatible with type "(int) -> str" (reportAssignmentType) +          Type "(T@m) -> str" is not assignable to type "(int) -> str" (reportAssignmentType) """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 145: Unexpected errors ['protocols_generic.py:145:25 - error: Type "ConcreteHasProperty2" is not assignable to declared type "HasPropertyProto"'] """ diff --git a/conformance/results/pyright/protocols_merging.toml b/conformance/results/pyright/protocols_merging.toml index cb43e377f..1baa74a77 100644 --- a/conformance/results/pyright/protocols_merging.toml +++ b/conformance/results/pyright/protocols_merging.toml @@ -1,18 +1,18 @@ conformant = "Pass" output = """ -protocols_merging.py:52:25 - error: Expression of type "SCConcrete2" is incompatible with declared type "SizedAndClosable1" +protocols_merging.py:52:25 - error: Type "SCConcrete2" is not assignable to declared type "SizedAndClosable1"   "SCConcrete2" is incompatible with protocol "SizedAndClosable1"     "__len__" is not present (reportAssignmentType) -protocols_merging.py:53:25 - error: Expression of type "SCConcrete2" is incompatible with declared type "SizedAndClosable2" +protocols_merging.py:53:25 - error: Type "SCConcrete2" is not assignable to declared type "SizedAndClosable2"   "SCConcrete2" is incompatible with protocol "SizedAndClosable2"     "__len__" is not present (reportAssignmentType) -protocols_merging.py:54:25 - error: Expression of type "SCConcrete2" is incompatible with declared type "SizedAndClosable3" -  "SCConcrete2" is incompatible with "SizedAndClosable3" (reportAssignmentType) -protocols_merging.py:67:16 - error: Protocol class "BadProto" cannot derive from non-protocol class "SizedAndClosable3" (reportGeneralTypeIssues) +protocols_merging.py:54:25 - error: Type "SCConcrete2" is not assignable to declared type "SizedAndClosable3" +  "SCConcrete2" is not assignable to "SizedAndClosable3" (reportAssignmentType) +protocols_merging.py:67:16 - error: Protocol class "BadProto" cannot derive from non-Protocol class "SizedAndClosable3" (reportGeneralTypeIssues) protocols_merging.py:82:5 - error: Cannot instantiate abstract class "SizedAndClosable4"   "SizedAndClosable4.close" is not implemented (reportAbstractUsage) -protocols_merging.py:83:24 - error: Expression of type "SCConcrete1" is incompatible with declared type "SizedAndClosable4" -  "SCConcrete1" is incompatible with "SizedAndClosable4" (reportAssignmentType) +protocols_merging.py:83:24 - error: Type "SCConcrete1" is not assignable to declared type "SizedAndClosable4" +  "SCConcrete1" is not assignable to "SizedAndClosable4" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/protocols_modules.toml b/conformance/results/pyright/protocols_modules.toml index 646b6ba13..570cd977d 100644 --- a/conformance/results/pyright/protocols_modules.toml +++ b/conformance/results/pyright/protocols_modules.toml @@ -1,15 +1,15 @@ conformant = "Pass" output = """ -protocols_modules.py:26:17 - error: Expression of type "Module("_protocols_modules1")" is incompatible with declared type "Options2" +protocols_modules.py:26:17 - error: Type "Module("_protocols_modules1")" is not assignable to declared type "Options2"   "timeout" is invariant because it is mutable   "timeout" is an incompatible type -    "int" is incompatible with "str" (reportAssignmentType) -protocols_modules.py:48:18 - error: Expression of type "Module("_protocols_modules2")" is incompatible with declared type "Reporter2" +    "int" is not assignable to "str" (reportAssignmentType) +protocols_modules.py:48:18 - error: Type "Module("_protocols_modules2")" is not assignable to declared type "Reporter2"   "on_error" is an incompatible type -    Type "(x: int) -> None" is incompatible with type "(x: int) -> int" +    Type "(x: int) -> None" is not assignable to type "(x: int) -> int"       Function return type "None" is incompatible with type "int" -        "None" is incompatible with "int" (reportAssignmentType) -protocols_modules.py:49:18 - error: Expression of type "Module("_protocols_modules2")" is incompatible with declared type "Reporter3" +        "None" is not assignable to "int" (reportAssignmentType) +protocols_modules.py:49:18 - error: Type "Module("_protocols_modules2")" is not assignable to declared type "Reporter3"   "not_implemented" is not present (reportAssignmentType) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/protocols_subtyping.toml b/conformance/results/pyright/protocols_subtyping.toml index a7b394f5e..84a70f745 100644 --- a/conformance/results/pyright/protocols_subtyping.toml +++ b/conformance/results/pyright/protocols_subtyping.toml @@ -1,37 +1,37 @@ conformant = "Pass" output = """ -protocols_subtyping.py:16:6 - error: Cannot instantiate protocol class "Proto1" (reportAbstractUsage) -protocols_subtyping.py:38:21 - error: Expression of type "Proto2" is incompatible with declared type "Concrete2" -  "Proto2" is incompatible with "Concrete2" (reportAssignmentType) -protocols_subtyping.py:55:18 - error: Expression of type "Proto2" is incompatible with declared type "Proto3" +protocols_subtyping.py:16:6 - error: Cannot instantiate Protocol class "Proto1" (reportAbstractUsage) +protocols_subtyping.py:38:21 - error: Type "Proto2" is not assignable to declared type "Concrete2" +  "Proto2" is not assignable to "Concrete2" (reportAssignmentType) +protocols_subtyping.py:55:18 - error: Type "Proto2" is not assignable to declared type "Proto3"   "Proto2" is incompatible with protocol "Proto3"     "method2" is not present (reportAssignmentType) -protocols_subtyping.py:79:30 - error: Expression of type "Proto5[int]" is incompatible with declared type "Proto4[int, float]" +protocols_subtyping.py:79:30 - error: Type "Proto5[int]" is not assignable to declared type "Proto4[int, float]"   "Proto5[int]" is incompatible with protocol "Proto4[int, float]"     "method1" is an incompatible type -      Type "(a: int, b: int) -> tuple[int, int]" is incompatible with type "(a: S@Proto4, b: T@Proto4) -> tuple[S@Proto4, T@Proto4]" +      Type "(a: int, b: int) -> tuple[int, int]" is not assignable to type "(a: S@Proto4, b: T@Proto4) -> tuple[S@Proto4, T@Proto4]"         Parameter 2: type "T@Proto4" is incompatible with type "int" -          "float" is incompatible with "int" (reportAssignmentType) -protocols_subtyping.py:80:25 - error: Expression of type "Proto4[int, int]" is incompatible with declared type "Proto5[float]" +          "float" is not assignable to "int" (reportAssignmentType) +protocols_subtyping.py:80:25 - error: Type "Proto4[int, int]" is not assignable to declared type "Proto5[float]"   "Proto4[int, int]" is incompatible with protocol "Proto5[float]"     "method1" is an incompatible type -      Type "(a: int, b: int) -> tuple[int, int]" is incompatible with type "(a: T@Proto5, b: T@Proto5) -> tuple[T@Proto5, T@Proto5]" +      Type "(a: int, b: int) -> tuple[int, int]" is not assignable to type "(a: T@Proto5, b: T@Proto5) -> tuple[T@Proto5, T@Proto5]"         Parameter 1: type "T@Proto5" is incompatible with type "int" -          "float" is incompatible with "int" +          "float" is not assignable to "int"         Parameter 2: type "T@Proto5" is incompatible with type "int" -          "float" is incompatible with "int" (reportAssignmentType) -protocols_subtyping.py:102:30 - error: Expression of type "Proto6[float, float]" is incompatible with declared type "Proto7[int, float]" +          "float" is not assignable to "int" (reportAssignmentType) +protocols_subtyping.py:102:30 - error: Type "Proto6[float, float]" is not assignable to declared type "Proto7[int, float]"   "Proto6[float, float]" is incompatible with protocol "Proto7[int, float]"     "method1" is an incompatible type -      Type "(a: float) -> Sequence[float]" is incompatible with type "(a: T_contra@Proto7) -> Sequence[S_co@Proto7]" +      Type "(a: float) -> Sequence[float]" is not assignable to type "(a: T_contra@Proto7) -> Sequence[S_co@Proto7]"         Function return type "Sequence[float]" is incompatible with type "Sequence[S_co@Proto7]" -          "Sequence[float]" is incompatible with "Sequence[S_co@Proto7]" (reportAssignmentType) -protocols_subtyping.py:103:33 - error: Expression of type "Proto6[float, float]" is incompatible with declared type "Proto7[float, object]" +          "Sequence[float]" is not assignable to "Sequence[S_co@Proto7]" (reportAssignmentType) +protocols_subtyping.py:103:33 - error: Type "Proto6[float, float]" is not assignable to declared type "Proto7[float, object]"   "Proto6[float, float]" is incompatible with protocol "Proto7[float, object]"     "method1" is an incompatible type -      Type "(a: float) -> Sequence[float]" is incompatible with type "(a: T_contra@Proto7) -> Sequence[S_co@Proto7]" +      Type "(a: float) -> Sequence[float]" is not assignable to type "(a: T_contra@Proto7) -> Sequence[S_co@Proto7]"         Parameter 1: type "T_contra@Proto7" is incompatible with type "float" -          "object" is incompatible with "float" (reportAssignmentType) +          "object" is not assignable to "float" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/protocols_variance.toml b/conformance/results/pyright/protocols_variance.toml index 041ce276a..108fd9d99 100644 --- a/conformance/results/pyright/protocols_variance.toml +++ b/conformance/results/pyright/protocols_variance.toml @@ -1,14 +1,14 @@ conformant = "Pass" output = """ -protocols_variance.py:21:7 - warning: Type variable "T1" used in generic protocol "AnotherBox" should be covariant (reportInvalidTypeVarUse) -protocols_variance.py:40:7 - warning: Type variable "T3" used in generic protocol "Protocol2" should be contravariant (reportInvalidTypeVarUse) -protocols_variance.py:56:7 - warning: Type variable "T1" used in generic protocol "Protocol4" should be contravariant (reportInvalidTypeVarUse) -protocols_variance.py:61:7 - warning: Type variable "T1_co" used in generic protocol "Protocol5" should be contravariant (reportInvalidTypeVarUse) +protocols_variance.py:21:7 - warning: Type variable "T1" used in generic Protocol "AnotherBox" should be covariant (reportInvalidTypeVarUse) +protocols_variance.py:40:7 - warning: Type variable "T3" used in generic Protocol "Protocol2" should be contravariant (reportInvalidTypeVarUse) +protocols_variance.py:56:7 - warning: Type variable "T1" used in generic Protocol "Protocol4" should be contravariant (reportInvalidTypeVarUse) +protocols_variance.py:61:7 - warning: Type variable "T1_co" used in generic Protocol "Protocol5" should be contravariant (reportInvalidTypeVarUse) protocols_variance.py:62:22 - error: Covariant type variable cannot be used in parameter type (reportGeneralTypeIssues) -protocols_variance.py:66:7 - warning: Type variable "T1" used in generic protocol "Protocol6" should be covariant (reportInvalidTypeVarUse) -protocols_variance.py:71:7 - warning: Type variable "T1_contra" used in generic protocol "Protocol7" should be covariant (reportInvalidTypeVarUse) +protocols_variance.py:66:7 - warning: Type variable "T1" used in generic Protocol "Protocol6" should be covariant (reportInvalidTypeVarUse) +protocols_variance.py:71:7 - warning: Type variable "T1_contra" used in generic Protocol "Protocol7" should be covariant (reportInvalidTypeVarUse) protocols_variance.py:72:21 - error: Contravariant type variable cannot be used in return type (reportGeneralTypeIssues) -protocols_variance.py:104:7 - warning: Type variable "T1" used in generic protocol "Protocol12" should be covariant (reportInvalidTypeVarUse) +protocols_variance.py:104:7 - warning: Type variable "T1" used in generic Protocol "Protocol12" should be covariant (reportInvalidTypeVarUse) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/qualifiers_annotated.toml b/conformance/results/pyright/qualifiers_annotated.toml index 075ec44e2..b8c271f0e 100644 --- a/conformance/results/pyright/qualifiers_annotated.toml +++ b/conformance/results/pyright/qualifiers_annotated.toml @@ -5,27 +5,32 @@ qualifiers_annotated.py:44:17 - error: Expected class but received "tuple[tuple[ qualifiers_annotated.py:45:17 - error: List expression not allowed for this type argument (reportInvalidTypeForm) qualifiers_annotated.py:45:18 - error: Expected class but received "Generator[type[int], None, None]" (reportGeneralTypeIssues) qualifiers_annotated.py:46:17 - error: Expected class but received "dict[str, Unknown]" (reportGeneralTypeIssues) -qualifiers_annotated.py:46:17 - error: Dictionary expression not allowed in type annotation (reportInvalidTypeForm) +qualifiers_annotated.py:46:17 - error: Dictionary expression not allowed in type expression (reportInvalidTypeForm) qualifiers_annotated.py:46:24 - error: "b" is not defined (reportUndefinedVariable) qualifiers_annotated.py:47:17 - error: Call expression not allowed in type expression (reportInvalidTypeForm) -qualifiers_annotated.py:48:17 - error: List expression not allowed in type annotation +qualifiers_annotated.py:48:17 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) qualifiers_annotated.py:48:17 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) qualifiers_annotated.py:48:23 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues) -qualifiers_annotated.py:49:17 - error: Ternary expression not allowed in type annotation (reportInvalidTypeForm) +qualifiers_annotated.py:49:17 - error: Ternary expression not allowed in type expression (reportInvalidTypeForm) qualifiers_annotated.py:50:17 - error: "var1" is not defined (reportUndefinedVariable) qualifiers_annotated.py:51:17 - error: Expected class but received "Literal[True]" (reportGeneralTypeIssues) qualifiers_annotated.py:52:18 - error: Expected class but received "Literal[1]" (reportGeneralTypeIssues) -qualifiers_annotated.py:53:18 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) -qualifiers_annotated.py:54:18 - error: Type annotations cannot use format string literals (f-strings) (reportGeneralTypeIssues) +qualifiers_annotated.py:53:18 - error: Binary operator not allowed in type expression (reportInvalidTypeForm) +qualifiers_annotated.py:54:18 - error: Type expressions cannot use format string literals (f-strings) (reportGeneralTypeIssues) qualifiers_annotated.py:64:8 - error: Expected one type argument and one or more annotations for "Annotated" (reportInvalidTypeForm) -qualifiers_annotated.py:76:24 - error: Expression of type "type[Annotated]" is incompatible with declared type "type[Any]" (reportAssignmentType) -qualifiers_annotated.py:77:24 - error: Expression of type "type[Annotated]" is incompatible with declared type "type[Any]" (reportAssignmentType) -qualifiers_annotated.py:84:7 - error: Argument of type "type[Annotated]" cannot be assigned to parameter "x" of type "type[T@func4]" in function "func4" (reportArgumentType) -qualifiers_annotated.py:85:7 - error: Argument of type "type[Annotated]" cannot be assigned to parameter "x" of type "type[T@func4]" in function "func4" (reportArgumentType) +qualifiers_annotated.py:76:24 - error: Type "Annotated" is not assignable to declared type "type[Any]" +  "Annotated" is not assignable to "type[Any]" (reportAssignmentType) +qualifiers_annotated.py:77:24 - error: Type "SmallInt" is not assignable to declared type "type[Any]" +  "Annotated" is not assignable to "type[Any]" (reportAssignmentType) +qualifiers_annotated.py:84:7 - error: Argument of type "Annotated" cannot be assigned to parameter "x" of type "type[T@func4]" in function "func4" +  Type "Annotated" is not assignable to type "type[T@func4]" (reportArgumentType) +qualifiers_annotated.py:85:7 - error: Argument of type "SmallInt" cannot be assigned to parameter "x" of type "type[T@func4]" in function "func4" +  Type "Annotated" is not assignable to type "type[T@func4]" (reportArgumentType) qualifiers_annotated.py:91:1 - error: "Annotated" cannot be instantiated (reportCallIssue) -qualifiers_annotated.py:92:1 - error: "Annotated" cannot be instantiated (reportCallIssue) -qualifiers_annotated.py:93:1 - error: "Annotated" cannot be instantiated (reportCallIssue) +qualifiers_annotated.py:92:1 - error: Object of type "Annotated" is not callable +  Attribute "__call__" is unknown (reportCallIssue) +qualifiers_annotated.py:93:1 - error: Object of type "Annotated" is not callable (reportCallIssue) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/qualifiers_final_annotation.toml b/conformance/results/pyright/qualifiers_final_annotation.toml index d191ef3e1..7918a7498 100644 --- a/conformance/results/pyright/qualifiers_final_annotation.toml +++ b/conformance/results/pyright/qualifiers_final_annotation.toml @@ -6,24 +6,20 @@ qualifiers_final_annotation.py:34:5 - error: "ID2" is declared Final, but value qualifiers_final_annotation.py:38:5 - error: "ID3" is declared Final, but value is not assigned (reportGeneralTypeIssues) qualifiers_final_annotation.py:54:14 - error: Cannot assign to attribute "ID5" for class "ClassA*"   Attribute "ID5" cannot be assigned through a class instance because it is a ClassVar -  "ID5" is declared as Final and cannot be reassigned -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  "ID5" is declared as Final and cannot be reassigned (reportAttributeAccessIssue) qualifiers_final_annotation.py:62:19 - error: "Final" is not allowed in this context (reportInvalidTypeForm) qualifiers_final_annotation.py:63:19 - error: "Final" is not allowed in this context (reportInvalidTypeForm) qualifiers_final_annotation.py:63:32 - error: Cannot assign to attribute "id4" for class "ClassA*" -  "Literal[1]" is incompatible with "Final" (reportAttributeAccessIssue) +  "Literal[1]" is not assignable to "Final" (reportAttributeAccessIssue) qualifiers_final_annotation.py:65:14 - error: Cannot assign to attribute "ID7" for class "ClassA*"   Attribute "ID7" cannot be assigned through a class instance because it is a ClassVar -  "ID7" is declared as Final and cannot be reassigned -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  "ID7" is declared as Final and cannot be reassigned (reportAttributeAccessIssue) qualifiers_final_annotation.py:67:14 - error: Cannot assign to attribute "ID7" for class "ClassA*"   Attribute "ID7" cannot be assigned through a class instance because it is a ClassVar -  "ID7" is declared as Final and cannot be reassigned -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  "ID7" is declared as Final and cannot be reassigned (reportAttributeAccessIssue) qualifiers_final_annotation.py:71:1 - error: "RATE" is declared as Final and cannot be reassigned (reportGeneralTypeIssues) qualifiers_final_annotation.py:81:8 - error: Cannot assign to attribute "DEFAULT_ID" for class "type[ClassB]" -  "DEFAULT_ID" is declared as Final and cannot be reassigned -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  "DEFAULT_ID" is declared as Final and cannot be reassigned (reportAttributeAccessIssue) qualifiers_final_annotation.py:94:5 - error: "BORDER_WIDTH" cannot be redeclared because parent class "ClassC" declares it as Final (reportGeneralTypeIssues) qualifiers_final_annotation.py:107:22 - error: "Final" is not allowed in this context (reportInvalidTypeForm) qualifiers_final_annotation.py:108:19 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) @@ -32,9 +28,9 @@ qualifiers_final_annotation.py:121:14 - error: "Final" is not allowed in this co qualifiers_final_annotation.py:134:1 - error: Arguments missing for parameters "x", "y" (reportCallIssue) qualifiers_final_annotation.py:134:3 - error: No parameter named "a" (reportCallIssue) qualifiers_final_annotation.py:135:5 - error: Argument of type "Literal['']" cannot be assigned to parameter "x" of type "int" in function "__new__" -  "Literal['']" is incompatible with "int" (reportArgumentType) +  "Literal['']" is not assignable to "int" (reportArgumentType) qualifiers_final_annotation.py:135:11 - error: Argument of type "Literal['']" cannot be assigned to parameter "y" of type "int" in function "__new__" -  "Literal['']" is incompatible with "int" (reportArgumentType) +  "Literal['']" is not assignable to "int" (reportArgumentType) qualifiers_final_annotation.py:141:5 - error: "ID1" is declared as Final and cannot be reassigned (reportGeneralTypeIssues) qualifiers_final_annotation.py:145:5 - error: "x" is declared as Final and cannot be reassigned (reportGeneralTypeIssues) qualifiers_final_annotation.py:147:10 - error: "x" is declared as Final and cannot be reassigned (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/specialtypes_never.toml b/conformance/results/pyright/specialtypes_never.toml index b72b75c74..d4e0cc4df 100644 --- a/conformance/results/pyright/specialtypes_never.toml +++ b/conformance/results/pyright/specialtypes_never.toml @@ -1,12 +1,12 @@ conformant = "Pass" output = """ specialtypes_never.py:19:22 - error: Function with declared return type "NoReturn" cannot return "None" (reportReturnType) -specialtypes_never.py:86:21 - error: Expression of type "list[Never]" is incompatible with declared type "list[int]" -  "list[Never]" is incompatible with "list[int]" +specialtypes_never.py:86:21 - error: Type "list[Never]" is not assignable to declared type "list[int]" +  "list[Never]" is not assignable to "list[int]"     Type parameter "_T@list" is invariant, but "Never" is not the same as "int"     Consider switching from "list" to "Sequence" which is covariant (reportAssignmentType) -specialtypes_never.py:105:12 - error: Expression of type "ClassC[Never]" is incompatible with return type "ClassC[U@func10]" -  "ClassC[Never]" is incompatible with "ClassC[U@func10]" +specialtypes_never.py:105:12 - error: Type "ClassC[Never]" is not assignable to return type "ClassC[U@func10]" +  "ClassC[Never]" is not assignable to "ClassC[U@func10]"     Type parameter "T@ClassC" is invariant, but "Never" is not the same as "U@func10" (reportReturnType) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/specialtypes_none.toml b/conformance/results/pyright/specialtypes_none.toml index fe9033f6f..94561c886 100644 --- a/conformance/results/pyright/specialtypes_none.toml +++ b/conformance/results/pyright/specialtypes_none.toml @@ -1,12 +1,12 @@ conformant = "Pass" output = """ specialtypes_none.py:21:7 - error: Argument of type "type[None]" cannot be assigned to parameter "val1" of type "None" in function "func1" -  "type[type]" is incompatible with "type[None]" (reportArgumentType) -specialtypes_none.py:27:19 - error: Expression of type "None" is incompatible with declared type "Iterable[Unknown]" +  "type[type]" is not assignable to "type[None]" (reportArgumentType) +specialtypes_none.py:27:19 - error: Type "None" is not assignable to declared type "Iterable[Unknown]"   "None" is incompatible with protocol "Iterable[Unknown]"     "__iter__" is not present (reportAssignmentType) specialtypes_none.py:41:7 - error: Argument of type "None" cannot be assigned to parameter "val1" of type "type[None]" in function "func2" -  Type "None" is incompatible with type "type[None]" (reportArgumentType) +  Type "None" is not assignable to type "type[None]" (reportArgumentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/specialtypes_type.toml b/conformance/results/pyright/specialtypes_type.toml index b0b336860..904c541a0 100644 --- a/conformance/results/pyright/specialtypes_type.toml +++ b/conformance/results/pyright/specialtypes_type.toml @@ -1,11 +1,11 @@ conformant = "Pass" output = """ specialtypes_type.py:56:7 - error: Argument of type "type[TeamUser]" cannot be assigned to parameter "user_class" of type "type[BasicUser] | type[ProUser]" in function "func4" -  Type "type[TeamUser]" is incompatible with type "type[BasicUser] | type[ProUser]" -    "type[TeamUser]" is incompatible with "type[BasicUser]" -    Type "type[TeamUser]" is incompatible with type "type[BasicUser]" -    "type[TeamUser]" is incompatible with "type[ProUser]" -    Type "type[TeamUser]" is incompatible with type "type[ProUser]" (reportArgumentType) +  Type "type[TeamUser]" is not assignable to type "type[BasicUser] | type[ProUser]" +    "type[TeamUser]" is not assignable to "type[BasicUser]" +    Type "type[TeamUser]" is not assignable to type "type[BasicUser]" +    "type[TeamUser]" is not assignable to "type[ProUser]" +    Type "type[TeamUser]" is not assignable to type "type[ProUser]" (reportArgumentType) specialtypes_type.py:70:7 - error: Argument of type "type[Callable]" cannot be assigned to parameter "x" of type "type[T@func5]" in function "func5" (reportArgumentType) specialtypes_type.py:76:22 - error: Too many type arguments provided for "type"; expected 1 but received 2 (reportInvalidTypeForm) specialtypes_type.py:117:7 - error: Cannot access attribute "unknown" for class "type[object]" diff --git a/conformance/results/pyright/tuples_type_compat.toml b/conformance/results/pyright/tuples_type_compat.toml index 184606a6b..02eac2977 100644 --- a/conformance/results/pyright/tuples_type_compat.toml +++ b/conformance/results/pyright/tuples_type_compat.toml @@ -1,47 +1,47 @@ conformant = "Pass" output = """ -tuples_type_compat.py:15:27 - error: Expression of type "tuple[float, complex]" is incompatible with declared type "tuple[int, int]" -  "tuple[float, complex]" is incompatible with "tuple[int, int]" +tuples_type_compat.py:15:27 - error: Type "tuple[float, complex]" is not assignable to declared type "tuple[int, int]" +  "tuple[float, complex]" is not assignable to "tuple[int, int]"     Tuple entry 1 is incorrect type -      "float" is incompatible with "int" (reportAssignmentType) -tuples_type_compat.py:29:10 - error: Expression of type "tuple[int, ...]" is incompatible with declared type "tuple[int, *tuple[int, ...]]" -  "tuple[int, ...]" is incompatible with "tuple[int, *tuple[int, ...]]" +      "float" is not assignable to "int" (reportAssignmentType) +tuples_type_compat.py:29:10 - error: Type "tuple[int, ...]" is not assignable to declared type "tuple[int, *tuple[int, ...]]" +  "tuple[int, ...]" is not assignable to "tuple[int, *tuple[int, ...]]"     Tuple size mismatch; expected 1 or more but received indeterminate (reportAssignmentType) -tuples_type_compat.py:32:10 - error: Expression of type "tuple[int, *tuple[int, ...]]" is incompatible with declared type "tuple[int]" -  "tuple[int, *tuple[int, ...]]" is incompatible with "tuple[int]" +tuples_type_compat.py:32:10 - error: Type "tuple[int, *tuple[int, ...]]" is not assignable to declared type "tuple[int]" +  "tuple[int, *tuple[int, ...]]" is not assignable to "tuple[int]"     Tuple size mismatch; expected 1 but received indeterminate (reportAssignmentType) -tuples_type_compat.py:33:10 - error: Expression of type "tuple[int, ...]" is incompatible with declared type "tuple[int]" -  "tuple[int, ...]" is incompatible with "tuple[int]" +tuples_type_compat.py:33:10 - error: Type "tuple[int, ...]" is not assignable to declared type "tuple[int]" +  "tuple[int, ...]" is not assignable to "tuple[int]"     Tuple size mismatch; expected 1 but received indeterminate (reportAssignmentType) -tuples_type_compat.py:43:22 - error: Expression of type "tuple[int, ...]" is incompatible with declared type "tuple[int]" -  "tuple[int, ...]" is incompatible with "tuple[int]" +tuples_type_compat.py:43:22 - error: Type "tuple[int, ...]" is not assignable to declared type "tuple[int]" +  "tuple[int, ...]" is not assignable to "tuple[int]"     Tuple size mismatch; expected 1 but received indeterminate (reportAssignmentType) -tuples_type_compat.py:62:26 - error: Expression of type "tuple[int, ...]" is incompatible with declared type "tuple[int, int]" -  "tuple[int, ...]" is incompatible with "tuple[int, int]" +tuples_type_compat.py:62:26 - error: Type "tuple[int, ...]" is not assignable to declared type "tuple[int, int]" +  "tuple[int, ...]" is not assignable to "tuple[int, int]"     Tuple size mismatch; expected 2 but received indeterminate (reportAssignmentType) -tuples_type_compat.py:144:6 - error: Expression of type "tuple[Literal[1], Literal[''], Literal['']]" is incompatible with declared type "tuple[int, str]" -  "tuple[Literal[1], Literal[''], Literal['']]" is incompatible with "tuple[int, str]" +tuples_type_compat.py:144:6 - error: Type "tuple[Literal[1], Literal[''], Literal['']]" is not assignable to declared type "tuple[int, str]" +  "tuple[Literal[1], Literal[''], Literal['']]" is not assignable to "tuple[int, str]"     Tuple size mismatch; expected 2 but received 3 (reportAssignmentType) -tuples_type_compat.py:149:10 - error: Expression of type "tuple[Literal[1], Literal[1], Literal['']]" is incompatible with declared type "tuple[int, *tuple[str, ...]]" -  "Literal[1]" is incompatible with "str" (reportAssignmentType) -tuples_type_compat.py:150:14 - error: Expression of type "tuple[Literal[1], Literal[''], Literal[1]]" is incompatible with declared type "tuple[int, *tuple[str, ...]]" -  "Literal[1]" is incompatible with "str" (reportAssignmentType) -tuples_type_compat.py:156:14 - error: Expression of type "tuple[Literal[1], Literal[''], Literal['']]" is incompatible with declared type "tuple[int, *tuple[str, ...], int]" -  "Literal['']" is incompatible with "int" (reportAssignmentType) -tuples_type_compat.py:157:18 - error: Expression of type "tuple[Literal[1], Literal[''], Literal[''], float]" is incompatible with declared type "tuple[int, *tuple[str, ...], int]" -  "float" is incompatible with "int" (reportAssignmentType) -tuples_type_compat.py:162:7 - error: Expression of type "tuple[Literal[1], Literal[''], Literal[1]]" is incompatible with declared type "tuple[*tuple[str, ...], int]" -  "Literal[1]" is incompatible with "str" (reportAssignmentType) -tuples_type_compat.py:163:15 - error: Expression of type "tuple[Literal[''], Literal[''], float]" is incompatible with declared type "tuple[*tuple[str, ...], int]" -  "float" is incompatible with "int" (reportAssignmentType) -tuples_type_compat.py:168:40 - error: Expression of type "tuple[str, str]" is incompatible with declared type "tuple[str, str, int]" -  "tuple[str, str]" is incompatible with "tuple[str, str, int]" +tuples_type_compat.py:149:10 - error: Type "tuple[Literal[1], Literal[1], Literal['']]" is not assignable to declared type "tuple[int, *tuple[str, ...]]" +  "Literal[1]" is not assignable to "str" (reportAssignmentType) +tuples_type_compat.py:150:14 - error: Type "tuple[Literal[1], Literal[''], Literal[1]]" is not assignable to declared type "tuple[int, *tuple[str, ...]]" +  "Literal[1]" is not assignable to "str" (reportAssignmentType) +tuples_type_compat.py:156:14 - error: Type "tuple[Literal[1], Literal[''], Literal['']]" is not assignable to declared type "tuple[int, *tuple[str, ...], int]" +  "Literal['']" is not assignable to "int" (reportAssignmentType) +tuples_type_compat.py:157:18 - error: Type "tuple[Literal[1], Literal[''], Literal[''], float]" is not assignable to declared type "tuple[int, *tuple[str, ...], int]" +  "float" is not assignable to "int" (reportAssignmentType) +tuples_type_compat.py:162:7 - error: Type "tuple[Literal[1], Literal[''], Literal[1]]" is not assignable to declared type "tuple[*tuple[str, ...], int]" +  "Literal[1]" is not assignable to "str" (reportAssignmentType) +tuples_type_compat.py:163:15 - error: Type "tuple[Literal[''], Literal[''], float]" is not assignable to declared type "tuple[*tuple[str, ...], int]" +  "float" is not assignable to "int" (reportAssignmentType) +tuples_type_compat.py:168:40 - error: Type "tuple[str, str]" is not assignable to declared type "tuple[str, str, int]" +  "tuple[str, str]" is not assignable to "tuple[str, str, int]"     Tuple size mismatch; expected 3 but received 2 (reportAssignmentType) -tuples_type_compat.py:171:50 - error: Expression of type "tuple[str, str]" is incompatible with declared type "tuple[str, str, str, *tuple[str, ...]]" -  "tuple[str, str]" is incompatible with "tuple[str, str, str, *tuple[str, ...]]" +tuples_type_compat.py:171:50 - error: Type "tuple[str, str]" is not assignable to declared type "tuple[str, str, str, *tuple[str, ...]]" +  "tuple[str, str]" is not assignable to "tuple[str, str, str, *tuple[str, ...]]"     Tuple size mismatch; expected 3 or more but received 2 (reportAssignmentType) -tuples_type_compat.py:175:50 - error: Expression of type "tuple[str, str]" is incompatible with declared type "tuple[*tuple[str, ...], str, str, str]" -  "tuple[str, str]" is incompatible with "tuple[*tuple[str, ...], str, str, str]" +tuples_type_compat.py:175:50 - error: Type "tuple[str, str]" is not assignable to declared type "tuple[*tuple[str, ...], str, str, str]" +  "tuple[str, str]" is not assignable to "tuple[*tuple[str, ...], str, str, str]"     Tuple size mismatch; expected 3 or more but received 2 (reportAssignmentType) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/tuples_type_form.toml b/conformance/results/pyright/tuples_type_form.toml index 2bc7070ac..ca0d3792f 100644 --- a/conformance/results/pyright/tuples_type_form.toml +++ b/conformance/results/pyright/tuples_type_form.toml @@ -1,18 +1,18 @@ conformant = "Pass" output = """ -tuples_type_form.py:12:6 - error: Expression of type "tuple[Literal[1], Literal[2]]" is incompatible with declared type "tuple[int]" -  "tuple[Literal[1], Literal[2]]" is incompatible with "tuple[int]" +tuples_type_form.py:12:6 - error: Type "tuple[Literal[1], Literal[2]]" is not assignable to declared type "tuple[int]" +  "tuple[Literal[1], Literal[2]]" is not assignable to "tuple[int]"     Tuple size mismatch; expected 1 but received 2 (reportAssignmentType) -tuples_type_form.py:14:6 - error: Expression of type "tuple[Literal[1]]" is incompatible with declared type "tuple[int, int]" -  "tuple[Literal[1]]" is incompatible with "tuple[int, int]" +tuples_type_form.py:14:6 - error: Type "tuple[Literal[1]]" is not assignable to declared type "tuple[int, int]" +  "tuple[Literal[1]]" is not assignable to "tuple[int, int]"     Tuple size mismatch; expected 2 but received 1 (reportAssignmentType) -tuples_type_form.py:15:10 - error: Expression of type "tuple[Literal[1], Literal['']]" is incompatible with declared type "tuple[int, int]" -  "Literal['']" is incompatible with "int" (reportAssignmentType) -tuples_type_form.py:25:7 - error: Expression of type "tuple[Literal[1]]" is incompatible with declared type "tuple[()]" -  "tuple[Literal[1]]" is incompatible with "tuple[()]" +tuples_type_form.py:15:10 - error: Type "tuple[Literal[1], Literal['']]" is not assignable to declared type "tuple[int, int]" +  "Literal['']" is not assignable to "int" (reportAssignmentType) +tuples_type_form.py:25:7 - error: Type "tuple[Literal[1]]" is not assignable to declared type "tuple[()]" +  "tuple[Literal[1]]" is not assignable to "tuple[()]"     Tuple size mismatch; expected 0 but received 1 (reportAssignmentType) -tuples_type_form.py:36:17 - error: Expression of type "tuple[Literal[1], Literal[2], Literal[3], Literal['']]" is incompatible with declared type "tuple[int, ...]" -  "Literal['']" is incompatible with "int" (reportAssignmentType) +tuples_type_form.py:36:17 - error: Type "tuple[Literal[1], Literal[2], Literal[3], Literal['']]" is not assignable to declared type "tuple[int, ...]" +  "Literal['']" is not assignable to "int" (reportAssignmentType) tuples_type_form.py:40:22 - error: "..." is allowed only as the second of two arguments (reportInvalidTypeForm) tuples_type_form.py:41:12 - error: "..." is allowed only as the second of two arguments (reportInvalidTypeForm) tuples_type_form.py:42:12 - error: "..." is allowed only as the second of two arguments (reportInvalidTypeForm) diff --git a/conformance/results/pyright/typeddicts_alt_syntax.toml b/conformance/results/pyright/typeddicts_alt_syntax.toml index ed85c45e0..8137309ea 100644 --- a/conformance/results/pyright/typeddicts_alt_syntax.toml +++ b/conformance/results/pyright/typeddicts_alt_syntax.toml @@ -4,8 +4,8 @@ typeddicts_alt_syntax.py:23:17 - error: Expected dict or keyword parameter as se typeddicts_alt_syntax.py:27:45 - error: Expected string literal for dictionary entry name (reportGeneralTypeIssues) typeddicts_alt_syntax.py:31:1 - error: TypedDict must be assigned to a variable named "WrongName" (reportGeneralTypeIssues) typeddicts_alt_syntax.py:35:78 - error: Extra TypedDict arguments not supported (reportCallIssue) -typeddicts_alt_syntax.py:45:43 - error: Expression of type "dict[str, str]" is incompatible with declared type "Movie2" -  "Literal['']" is incompatible with "int" (reportAssignmentType) +typeddicts_alt_syntax.py:45:43 - error: Type "dict[str, str]" is not assignable to declared type "Movie2" +  "Literal['']" is not assignable to "int" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/typeddicts_operations.toml b/conformance/results/pyright/typeddicts_operations.toml index f98bba88d..9eae54519 100644 --- a/conformance/results/pyright/typeddicts_operations.toml +++ b/conformance/results/pyright/typeddicts_operations.toml @@ -1,20 +1,20 @@ conformant = "Pass" output = """ typeddicts_operations.py:22:1 - error: Could not assign item in TypedDict -  "Literal[1982]" is incompatible with "str" (reportGeneralTypeIssues) +  "Literal[1982]" is not assignable to "str" (reportGeneralTypeIssues) typeddicts_operations.py:23:1 - error: Could not assign item in TypedDict -  "Literal['']" is incompatible with "int" (reportGeneralTypeIssues) +  "Literal['']" is not assignable to "int" (reportGeneralTypeIssues) typeddicts_operations.py:24:1 - error: Could not assign item in TypedDict   "other" is not a defined key in "Movie" (reportGeneralTypeIssues) typeddicts_operations.py:26:7 - error: Could not access item in TypedDict   "other" is not a defined key in "Movie" (reportGeneralTypeIssues) -typeddicts_operations.py:28:9 - error: Expression of type "dict[str, str]" is incompatible with declared type "Movie" +typeddicts_operations.py:28:9 - error: Type "dict[str, str]" is not assignable to declared type "Movie"   "year" is required in "Movie" (reportAssignmentType) -typeddicts_operations.py:29:42 - error: Expression of type "dict[str, str | float]" is incompatible with declared type "Movie" -  "float" is incompatible with "int" (reportAssignmentType) -typeddicts_operations.py:32:36 - error: Expression of type "dict[str, str | int]" is incompatible with declared type "Movie" +typeddicts_operations.py:29:42 - error: Type "dict[str, str | float]" is not assignable to declared type "Movie" +  "float" is not assignable to "int" (reportAssignmentType) +typeddicts_operations.py:32:36 - error: Type "dict[str, str | int]" is not assignable to declared type "Movie"   "other" is an undefined item in type "Movie" (reportAssignmentType) -typeddicts_operations.py:37:20 - error: Expression of type "dict[str, str | int]" is incompatible with declared type "Movie" (reportAssignmentType) +typeddicts_operations.py:37:20 - error: Type "dict[str, str | int]" is not assignable to declared type "Movie" (reportAssignmentType) typeddicts_operations.py:47:7 - error: Cannot access attribute "clear" for class "Movie"   Attribute "clear" is unknown (reportAttributeAccessIssue) typeddicts_operations.py:49:5 - error: Could not delete item in TypedDict diff --git a/conformance/results/pyright/typeddicts_readonly_consistency.toml b/conformance/results/pyright/typeddicts_readonly_consistency.toml index c295c4779..bb53197cc 100644 --- a/conformance/results/pyright/typeddicts_readonly_consistency.toml +++ b/conformance/results/pyright/typeddicts_readonly_consistency.toml @@ -1,20 +1,20 @@ conformant = "Pass" output = """ -typeddicts_readonly_consistency.py:37:14 - error: Expression of type "A1" is incompatible with declared type "B1" +typeddicts_readonly_consistency.py:37:14 - error: Type "A1" is not assignable to declared type "B1"   "y" is missing from "A1" (reportAssignmentType) -typeddicts_readonly_consistency.py:38:14 - error: Expression of type "C1" is incompatible with declared type "B1" +typeddicts_readonly_consistency.py:38:14 - error: Type "C1" is not assignable to declared type "B1"   "y" is not read-only in "B1" (reportAssignmentType) -typeddicts_readonly_consistency.py:40:14 - error: Expression of type "A1" is incompatible with declared type "C1" +typeddicts_readonly_consistency.py:40:14 - error: Type "A1" is not assignable to declared type "C1"   "y" is an incompatible type -    "object" is incompatible with "str" (reportAssignmentType) -typeddicts_readonly_consistency.py:81:14 - error: Expression of type "A2" is incompatible with declared type "B2" +    "object" is not assignable to "str" (reportAssignmentType) +typeddicts_readonly_consistency.py:81:14 - error: Type "A2" is not assignable to declared type "B2"   "x" is not read-only in "B2" (reportAssignmentType) -typeddicts_readonly_consistency.py:82:14 - error: Expression of type "C2" is incompatible with declared type "B2" +typeddicts_readonly_consistency.py:82:14 - error: Type "C2" is not assignable to declared type "B2"   "x" is not required in "B2" (reportAssignmentType) -typeddicts_readonly_consistency.py:84:14 - error: Expression of type "A2" is incompatible with declared type "C2" +typeddicts_readonly_consistency.py:84:14 - error: Type "A2" is not assignable to declared type "C2"   "x" is required in "C2"   "x" is not read-only in "C2" (reportAssignmentType) -typeddicts_readonly_consistency.py:85:14 - error: Expression of type "B2" is incompatible with declared type "C2" +typeddicts_readonly_consistency.py:85:14 - error: Type "B2" is not assignable to declared type "C2"   "x" is required in "C2" (reportAssignmentType) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/typeddicts_readonly_inheritance.toml b/conformance/results/pyright/typeddicts_readonly_inheritance.toml index a77014bc5..d9e432b89 100644 --- a/conformance/results/pyright/typeddicts_readonly_inheritance.toml +++ b/conformance/results/pyright/typeddicts_readonly_inheritance.toml @@ -3,16 +3,16 @@ output = """ typeddicts_readonly_inheritance.py:36:1 - error: Could not assign item in TypedDict   "name" is a read-only key in "Album2" (reportTypedDictNotRequiredAccess) typeddicts_readonly_inheritance.py:50:5 - error: "alt" overrides symbol of same name in class "AlbumCollection" -  "list[str]" is incompatible with "list[str | int]" +  "list[str]" is not assignable to "list[str | int]"     Type parameter "_T@list" is invariant, but "str" is not the same as "str | int"     Consider switching from "list" to "Sequence" which is covariant (reportIncompatibleVariableOverride) -typeddicts_readonly_inheritance.py:65:19 - error: Expression of type "dict[Any, Any]" is incompatible with declared type "RequiredName" +typeddicts_readonly_inheritance.py:65:19 - error: Type "dict[Any, Any]" is not assignable to declared type "RequiredName"   "name" is required in "RequiredName" (reportAssignmentType) typeddicts_readonly_inheritance.py:82:1 - error: Could not assign item in TypedDict -  "Literal[3]" is incompatible with "str" (reportGeneralTypeIssues) -typeddicts_readonly_inheritance.py:83:15 - error: Expression of type "dict[str, int]" is incompatible with declared type "User" -  "Literal[3]" is incompatible with "str" (reportAssignmentType) -typeddicts_readonly_inheritance.py:84:5 - error: Expression of type "dict[Any, Any]" is incompatible with declared type "User" +  "Literal[3]" is not assignable to "str" (reportGeneralTypeIssues) +typeddicts_readonly_inheritance.py:83:15 - error: Type "dict[str, int]" is not assignable to declared type "User" +  "Literal[3]" is not assignable to "str" (reportAssignmentType) +typeddicts_readonly_inheritance.py:84:5 - error: Type "dict[Any, Any]" is not assignable to declared type "User"   "ident" is required in "User" (reportAssignmentType) typeddicts_readonly_inheritance.py:94:5 - error: TypedDict item "a" cannot be redefined as ReadOnly (reportGeneralTypeIssues) typeddicts_readonly_inheritance.py:98:5 - error: TypedDict item "a" cannot be redefined as NotRequired (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/typeddicts_readonly_update.toml b/conformance/results/pyright/typeddicts_readonly_update.toml index 405e1acca..650894094 100644 --- a/conformance/results/pyright/typeddicts_readonly_update.toml +++ b/conformance/results/pyright/typeddicts_readonly_update.toml @@ -3,7 +3,7 @@ output = """ typeddicts_readonly_update.py:23:1 - error: No overloads for "update" match the provided arguments (reportCallIssue) typeddicts_readonly_update.py:23:11 - error: Argument of type "A" cannot be assigned to parameter "__m" of type "Partial[A]" in function "update"   "x" is an incompatible type -    Type "int" is incompatible with type "Never" (reportArgumentType) +    Type "int" is not assignable to type "Never" (reportArgumentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/typeddicts_required.toml b/conformance/results/pyright/typeddicts_required.toml index 434466a4b..9f041f9fc 100644 --- a/conformance/results/pyright/typeddicts_required.toml +++ b/conformance/results/pyright/typeddicts_required.toml @@ -2,7 +2,7 @@ conformant = "Pass" output = """ typeddicts_required.py:12:8 - error: "Required" is not allowed in this context (reportInvalidTypeForm) typeddicts_required.py:15:18 - error: Cannot assign to attribute "x" for class "NotTypedDict*" -  "int" is incompatible with "Required[int]" (reportAttributeAccessIssue) +  "int" is not assignable to "Required" (reportAttributeAccessIssue) typeddicts_required.py:19:8 - error: "NotRequired" is not allowed in this context (reportInvalidTypeForm) typeddicts_required.py:62:8 - error: "Required" is not allowed in this context (reportInvalidTypeForm) typeddicts_required.py:63:8 - error: "Required" is not allowed in this context (reportInvalidTypeForm) diff --git a/conformance/results/pyright/typeddicts_type_consistency.toml b/conformance/results/pyright/typeddicts_type_consistency.toml index dcda72179..328b8b937 100644 --- a/conformance/results/pyright/typeddicts_type_consistency.toml +++ b/conformance/results/pyright/typeddicts_type_consistency.toml @@ -1,27 +1,27 @@ conformant = "Pass" output = """ -typeddicts_type_consistency.py:21:10 - error: Expression of type "B1" is incompatible with declared type "A1" +typeddicts_type_consistency.py:21:10 - error: Type "B1" is not assignable to declared type "A1"   "x" is an incompatible type -    Type "int" is incompatible with type "int | None" -      "int" is incompatible with "None" (reportAssignmentType) -typeddicts_type_consistency.py:38:10 - error: Expression of type "B2" is incompatible with declared type "A2" +    Type "int" is not assignable to type "int | None" +      "int" is not assignable to "None" (reportAssignmentType) +typeddicts_type_consistency.py:38:10 - error: Type "B2" is not assignable to declared type "A2"   "x" is not required in "A2" (reportAssignmentType) -typeddicts_type_consistency.py:65:6 - error: Expression of type "A3" is incompatible with declared type "B3" +typeddicts_type_consistency.py:65:6 - error: Type "A3" is not assignable to declared type "B3"   "y" is missing from "A3" (reportAssignmentType) -typeddicts_type_consistency.py:69:21 - error: Expression of type "dict[str, int]" is incompatible with declared type "A3" +typeddicts_type_consistency.py:69:21 - error: Type "dict[str, int]" is not assignable to declared type "A3"   "y" is an undefined item in type "A3" (reportAssignmentType) -typeddicts_type_consistency.py:76:22 - error: Expression of type "B3" is incompatible with declared type "dict[str, int]" -  "B3" is incompatible with "dict[str, int]" (reportAssignmentType) -typeddicts_type_consistency.py:77:25 - error: Expression of type "B3" is incompatible with declared type "dict[str, object]" -  "B3" is incompatible with "dict[str, object]" (reportAssignmentType) -typeddicts_type_consistency.py:78:22 - error: Expression of type "B3" is incompatible with declared type "dict[Any, Any]" -  "B3" is incompatible with "dict[Any, Any]" (reportAssignmentType) -typeddicts_type_consistency.py:82:25 - error: Expression of type "B3" is incompatible with declared type "Mapping[str, int]" -  "B3" is incompatible with "Mapping[str, int]" +typeddicts_type_consistency.py:76:22 - error: Type "B3" is not assignable to declared type "dict[str, int]" +  "B3" is not assignable to "dict[str, int]" (reportAssignmentType) +typeddicts_type_consistency.py:77:25 - error: Type "B3" is not assignable to declared type "dict[str, object]" +  "B3" is not assignable to "dict[str, object]" (reportAssignmentType) +typeddicts_type_consistency.py:78:22 - error: Type "B3" is not assignable to declared type "dict[Any, Any]" +  "B3" is not assignable to "dict[Any, Any]" (reportAssignmentType) +typeddicts_type_consistency.py:82:25 - error: Type "B3" is not assignable to declared type "Mapping[str, int]" +  "B3" is not assignable to "Mapping[str, int]"     Type parameter "_VT_co@Mapping" is covariant, but "object" is not a subtype of "int" -      "object" is incompatible with "int" (reportAssignmentType) -typeddicts_type_consistency.py:126:56 - error: Expression of type "dict[str, dict[str, dict[str, int]]]" is incompatible with declared type "Outer1" -  "Literal[1]" is incompatible with "str" (reportAssignmentType) +      "object" is not assignable to "int" (reportAssignmentType) +typeddicts_type_consistency.py:126:56 - error: Type "dict[str, dict[str, dict[str, int]]]" is not assignable to declared type "Outer1" +  "Literal[1]" is not assignable to "str" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/typeddicts_usage.toml b/conformance/results/pyright/typeddicts_usage.toml index 447d0ad07..ce846f1dd 100644 --- a/conformance/results/pyright/typeddicts_usage.toml +++ b/conformance/results/pyright/typeddicts_usage.toml @@ -3,8 +3,8 @@ output = """ typeddicts_usage.py:23:1 - error: Could not assign item in TypedDict   "director" is not a defined key in "Movie" (reportGeneralTypeIssues) typeddicts_usage.py:24:1 - error: Could not assign item in TypedDict -  "Literal['1982']" is incompatible with "int" (reportGeneralTypeIssues) -typeddicts_usage.py:28:18 - error: Expression of type "dict[str, str | int]" is incompatible with declared type "Movie" +  "Literal['1982']" is not assignable to "int" (reportGeneralTypeIssues) +typeddicts_usage.py:28:18 - error: Type "dict[str, str | int]" is not assignable to declared type "Movie"   "title" is an undefined item in type "Movie" (reportAssignmentType) typeddicts_usage.py:35:22 - error: Second argument to "isinstance" must be a class or tuple of classes   TypedDict class not allowed for instance or class checks (reportArgumentType) diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 7cda8a2ff..a90f554cf 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ -version = "pyright 1.1.374" -test_duration = 1.5 +version = "pyright 1.1.384" +test_duration = 1.3 diff --git a/conformance/results/pytype/aliases_explicit.toml b/conformance/results/pytype/aliases_explicit.toml index 48f40da98..27f65cc61 100644 --- a/conformance/results/pytype/aliases_explicit.toml +++ b/conformance/results/pytype/aliases_explicit.toml @@ -7,24 +7,96 @@ Does not report some illegal annotation forms as invalid type aliases. Does not report invalid specialization of already-specialized generic type alias. """ output = """ -File "aliases_explicit.py", line 41, in : Invalid type annotation '[str, str]' [invalid-annotation] -File "aliases_explicit.py", line 41, in : Invalid type annotation 'Callable[Concatenate[int, P], R][[str, str], None]' [invalid-annotation] -File "aliases_explicit.py", line 57, in good_type_aliases: Callable[Concatenate, Any] [assert-type] -File "aliases_explicit.py", line 60, in good_type_aliases: Callable[[Any], None] [assert-type] -File "aliases_explicit.py", line 67, in : Invalid type annotation 'Optional[int][int]' [invalid-annotation] -File "aliases_explicit.py", line 68, in : Invalid type annotation 'List[Optional[int]][int]' [invalid-annotation] -File "aliases_explicit.py", line 69, in : Invalid type annotation 'List[T][int, int]' [invalid-annotation] -File "aliases_explicit.py", line 70, in : Invalid type annotation 'Callable[[int, T], T][int, int]' [invalid-annotation] -File "aliases_explicit.py", line 71, in : Invalid type annotation 'Callable[Concatenate[int, P], R][int, int]' [invalid-annotation] -File "aliases_explicit.py", line 80, in : Invalid type annotation '[int, str]' for BadTypeAlias2 [invalid-annotation] -File "aliases_explicit.py", line 81, in : Invalid type annotation '((int, str),)' for BadTypeAlias3 [invalid-annotation] -File "aliases_explicit.py", line 82, in : Invalid type annotation '' for BadTypeAlias4 [invalid-annotation] -File "aliases_explicit.py", line 83, in : Invalid type annotation "{'a': 'b'}" for BadTypeAlias5 [invalid-annotation] -File "aliases_explicit.py", line 87, in : Invalid type annotation '3' for BadTypeAlias9 [invalid-annotation] -File "aliases_explicit.py", line 88, in : Invalid type annotation 'True' for BadTypeAlias10 [invalid-annotation] -File "aliases_explicit.py", line 89, in : Invalid type annotation '1' for BadTypeAlias11 [invalid-annotation] -File "aliases_explicit.py", line 91, in : Invalid type annotation '' for BadTypeAlias13 [invalid-annotation] -File "aliases_explicit.py", line 102, in : Invalid type annotation 'Union[list, set][int]' [invalid-annotation] +aliases_explicit.py:41:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[str, str]' [invalid-annotation] + + p9: GoodTypeAlias9[[str, str], None], + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:41:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Callable[Concatenate[int, P], R][[str, str], None]' [invalid-annotation] + + p9: GoodTypeAlias9[[str, str], None], + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:57:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in good_type_aliases: Callable[Concatenate, Any] [assert-type] + + assert_type(p9, Callable[[int, str, str], None]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:60:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in good_type_aliases: Callable[[Any], None] [assert-type] + + assert_type(p12, Callable[..., None]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:67:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Optional[int][int]' [invalid-annotation] + + p1: GoodTypeAlias2[int], # E: type alias is not generic + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:68:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'List[Optional[int]][int]' [invalid-annotation] + + p2: GoodTypeAlias3[int], # E: type alias is already specialized + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:69:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'List[T][int, int]' [invalid-annotation] + + p3: GoodTypeAlias4[int, int], # E: too many type arguments + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:70:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Callable[[int, T], T][int, int]' [invalid-annotation] + + p4: GoodTypeAlias8[int, int], # E: too many type arguments + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:71:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Callable[Concatenate[int, P], R][int, int]' [invalid-annotation] + + p5: GoodTypeAlias9[int, int], # E: bad type argument for ParamSpec + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:80:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[int, str]' for BadTypeAlias2 [invalid-annotation] + +BadTypeAlias2: TA = [int, str] # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:81:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '((int, str),)' for BadTypeAlias3 [invalid-annotation] + +BadTypeAlias3: TA = ((int, str),) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:82:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for BadTypeAlias4 [invalid-annotation] + +BadTypeAlias4: TA = [int for i in range(1)] # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:83:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation "{'a': 'b'}" for BadTypeAlias5 [invalid-annotation] + +BadTypeAlias5: TA = {"a": "b"} # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '3' for BadTypeAlias9 [invalid-annotation] + +BadTypeAlias9: TA = var1 # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:88:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'True' for BadTypeAlias10 [invalid-annotation] + +BadTypeAlias10: TA = True # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:89:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '1' for BadTypeAlias11 [invalid-annotation] + +BadTypeAlias11: TA = 1 # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:91:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for BadTypeAlias13 [invalid-annotation] + +BadTypeAlias13: TA = f"{'int'}" # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:102:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Union[list, set][int]' [invalid-annotation] + +x4: ListOrSetAlias[int] # E: already specialized + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -35,7 +107,7 @@ Line 86: Expected 1 errors Line 90: Expected 1 errors Line 100: Expected 1 errors Line 101: Expected 1 errors -Line 41: Unexpected errors ['File "aliases_explicit.py", line 41, in : Invalid type annotation \\'[str, str]\\' [invalid-annotation]', 'File "aliases_explicit.py", line 41, in : Invalid type annotation \\'Callable[Concatenate[int, P], R][[str, str], None]\\' [invalid-annotation]'] -Line 57: Unexpected errors ['File "aliases_explicit.py", line 57, in good_type_aliases: Callable[Concatenate, Any] [assert-type]'] -Line 60: Unexpected errors ['File "aliases_explicit.py", line 60, in good_type_aliases: Callable[[Any], None] [assert-type]'] +Line 41: Unexpected errors ["aliases_explicit.py:41:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[str, str]' [invalid-annotation]", "aliases_explicit.py:41:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Callable[Concatenate[int, P], R][[str, str], None]' [invalid-annotation]"] +Line 57: Unexpected errors ['aliases_explicit.py:57:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in good_type_aliases: Callable[Concatenate, Any] [assert-type]'] +Line 60: Unexpected errors ['aliases_explicit.py:60:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in good_type_aliases: Callable[[Any], None] [assert-type]'] """ diff --git a/conformance/results/pytype/aliases_implicit.toml b/conformance/results/pytype/aliases_implicit.toml index 26f6b5aa2..64e38336b 100644 --- a/conformance/results/pytype/aliases_implicit.toml +++ b/conformance/results/pytype/aliases_implicit.toml @@ -7,23 +7,315 @@ Allows some illegal annotation forms to be interpreted as valid type aliases. Does not report invalid specialization of already-specialized generic type alias. """ output = """ -File "aliases_implicit.py", line 54, in : Invalid type annotation '[str, str]' [invalid-annotation] -File "aliases_implicit.py", line 54, in : Invalid type annotation 'Callable[Concatenate[int, P], R][[str, str], None]' [invalid-annotation] -File "aliases_implicit.py", line 68, in good_type_aliases: Callable[Concatenate, Any] [assert-type] -File "aliases_implicit.py", line 72, in good_type_aliases: Callable[[Any], None] [assert-type] -File "aliases_implicit.py", line 76, in : Invalid type annotation 'Optional[int][int]' [invalid-annotation] -File "aliases_implicit.py", line 77, in : Invalid type annotation 'List[Optional[int]][int]' [invalid-annotation] -File "aliases_implicit.py", line 78, in : Invalid type annotation 'List[T][int, int]' [invalid-annotation] -File "aliases_implicit.py", line 79, in : Invalid type annotation 'Callable[[int, T], T][int, int]' [invalid-annotation] -File "aliases_implicit.py", line 80, in : Invalid type annotation 'Callable[Concatenate[int, P], R][int, int]' [invalid-annotation] -File "aliases_implicit.py", line 105, in : Invalid type annotation '[int, str]' for p2 [invalid-annotation] -File "aliases_implicit.py", line 105, in : Invalid type annotation 'True' for p10 [invalid-annotation] -File "aliases_implicit.py", line 105, in : Invalid type annotation '' for p4 [invalid-annotation] -File "aliases_implicit.py", line 105, in : Invalid type annotation '3' for p9 [invalid-annotation] -File "aliases_implicit.py", line 105, in : Invalid type annotation '1' for p11 [invalid-annotation] -File "aliases_implicit.py", line 105, in : Invalid type annotation '((int, str),)' for p3 [invalid-annotation] -File "aliases_implicit.py", line 105, in : Invalid type annotation "{'a': 'b'}" for p5 [invalid-annotation] -File "aliases_implicit.py", line 135, in : Invalid type annotation 'Union[list, set][int]' [invalid-annotation] +aliases_implicit.py:54:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[str, str]' [invalid-annotation] + + p9: GoodTypeAlias9[[str, str], None], + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:54:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Callable[Concatenate[int, P], R][[str, str], None]' [invalid-annotation] + + p9: GoodTypeAlias9[[str, str], None], + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:68:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in good_type_aliases: Callable[Concatenate, Any] [assert-type] + + assert_type(p9, Callable[[int, str, str], None]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:72:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in good_type_aliases: Callable[[Any], None] [assert-type] + + assert_type(p13, Callable[..., None]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:76:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Optional[int][int]' [invalid-annotation] + + p1: GoodTypeAlias2[int], # E: type alias is not generic + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:77:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'List[Optional[int]][int]' [invalid-annotation] + + p2: GoodTypeAlias3[int], # E: type alias is already specialized + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:78:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'List[T][int, int]' [invalid-annotation] + + p3: GoodTypeAlias4[int, int], # E: too many type arguments + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:79:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Callable[[int, T], T][int, int]' [invalid-annotation] + + p4: GoodTypeAlias8[int, int], # E: too many type arguments + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:80:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Callable[Concatenate[int, P], R][int, int]' [invalid-annotation] + + p5: GoodTypeAlias9[int, int], # E: bad type argument for ParamSpec + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:105:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[int, str]' for p2 [invalid-annotation] + +def bad_type_aliases( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: BadTypeAlias1, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: BadTypeAlias2, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: BadTypeAlias3, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: BadTypeAlias4, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: BadTypeAlias5, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: BadTypeAlias6, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: BadTypeAlias7, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: BadTypeAlias8, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: BadTypeAlias9, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: BadTypeAlias10, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: BadTypeAlias11, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: BadTypeAlias12, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: BadTypeAlias13, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: BadTypeAlias14, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:105:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'True' for p10 [invalid-annotation] + +def bad_type_aliases( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: BadTypeAlias1, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: BadTypeAlias2, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: BadTypeAlias3, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: BadTypeAlias4, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: BadTypeAlias5, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: BadTypeAlias6, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: BadTypeAlias7, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: BadTypeAlias8, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: BadTypeAlias9, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: BadTypeAlias10, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: BadTypeAlias11, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: BadTypeAlias12, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: BadTypeAlias13, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: BadTypeAlias14, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:105:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for p4 [invalid-annotation] + +def bad_type_aliases( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: BadTypeAlias1, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: BadTypeAlias2, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: BadTypeAlias3, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: BadTypeAlias4, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: BadTypeAlias5, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: BadTypeAlias6, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: BadTypeAlias7, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: BadTypeAlias8, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: BadTypeAlias9, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: BadTypeAlias10, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: BadTypeAlias11, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: BadTypeAlias12, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: BadTypeAlias13, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: BadTypeAlias14, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:105:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '3' for p9 [invalid-annotation] + +def bad_type_aliases( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: BadTypeAlias1, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: BadTypeAlias2, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: BadTypeAlias3, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: BadTypeAlias4, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: BadTypeAlias5, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: BadTypeAlias6, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: BadTypeAlias7, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: BadTypeAlias8, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: BadTypeAlias9, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: BadTypeAlias10, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: BadTypeAlias11, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: BadTypeAlias12, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: BadTypeAlias13, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: BadTypeAlias14, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:105:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '1' for p11 [invalid-annotation] + +def bad_type_aliases( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: BadTypeAlias1, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: BadTypeAlias2, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: BadTypeAlias3, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: BadTypeAlias4, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: BadTypeAlias5, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: BadTypeAlias6, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: BadTypeAlias7, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: BadTypeAlias8, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: BadTypeAlias9, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: BadTypeAlias10, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: BadTypeAlias11, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: BadTypeAlias12, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: BadTypeAlias13, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: BadTypeAlias14, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:105:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '((int, str),)' for p3 [invalid-annotation] + +def bad_type_aliases( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: BadTypeAlias1, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: BadTypeAlias2, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: BadTypeAlias3, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: BadTypeAlias4, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: BadTypeAlias5, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: BadTypeAlias6, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: BadTypeAlias7, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: BadTypeAlias8, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: BadTypeAlias9, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: BadTypeAlias10, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: BadTypeAlias11, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: BadTypeAlias12, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: BadTypeAlias13, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: BadTypeAlias14, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:105:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation "{'a': 'b'}" for p5 [invalid-annotation] + +def bad_type_aliases( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: BadTypeAlias1, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: BadTypeAlias2, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: BadTypeAlias3, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: BadTypeAlias4, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: BadTypeAlias5, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: BadTypeAlias6, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: BadTypeAlias7, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: BadTypeAlias8, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: BadTypeAlias9, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: BadTypeAlias10, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: BadTypeAlias11, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: BadTypeAlias12, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: BadTypeAlias13, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: BadTypeAlias14, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:135:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Union[list, set][int]' [invalid-annotation] + +x4: ListOrSetAlias[int] # E: already specialized + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -43,8 +335,8 @@ Line 117: Expected 1 errors Line 118: Expected 1 errors Line 119: Expected 1 errors Line 133: Expected 1 errors -Line 54: Unexpected errors ['File "aliases_implicit.py", line 54, in : Invalid type annotation \\'[str, str]\\' [invalid-annotation]', 'File "aliases_implicit.py", line 54, in : Invalid type annotation \\'Callable[Concatenate[int, P], R][[str, str], None]\\' [invalid-annotation]'] -Line 68: Unexpected errors ['File "aliases_implicit.py", line 68, in good_type_aliases: Callable[Concatenate, Any] [assert-type]'] -Line 72: Unexpected errors ['File "aliases_implicit.py", line 72, in good_type_aliases: Callable[[Any], None] [assert-type]'] -Line 105: Unexpected errors ['File "aliases_implicit.py", line 105, in : Invalid type annotation \\'[int, str]\\' for p2 [invalid-annotation]', 'File "aliases_implicit.py", line 105, in : Invalid type annotation \\'True\\' for p10 [invalid-annotation]', 'File "aliases_implicit.py", line 105, in : Invalid type annotation \\'\\' for p4 [invalid-annotation]', 'File "aliases_implicit.py", line 105, in : Invalid type annotation \\'3\\' for p9 [invalid-annotation]', 'File "aliases_implicit.py", line 105, in : Invalid type annotation \\'1\\' for p11 [invalid-annotation]', 'File "aliases_implicit.py", line 105, in : Invalid type annotation \\'((int, str),)\\' for p3 [invalid-annotation]', 'File "aliases_implicit.py", line 105, in : Invalid type annotation "{\\'a\\': \\'b\\'}" for p5 [invalid-annotation]'] +Line 54: Unexpected errors ["aliases_implicit.py:54:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[str, str]' [invalid-annotation]", "aliases_implicit.py:54:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Callable[Concatenate[int, P], R][[str, str], None]' [invalid-annotation]"] +Line 68: Unexpected errors ['aliases_implicit.py:68:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in good_type_aliases: Callable[Concatenate, Any] [assert-type]'] +Line 72: Unexpected errors ['aliases_implicit.py:72:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in good_type_aliases: Callable[[Any], None] [assert-type]'] +Line 105: Unexpected errors ["aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[int, str]' for p2 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'True' for p10 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p4 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '3' for p9 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '1' for p11 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '((int, str),)' for p3 [invalid-annotation]", 'aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation "{\\'a\\': \\'b\\'}" for p5 [invalid-annotation]'] """ diff --git a/conformance/results/pytype/aliases_newtype.toml b/conformance/results/pytype/aliases_newtype.toml index fc07d9bcf..996e17771 100644 --- a/conformance/results/pytype/aliases_newtype.toml +++ b/conformance/results/pytype/aliases_newtype.toml @@ -9,10 +9,26 @@ Does not reject use of NewType with TypedDict class. Does not reject use of NewType with Any. """ output = """ -File "aliases_newtype.py", line 11, in : Function UserId.__init__ was called with the wrong arguments [wrong-arg-types] -File "aliases_newtype.py", line 12, in : Type annotation for u1 does not match type of assignment [annotation-type-mismatch] -File "aliases_newtype.py", line 38, in : class GoodNewType1 is not indexable [not-indexable] -File "aliases_newtype.py", line 60, in : Function typing.NewType expects 2 arg(s), got 3 [wrong-arg-count] +aliases_newtype.py:11:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function UserId.__init__ was called with the wrong arguments [wrong-arg-types] + +UserId("user") # E: incorrect type +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_newtype.py:12:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for u1 does not match type of assignment [annotation-type-mismatch] + +u1: UserId = 42 # E: incorrect type +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +aliases_newtype.py:38:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class GoodNewType1 is not indexable [not-indexable] + +nt1: GoodNewType1[int] # E: NewType cannot be generic + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_newtype.py:60:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function typing.NewType expects 2 arg(s), got 3 [wrong-arg-count] + +BadNewType6 = NewType("BadNewType6", int, int) # E: too many arguments + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pytype/aliases_recursive.toml b/conformance/results/pytype/aliases_recursive.toml index e65418915..10e318a6b 100644 --- a/conformance/results/pytype/aliases_recursive.toml +++ b/conformance/results/pytype/aliases_recursive.toml @@ -5,35 +5,111 @@ Does not properly handle `|` for unions in some recursive type alias definitions Does not detect cyclical references in recursive type alias definition. """ output = """ -File "aliases_recursive.py", line 19, in : Type annotation for j4 does not match type of assignment [annotation-type-mismatch] -File "aliases_recursive.py", line 20, in : Type annotation for j5 does not match type of assignment [annotation-type-mismatch] -File "aliases_recursive.py", line 38, in : Type annotation for t6 does not match type of assignment [annotation-type-mismatch] -File "aliases_recursive.py", line 39, in : Type annotation for t6 does not match type of assignment [annotation-type-mismatch] -File "aliases_recursive.py", line 50, in : Type annotation for m7 does not match type of assignment [annotation-type-mismatch] -File "aliases_recursive.py", line 51, in : Type annotation for m8 does not match type of assignment [annotation-type-mismatch] -File "aliases_recursive.py", line 58, in : unsupported operand type(s) for |: ''GenericTypeAlias1[T1]': str' and 'T1: TypeVar' [unsupported-operands] -File "aliases_recursive.py", line 59, in : Invalid type annotation 'list[str]' [invalid-annotation] -File "aliases_recursive.py", line 62, in : Invalid type annotation 'list[str]' [invalid-annotation] -File "aliases_recursive.py", line 62, in : Invalid type annotation 'GenericTypeAlias1[str]' [invalid-annotation] -File "aliases_recursive.py", line 63, in : Invalid type annotation 'list[str]' [invalid-annotation] -File "aliases_recursive.py", line 63, in : Invalid type annotation 'GenericTypeAlias1[str]' [invalid-annotation] -File "aliases_recursive.py", line 65, in : unsupported operand type(s) for |: ''GenericTypeAlias2[T1, T2]': str' and 'T1: TypeVar' [unsupported-operands] -File "aliases_recursive.py", line 67, in : Invalid type annotation 'list[str, int]' [invalid-annotation] -File "aliases_recursive.py", line 67, in : Invalid type annotation 'GenericTypeAlias2[str, int]' [invalid-annotation] -File "aliases_recursive.py", line 68, in : Invalid type annotation 'list[str, float]' [invalid-annotation] -File "aliases_recursive.py", line 68, in : Invalid type annotation 'GenericTypeAlias2[str, float]' [invalid-annotation] -File "aliases_recursive.py", line 69, in : Invalid type annotation 'list[str, int]' [invalid-annotation] -File "aliases_recursive.py", line 69, in : Invalid type annotation 'GenericTypeAlias2[str, int]' [invalid-annotation] +aliases_recursive.py:19:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for j4 does not match type of assignment [annotation-type-mismatch] + +j4: Json = {"a": 1, "b": 3j} # E: incompatible type +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +aliases_recursive.py:20:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for j5 does not match type of assignment [annotation-type-mismatch] + +j5: Json = [2, 3j] # E: incompatible type +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +aliases_recursive.py:38:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t6 does not match type of assignment [annotation-type-mismatch] + +t6: RecursiveTuple = (1, ("1", 1), (1, (1, [2]))) # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +aliases_recursive.py:39:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t6 does not match type of assignment [annotation-type-mismatch] + +t6: RecursiveTuple = (1, [1]) # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +aliases_recursive.py:50:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for m7 does not match type of assignment [annotation-type-mismatch] + +m7: RecursiveMapping = {"1": [1]} # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +aliases_recursive.py:51:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for m8 does not match type of assignment [annotation-type-mismatch] + +m8: RecursiveMapping = {"1": "1", "2": 1, "3": [1, 2]} # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +aliases_recursive.py:58:26: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : unsupported operand type(s) for |: ''GenericTypeAlias1[T1]': str' and 'T1: TypeVar' [unsupported-operands] + +GenericTypeAlias1 = list["GenericTypeAlias1[T1]" | T1] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_recursive.py:59:25: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[str]' [invalid-annotation] + +SpecializedTypeAlias1 = GenericTypeAlias1[str] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_recursive.py:62:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[str]' [invalid-annotation] + +g2: GenericTypeAlias1[str] = ["hi", "bye", [""], [["hi"]]] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_recursive.py:62:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'GenericTypeAlias1[str]' [invalid-annotation] + +g2: GenericTypeAlias1[str] = ["hi", "bye", [""], [["hi"]]] # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +aliases_recursive.py:63:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[str]' [invalid-annotation] + +g3: GenericTypeAlias1[str] = ["hi", [2.4]] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_recursive.py:63:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'GenericTypeAlias1[str]' [invalid-annotation] + +g3: GenericTypeAlias1[str] = ["hi", [2.4]] # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +aliases_recursive.py:65:26: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : unsupported operand type(s) for |: ''GenericTypeAlias2[T1, T2]': str' and 'T1: TypeVar' [unsupported-operands] + +GenericTypeAlias2 = list["GenericTypeAlias2[T1, T2]" | T1 | T2] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_recursive.py:67:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[str, int]' [invalid-annotation] + +g4: GenericTypeAlias2[str, int] = [[3, ["hi"]], "hi"] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_recursive.py:67:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'GenericTypeAlias2[str, int]' [invalid-annotation] + +g4: GenericTypeAlias2[str, int] = [[3, ["hi"]], "hi"] # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +aliases_recursive.py:68:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[str, float]' [invalid-annotation] + +g5: GenericTypeAlias2[str, float] = [[3, ["hi", 3.4, [3.4]]], "hi"] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_recursive.py:68:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'GenericTypeAlias2[str, float]' [invalid-annotation] + +g5: GenericTypeAlias2[str, float] = [[3, ["hi", 3.4, [3.4]]], "hi"] # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +aliases_recursive.py:69:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[str, int]' [invalid-annotation] + +g6: GenericTypeAlias2[str, int] = [[3, ["hi", 3, [3.4]]], "hi"] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_recursive.py:69:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'GenericTypeAlias2[str, int]' [invalid-annotation] + +g6: GenericTypeAlias2[str, int] = [[3, ["hi", 3, [3.4]]], "hi"] # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 52: Expected 1 errors Line 72: Expected 1 errors Line 75: Expected 1 errors -Line 58: Unexpected errors ['File "aliases_recursive.py", line 58, in : unsupported operand type(s) for |: \\'\\'GenericTypeAlias1[T1]\\': str\\' and \\'T1: TypeVar\\' [unsupported-operands]'] -Line 59: Unexpected errors ['File "aliases_recursive.py", line 59, in : Invalid type annotation \\'list[str]\\' [invalid-annotation]'] -Line 62: Unexpected errors ['File "aliases_recursive.py", line 62, in : Invalid type annotation \\'list[str]\\' [invalid-annotation]', 'File "aliases_recursive.py", line 62, in : Invalid type annotation \\'GenericTypeAlias1[str]\\' [invalid-annotation]'] -Line 65: Unexpected errors ['File "aliases_recursive.py", line 65, in : unsupported operand type(s) for |: \\'\\'GenericTypeAlias2[T1, T2]\\': str\\' and \\'T1: TypeVar\\' [unsupported-operands]'] -Line 67: Unexpected errors ['File "aliases_recursive.py", line 67, in : Invalid type annotation \\'list[str, int]\\' [invalid-annotation]', 'File "aliases_recursive.py", line 67, in : Invalid type annotation \\'GenericTypeAlias2[str, int]\\' [invalid-annotation]'] -Line 68: Unexpected errors ['File "aliases_recursive.py", line 68, in : Invalid type annotation \\'list[str, float]\\' [invalid-annotation]', 'File "aliases_recursive.py", line 68, in : Invalid type annotation \\'GenericTypeAlias2[str, float]\\' [invalid-annotation]'] +Line 58: Unexpected errors ["aliases_recursive.py:58:26: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : unsupported operand type(s) for |: ''GenericTypeAlias1[T1]': str' and 'T1: TypeVar' [unsupported-operands]"] +Line 59: Unexpected errors ["aliases_recursive.py:59:25: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'list[str]' [invalid-annotation]"] +Line 62: Unexpected errors ["aliases_recursive.py:62:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'list[str]' [invalid-annotation]", "aliases_recursive.py:62:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'GenericTypeAlias1[str]' [invalid-annotation]"] +Line 65: Unexpected errors ["aliases_recursive.py:65:26: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : unsupported operand type(s) for |: ''GenericTypeAlias2[T1, T2]': str' and 'T1: TypeVar' [unsupported-operands]"] +Line 67: Unexpected errors ["aliases_recursive.py:67:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'list[str, int]' [invalid-annotation]", "aliases_recursive.py:67:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'GenericTypeAlias2[str, int]' [invalid-annotation]"] +Line 68: Unexpected errors ["aliases_recursive.py:68:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'list[str, float]' [invalid-annotation]", "aliases_recursive.py:68:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'GenericTypeAlias2[str, float]' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/aliases_typealiastype.toml b/conformance/results/pytype/aliases_typealiastype.toml index f2c6d2414..9e13b0358 100644 --- a/conformance/results/pytype/aliases_typealiastype.toml +++ b/conformance/results/pytype/aliases_typealiastype.toml @@ -3,19 +3,59 @@ notes = """ Support for TypeAliasType is not implemented. """ output = """ -File "aliases_typealiastype.py", line 5, in : typing.TypeVarTuple not supported yet [not-supported-yet] -File "aliases_typealiastype.py", line 5, in : Can't find module 'typing.TypeAliasType'. [import-error] -File "aliases_typealiastype.py", line 11, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "aliases_typealiastype.py", line 19, in : Name 'GoodAlias4' is not defined [name-error] -File "aliases_typealiastype.py", line 22, in : Name 'GoodAlias5' is not defined [name-error] -File "aliases_typealiastype.py", line 22, in : Invalid type annotation '' [invalid-annotation] -File "aliases_typealiastype.py", line 46, in : Name 'BadAlias4' is not defined [name-error] -File "aliases_typealiastype.py", line 47, in : Name 'BadAlias5' is not defined [name-error] -File "aliases_typealiastype.py", line 48, in : Name 'BadAlias7' is not defined [name-error] +aliases_typealiastype.py:5:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] + +from typing import Callable, Generic, ParamSpec, TypeAliasType, TypeVar, TypeVarTuple +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_typealiastype.py:11:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Ts = TypeVarTuple("Ts") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_typealiastype.py:16:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +GoodAlias1 = TypeAliasType("GoodAlias1", int) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_typealiastype.py:19:51: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Name 'GoodAlias4' is not defined [name-error] + +GoodAlias4 = TypeAliasType("GoodAlias4", T | list[GoodAlias4[T]], type_params=(T,)) + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_typealiastype.py:22:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Name 'GoodAlias5' is not defined [name-error] + + Callable[P, TStr] | list[S] | list[GoodAlias5[S, TStr, P]] | tuple[*Ts], + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_typealiastype.py:22:66: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + + Callable[P, TStr] | list[S] | list[GoodAlias5[S, TStr, P]] | tuple[*Ts], + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_typealiastype.py:32:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'other_attrib' on TypeAliasType [attribute-error] + +print(GoodAlias1.other_attrib) # E: unknown attribute + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_typealiastype.py:46:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Name 'BadAlias4' is not defined [name-error] + +BadAlias4 = TypeAliasType("BadAlias4", BadAlias4) # E: circular dependency + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +aliases_typealiastype.py:47:44: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Name 'BadAlias5' is not defined [name-error] + +BadAlias5 = TypeAliasType("BadAlias5", T | BadAlias5[str], type_params=(T,)) # E: circular dependency + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +aliases_typealiastype.py:48:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Name 'BadAlias7' is not defined [name-error] + +BadAlias6 = TypeAliasType("BadAlias6", BadAlias7) # E: circular dependency + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 32: Expected 1 errors Line 40: Expected 1 errors Line 43: Expected 1 errors Line 44: Expected 1 errors @@ -33,8 +73,9 @@ Line 61: Expected 1 errors Line 62: Expected 1 errors Line 63: Expected 1 errors Line 64: Expected 1 errors -Line 5: Unexpected errors ['File "aliases_typealiastype.py", line 5, in : typing.TypeVarTuple not supported yet [not-supported-yet]', 'File "aliases_typealiastype.py", line 5, in : Can\\'t find module \\'typing.TypeAliasType\\'. [import-error]'] -Line 11: Unexpected errors ['File "aliases_typealiastype.py", line 11, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 19: Unexpected errors ['File "aliases_typealiastype.py", line 19, in : Name \\'GoodAlias4\\' is not defined [name-error]'] -Line 22: Unexpected errors ['File "aliases_typealiastype.py", line 22, in : Name \\'GoodAlias5\\' is not defined [name-error]', 'File "aliases_typealiastype.py", line 22, in : Invalid type annotation \\'\\' [invalid-annotation]'] +Line 5: Unexpected errors ['aliases_typealiastype.py:5:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] +Line 11: Unexpected errors ['aliases_typealiastype.py:11:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 16: Unexpected errors ["aliases_typealiastype.py:16:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 19: Unexpected errors ["aliases_typealiastype.py:19:51: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Name 'GoodAlias4' is not defined [name-error]"] +Line 22: Unexpected errors ["aliases_typealiastype.py:22:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Name 'GoodAlias5' is not defined [name-error]", "aliases_typealiastype.py:22:66: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/aliases_variance.toml b/conformance/results/pytype/aliases_variance.toml index 2bb30ee50..89093dfe8 100644 --- a/conformance/results/pytype/aliases_variance.toml +++ b/conformance/results/pytype/aliases_variance.toml @@ -3,8 +3,16 @@ notes = """ Does not detect variance incompatibility. """ output = """ -File "aliases_variance.py", line 9, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] -File "aliases_variance.py", line 10, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] +aliases_variance.py:9:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +T_co = TypeVar("T_co", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_variance.py:10:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] + +T_contra = TypeVar("T_contra", contravariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -12,6 +20,6 @@ Line 24: Expected 1 errors Line 28: Expected 1 errors Line 32: Expected 1 errors Line 44: Expected 1 errors -Line 9: Unexpected errors ['File "aliases_variance.py", line 9, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 10: Unexpected errors ['File "aliases_variance.py", line 10, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] +Line 9: Unexpected errors ['aliases_variance.py:9:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 10: Unexpected errors ['aliases_variance.py:10:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] """ diff --git a/conformance/results/pytype/annotations_forward_refs.toml b/conformance/results/pytype/annotations_forward_refs.toml index 016f08a29..b493b07e0 100644 --- a/conformance/results/pytype/annotations_forward_refs.toml +++ b/conformance/results/pytype/annotations_forward_refs.toml @@ -6,27 +6,420 @@ Evaluates incorrect type for class variable annotated with quoted type expressio Does not treat triple-quoted forward reference annotation as implicitly parenthesized. """ output = """ -File "annotations_forward_refs.py", line 22, in : Name 'ClassA' is not defined [name-error] -File "annotations_forward_refs.py", line 23, in : Name 'ClassA' is not defined [name-error] -File "annotations_forward_refs.py", line 24, in : unsupported operand type(s) for |: ''ClassA': str' and 'int: Type[int]' [unsupported-operands] -File "annotations_forward_refs.py", line 25, in : Missing parameter 'y' in call to function int.__or__ [missing-parameter] -File "annotations_forward_refs.py", line 40, in : invalid syntax [python-compiler-error] -File "annotations_forward_refs.py", line 40, in : Invalid type annotation '{}' for p5 [invalid-annotation] -File "annotations_forward_refs.py", line 40, in : Invalid type annotation '[int, str]' for p2 [invalid-annotation] -File "annotations_forward_refs.py", line 40, in : Invalid type annotation 'True' for p10 [invalid-annotation] -File "annotations_forward_refs.py", line 40, in : Invalid type annotation '' for p15 [invalid-annotation] -File "annotations_forward_refs.py", line 40, in : Invalid type annotation '' for p4 [invalid-annotation] -File "annotations_forward_refs.py", line 40, in : Invalid type annotation '1' for p9 [invalid-annotation] -File "annotations_forward_refs.py", line 40, in : Invalid type annotation '1' for p11 [invalid-annotation] -File "annotations_forward_refs.py", line 40, in : Invalid type annotation '-1' for p12 [invalid-annotation] -File "annotations_forward_refs.py", line 40, in : Invalid type annotation '(int, str)' for p3 [invalid-annotation] -File "annotations_forward_refs.py", line 66, in ClassB: Name 'ClassB' is not defined [name-error] -File "annotations_forward_refs.py", line 80, in ClassD: Name 'ClassF' is not defined [name-error] -File "annotations_forward_refs.py", line 82, in ClassD: Invalid type annotation '' for str [invalid-annotation] -File "annotations_forward_refs.py", line 87, in ClassD: Invalid type annotation '' for x [invalid-annotation] -File "annotations_forward_refs.py", line 89, in ClassD: Invalid type annotation '' for y [invalid-annotation] -File "annotations_forward_refs.py", line 96, in : Any [assert-type] -File "annotations_forward_refs.py", line 103, in : unexpected indent [python-compiler-error] +annotations_forward_refs.py:22:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Name 'ClassA' is not defined [name-error] + +bad1: ClassA # E: Runtime error: requires quotes + \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:23:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Name 'ClassA' is not defined [name-error] + +bad2: list[ClassA] # E: Runtime error: requires quotes + \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:24:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : unsupported operand type(s) for |: ''ClassA': str' and 'int: Type[int]' [unsupported-operands] + +bad3: "ClassA" | int # E: Runtime error + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:25:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'y' in call to function int.__or__ [missing-parameter] + +bad4: int | "ClassA" # E: Runtime error + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '{}' for p5 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: "eval(''.join(map(chr, [105, 110, 116])))", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: "[int, str]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: "(int, str)", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: "[int for i in range(1)]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: "{}", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: "(lambda : int)()", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: "[int][0]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: "int if 1 < 3 else str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: "var1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: "True", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: "1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: "-1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: "int or str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: 'f"int"', # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: "types", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[int, str]' for p2 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: "eval(''.join(map(chr, [105, 110, 116])))", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: "[int, str]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: "(int, str)", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: "[int for i in range(1)]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: "{}", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: "(lambda : int)()", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: "[int][0]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: "int if 1 < 3 else str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: "var1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: "True", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: "1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: "-1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: "int or str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: 'f"int"', # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: "types", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'True' for p10 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: "eval(''.join(map(chr, [105, 110, 116])))", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: "[int, str]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: "(int, str)", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: "[int for i in range(1)]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: "{}", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: "(lambda : int)()", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: "[int][0]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: "int if 1 < 3 else str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: "var1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: "True", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: "1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: "-1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: "int or str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: 'f"int"', # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: "types", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for p15 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: "eval(''.join(map(chr, [105, 110, 116])))", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: "[int, str]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: "(int, str)", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: "[int for i in range(1)]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: "{}", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: "(lambda : int)()", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: "[int][0]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: "int if 1 < 3 else str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: "var1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: "True", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: "1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: "-1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: "int or str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: 'f"int"', # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: "types", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for p4 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: "eval(''.join(map(chr, [105, 110, 116])))", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: "[int, str]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: "(int, str)", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: "[int for i in range(1)]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: "{}", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: "(lambda : int)()", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: "[int][0]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: "int if 1 < 3 else str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: "var1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: "True", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: "1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: "-1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: "int or str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: 'f"int"', # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: "types", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '1' for p9 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: "eval(''.join(map(chr, [105, 110, 116])))", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: "[int, str]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: "(int, str)", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: "[int for i in range(1)]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: "{}", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: "(lambda : int)()", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: "[int][0]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: "int if 1 < 3 else str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: "var1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: "True", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: "1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: "-1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: "int or str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: 'f"int"', # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: "types", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '1' for p11 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: "eval(''.join(map(chr, [105, 110, 116])))", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: "[int, str]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: "(int, str)", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: "[int for i in range(1)]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: "{}", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: "(lambda : int)()", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: "[int][0]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: "int if 1 < 3 else str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: "var1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: "True", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: "1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: "-1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: "int or str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: 'f"int"', # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: "types", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '-1' for p12 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: "eval(''.join(map(chr, [105, 110, 116])))", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: "[int, str]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: "(int, str)", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: "[int for i in range(1)]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: "{}", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: "(lambda : int)()", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: "[int][0]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: "int if 1 < 3 else str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: "var1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: "True", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: "1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: "-1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: "int or str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: 'f"int"', # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: "types", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '(int, str)' for p3 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: "eval(''.join(map(chr, [105, 110, 116])))", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: "[int, str]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: "(int, str)", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: "[int for i in range(1)]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: "{}", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: "(lambda : int)()", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: "[int][0]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: "int if 1 < 3 else str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: "var1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: "True", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: "1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: "-1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: "int or str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: 'f"int"', # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: "types", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:66:26: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassB: Name 'ClassB' is not defined [name-error] + + def method1(self) -> ClassB: # E: Runtime error + \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:80:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassD: Name 'ClassF' is not defined [name-error] + + ClassF: "ClassF" # E: circular reference + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:82:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassD: Invalid type annotation '' for str [invalid-annotation] + + str: "str" = "" # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:87:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassD: Invalid type annotation '' for x [invalid-annotation] + + x: "int" = 0 # OK + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +annotations_forward_refs.py:89:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassD: Invalid type annotation '' for y [invalid-annotation] + + y: int = 0 # E: Refers to local int, which isn't a legal type expression + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +annotations_forward_refs.py:96:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(ClassD.x, int) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:103:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : unexpected indent [python-compiler-error] + +value: ""\" +\u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + int | +\u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + str | +\u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + list[int] +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m +""\" +\u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -45,9 +438,9 @@ Line 52: Expected 1 errors Line 53: Expected 1 errors Line 54: Expected 1 errors Line 55: Expected 1 errors -Line 40: Unexpected errors ['File "annotations_forward_refs.py", line 40, in : invalid syntax [python-compiler-error]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'{}\\' for p5 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'[int, str]\\' for p2 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'True\\' for p10 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'\\' for p15 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'\\' for p4 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'1\\' for p9 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'1\\' for p11 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'-1\\' for p12 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'(int, str)\\' for p3 [invalid-annotation]'] -Line 82: Unexpected errors ['File "annotations_forward_refs.py", line 82, in ClassD: Invalid type annotation \\'\\' for str [invalid-annotation]'] -Line 87: Unexpected errors ['File "annotations_forward_refs.py", line 87, in ClassD: Invalid type annotation \\'\\' for x [invalid-annotation]'] -Line 96: Unexpected errors ['File "annotations_forward_refs.py", line 96, in : Any [assert-type]'] -Line 103: Unexpected errors ['File "annotations_forward_refs.py", line 103, in : unexpected indent [python-compiler-error]'] +Line 40: Unexpected errors ["annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '{}' for p5 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[int, str]' for p2 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'True' for p10 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p15 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p4 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '1' for p9 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '1' for p11 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '-1' for p12 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '(int, str)' for p3 [invalid-annotation]"] +Line 82: Unexpected errors ["annotations_forward_refs.py:82:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in ClassD: Invalid type annotation '' for str [invalid-annotation]"] +Line 87: Unexpected errors ["annotations_forward_refs.py:87:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in ClassD: Invalid type annotation '' for x [invalid-annotation]"] +Line 96: Unexpected errors ['annotations_forward_refs.py:96:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] +Line 103: Unexpected errors ['annotations_forward_refs.py:103:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : unexpected indent [python-compiler-error]'] """ diff --git a/conformance/results/pytype/annotations_generators.toml b/conformance/results/pytype/annotations_generators.toml index 4be5d0125..50bb6423c 100644 --- a/conformance/results/pytype/annotations_generators.toml +++ b/conformance/results/pytype/annotations_generators.toml @@ -5,17 +5,71 @@ Reports invalid error when return type of generator is annotated as a compatible Does not report type violation in `yield from` statement. """ output = """ -File "annotations_generators.py", line 54, in generator2: bad return type [bad-return-type] -File "annotations_generators.py", line 57, in generator2: bad return type [bad-return-type] -File "annotations_generators.py", line 57, in generator2: bad return type [bad-return-type] -File "annotations_generators.py", line 66, in generator3: bad return type [bad-return-type] -File "annotations_generators.py", line 75, in generator5: bad return type [bad-return-type] -File "annotations_generators.py", line 86, in : Bad return type 'int' for generator function generator8 [bad-yield-annotation] -File "annotations_generators.py", line 91, in : Bad return type 'int' for async generator function generator9 [bad-yield-annotation] -File "annotations_generators.py", line 100, in : Bad return type 'IntIterator' for generator function generator15 [bad-yield-annotation] -File "annotations_generators.py", line 109, in : Bad return type 'AsyncIntIterator' for async generator function generator16 [bad-yield-annotation] -File "annotations_generators.py", line 118, in generator18: bad return type [bad-return-type] -File "annotations_generators.py", line 119, in generator18: bad return type [bad-return-type] +annotations_generators.py:54:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in generator2: bad return type [bad-return-type] + + return False # E: incompatible return type + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +annotations_generators.py:57:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in generator2: bad return type [bad-return-type] + + yield 3 # E: incompatible yield type + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +annotations_generators.py:57:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in generator2: bad return type [bad-return-type] + + yield 3 # E: incompatible yield type + \u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +annotations_generators.py:66:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in generator3: bad return type [bad-return-type] + + yield 3 # E: Incompatible yield type + \u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +annotations_generators.py:75:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in generator5: bad return type [bad-return-type] + + yield B() # E: incompatible yield type + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +annotations_generators.py:86:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Bad return type 'int' for generator function generator8 [bad-yield-annotation] + +def generator8() -> int: # E: incompatible return type +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + yield None # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + return 0 +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +annotations_generators.py:91:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Bad return type 'int' for async generator function generator9 [bad-yield-annotation] + +async def generator9() -> int: # E: incompatible return type +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + yield None # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +annotations_generators.py:100:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Bad return type 'IntIterator' for generator function generator15 [bad-yield-annotation] + +def generator15() -> IntIterator: # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + yield 0 +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +annotations_generators.py:109:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Bad return type 'AsyncIntIterator' for async generator function generator16 [bad-yield-annotation] + +async def generator16() -> AsyncIntIterator: # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + yield 0 +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +annotations_generators.py:118:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in generator18: bad return type [bad-return-type] + + yield from generator17() # E: incompatible generator type + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +annotations_generators.py:119:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in generator18: bad return type [bad-return-type] + + yield from [1] # E: incompatible generator type + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -23,6 +77,6 @@ Line 51: Expected 1 errors Line 87: Expected 1 errors Line 92: Expected 1 errors Line 135: Expected 1 errors -Line 100: Unexpected errors ['File "annotations_generators.py", line 100, in : Bad return type \\'IntIterator\\' for generator function generator15 [bad-yield-annotation]'] -Line 109: Unexpected errors ['File "annotations_generators.py", line 109, in : Bad return type \\'AsyncIntIterator\\' for async generator function generator16 [bad-yield-annotation]'] +Line 100: Unexpected errors ["annotations_generators.py:100:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Bad return type 'IntIterator' for generator function generator15 [bad-yield-annotation]"] +Line 109: Unexpected errors ["annotations_generators.py:109:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Bad return type 'AsyncIntIterator' for async generator function generator16 [bad-yield-annotation]"] """ diff --git a/conformance/results/pytype/annotations_methods.toml b/conformance/results/pytype/annotations_methods.toml index f86e18674..4a773d055 100644 --- a/conformance/results/pytype/annotations_methods.toml +++ b/conformance/results/pytype/annotations_methods.toml @@ -3,7 +3,11 @@ notes = """ Type evaluation differs from other type checkers because of ambiguity in the spec related to method bindings. """ output = """ -File "annotations_methods.py", line 42, in : B [assert-type] +annotations_methods.py:42:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : B [assert-type] + +assert_type(A.copy(B()), A) # E? +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pytype/annotations_typeexpr.toml b/conformance/results/pytype/annotations_typeexpr.toml index bfefd545b..87fa1060c 100644 --- a/conformance/results/pytype/annotations_typeexpr.toml +++ b/conformance/results/pytype/annotations_typeexpr.toml @@ -8,15 +8,357 @@ Does not reject f-string in type annotation. Does not reject module in type annotation. """ output = """ -File "annotations_typeexpr.py", line 87, in : Invalid type annotation '{}' for p5 [invalid-annotation] -File "annotations_typeexpr.py", line 87, in : Invalid type annotation '[int, str]' for p2 [invalid-annotation] -File "annotations_typeexpr.py", line 87, in : Invalid type annotation 'True' for p10 [invalid-annotation] -File "annotations_typeexpr.py", line 87, in : Invalid type annotation '' for p15 [invalid-annotation] -File "annotations_typeexpr.py", line 87, in : Invalid type annotation '' for p4 [invalid-annotation] -File "annotations_typeexpr.py", line 87, in : Invalid type annotation '3' for p9 [invalid-annotation] -File "annotations_typeexpr.py", line 87, in : Invalid type annotation '1' for p11 [invalid-annotation] -File "annotations_typeexpr.py", line 87, in : Invalid type annotation '-1' for p12 [invalid-annotation] -File "annotations_typeexpr.py", line 87, in : Invalid type annotation '(int, str)' for p3 [invalid-annotation] +annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '{}' for p5 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: eval("".join(map(chr, [105, 110, 116]))), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: [int, str], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: (int, str), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: [int for i in range(1)], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: {}, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: (lambda: int)(), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: [int][0], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: int if 1 < 3 else str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: var1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: True, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: 1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: -1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: int or str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: f"int", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: types, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[int, str]' for p2 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: eval("".join(map(chr, [105, 110, 116]))), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: [int, str], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: (int, str), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: [int for i in range(1)], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: {}, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: (lambda: int)(), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: [int][0], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: int if 1 < 3 else str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: var1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: True, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: 1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: -1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: int or str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: f"int", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: types, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'True' for p10 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: eval("".join(map(chr, [105, 110, 116]))), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: [int, str], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: (int, str), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: [int for i in range(1)], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: {}, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: (lambda: int)(), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: [int][0], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: int if 1 < 3 else str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: var1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: True, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: 1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: -1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: int or str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: f"int", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: types, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for p15 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: eval("".join(map(chr, [105, 110, 116]))), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: [int, str], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: (int, str), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: [int for i in range(1)], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: {}, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: (lambda: int)(), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: [int][0], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: int if 1 < 3 else str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: var1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: True, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: 1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: -1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: int or str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: f"int", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: types, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for p4 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: eval("".join(map(chr, [105, 110, 116]))), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: [int, str], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: (int, str), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: [int for i in range(1)], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: {}, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: (lambda: int)(), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: [int][0], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: int if 1 < 3 else str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: var1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: True, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: 1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: -1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: int or str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: f"int", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: types, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '3' for p9 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: eval("".join(map(chr, [105, 110, 116]))), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: [int, str], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: (int, str), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: [int for i in range(1)], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: {}, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: (lambda: int)(), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: [int][0], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: int if 1 < 3 else str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: var1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: True, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: 1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: -1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: int or str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: f"int", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: types, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '1' for p11 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: eval("".join(map(chr, [105, 110, 116]))), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: [int, str], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: (int, str), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: [int for i in range(1)], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: {}, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: (lambda: int)(), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: [int][0], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: int if 1 < 3 else str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: var1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: True, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: 1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: -1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: int or str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: f"int", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: types, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '-1' for p12 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: eval("".join(map(chr, [105, 110, 116]))), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: [int, str], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: (int, str), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: [int for i in range(1)], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: {}, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: (lambda: int)(), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: [int][0], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: int if 1 < 3 else str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: var1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: True, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: 1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: -1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: int or str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: f"int", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: types, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '(int, str)' for p3 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: eval("".join(map(chr, [105, 110, 116]))), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: [int, str], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: (int, str), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: [int for i in range(1)], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: {}, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: (lambda: int)(), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: [int][0], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: int if 1 < 3 else str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: var1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: True, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: 1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: -1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: int or str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: f"int", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: types, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -35,5 +377,5 @@ Line 99: Expected 1 errors Line 100: Expected 1 errors Line 101: Expected 1 errors Line 102: Expected 1 errors -Line 87: Unexpected errors ['File "annotations_typeexpr.py", line 87, in : Invalid type annotation \\'{}\\' for p5 [invalid-annotation]', 'File "annotations_typeexpr.py", line 87, in : Invalid type annotation \\'[int, str]\\' for p2 [invalid-annotation]', 'File "annotations_typeexpr.py", line 87, in : Invalid type annotation \\'True\\' for p10 [invalid-annotation]', 'File "annotations_typeexpr.py", line 87, in : Invalid type annotation \\'\\' for p15 [invalid-annotation]', 'File "annotations_typeexpr.py", line 87, in : Invalid type annotation \\'\\' for p4 [invalid-annotation]', 'File "annotations_typeexpr.py", line 87, in : Invalid type annotation \\'3\\' for p9 [invalid-annotation]', 'File "annotations_typeexpr.py", line 87, in : Invalid type annotation \\'1\\' for p11 [invalid-annotation]', 'File "annotations_typeexpr.py", line 87, in : Invalid type annotation \\'-1\\' for p12 [invalid-annotation]', 'File "annotations_typeexpr.py", line 87, in : Invalid type annotation \\'(int, str)\\' for p3 [invalid-annotation]'] +Line 87: Unexpected errors ["annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '{}' for p5 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[int, str]' for p2 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'True' for p10 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p15 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p4 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '3' for p9 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '1' for p11 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '-1' for p12 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '(int, str)' for p3 [invalid-annotation]"] """ diff --git a/conformance/results/pytype/callables_kwargs.toml b/conformance/results/pytype/callables_kwargs.toml index 3723069b8..ae052884d 100644 --- a/conformance/results/pytype/callables_kwargs.toml +++ b/conformance/results/pytype/callables_kwargs.toml @@ -3,20 +3,76 @@ notes = """ Does not understand Unpack in the context of **kwargs annotation. """ output = """ -File "callables_kwargs.py", line 10, in : typing.Unpack not supported yet [not-supported-yet] -File "callables_kwargs.py", line 24, in func1: Unpack[TD2] [assert-type] -File "callables_kwargs.py", line 32, in func1: Unpack[TD2] [assert-type] -File "callables_kwargs.py", line 35, in func1: Unpack[TD2] [assert-type] -File "callables_kwargs.py", line 41, in func2: Dict[str, Unpack[TD1]] [assert-type] -File "callables_kwargs.py", line 47, in func3: Function func1 was called with the wrong arguments [wrong-arg-types] -File "callables_kwargs.py", line 49, in func3: Missing parameter 'v2' in call to function TD2.__init__ [missing-parameter] -File "callables_kwargs.py", line 51, in func3: Function func1 was called with the wrong arguments [wrong-arg-types] -File "callables_kwargs.py", line 52, in func3: Function func1 expects 0 arg(s), got 3 [wrong-arg-count] -File "callables_kwargs.py", line 58, in func3: Function func1 was called with the wrong arguments [wrong-arg-types] -File "callables_kwargs.py", line 61, in func3: Function func1 was called with the wrong arguments [wrong-arg-types] -File "callables_kwargs.py", line 63, in func3: Function func1 was called with the wrong arguments [wrong-arg-types] -File "callables_kwargs.py", line 64, in func3: Function func2 was called with the wrong arguments [wrong-arg-types] -File "callables_kwargs.py", line 65, in func3: Function func2 was called with the wrong arguments [wrong-arg-types] +callables_kwargs.py:10:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.Unpack not supported yet [not-supported-yet] + +from typing import Protocol, TypeVar, TypedDict, NotRequired, Required, Unpack, assert_type +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:24:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Unpack[TD2] [assert-type] + + assert_type(v1, int) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:32:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Unpack[TD2] [assert-type] + + assert_type(v2, str) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:35:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Unpack[TD2] [assert-type] + + assert_type(v3, str) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:41:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Dict[str, Unpack[TD1]] [assert-type] + + assert_type(kwargs, TD1) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:47:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Function func1 was called with the wrong arguments [wrong-arg-types] + + func1(v1=1, v2="", v3="5") # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:49:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Missing parameter 'v2' in call to function TD2.__init__ [missing-parameter] + + td2 = TD2(v1=2, v3="4") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:51:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Function func1 was called with the wrong arguments [wrong-arg-types] + + func1(v1=1, v2="", v3="5", v4=5) # E: v4 is not in TD2 + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:52:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Function func1 expects 0 arg(s), got 3 [wrong-arg-count] + + func1(1, "", "5") # E: args not passed by position + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:58:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Function func1 was called with the wrong arguments [wrong-arg-types] + + func1(**my_dict) # E: untyped dict + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:61:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Function func1 was called with the wrong arguments [wrong-arg-types] + + func1(**d1) # E?: OK or Type error (spec allows either) + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:63:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Function func1 was called with the wrong arguments [wrong-arg-types] + + func1(v1=2, **td2) # E: v1 is already specified + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:64:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Function func2 was called with the wrong arguments [wrong-arg-types] + + func2(1, **td2) # E: v1 is already specified + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:65:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Function func2 was called with the wrong arguments [wrong-arg-types] + + func2(v1=1, **td2) # E: v1 is already specified + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -26,11 +82,11 @@ Line 102: Expected 1 errors Line 103: Expected 1 errors Line 111: Expected 1 errors Line 122: Expected 1 errors -Line 10: Unexpected errors ['File "callables_kwargs.py", line 10, in : typing.Unpack not supported yet [not-supported-yet]'] -Line 24: Unexpected errors ['File "callables_kwargs.py", line 24, in func1: Unpack[TD2] [assert-type]'] -Line 32: Unexpected errors ['File "callables_kwargs.py", line 32, in func1: Unpack[TD2] [assert-type]'] -Line 35: Unexpected errors ['File "callables_kwargs.py", line 35, in func1: Unpack[TD2] [assert-type]'] -Line 41: Unexpected errors ['File "callables_kwargs.py", line 41, in func2: Dict[str, Unpack[TD1]] [assert-type]'] -Line 47: Unexpected errors ['File "callables_kwargs.py", line 47, in func3: Function func1 was called with the wrong arguments [wrong-arg-types]'] -Line 49: Unexpected errors ['File "callables_kwargs.py", line 49, in func3: Missing parameter \\'v2\\' in call to function TD2.__init__ [missing-parameter]'] +Line 10: Unexpected errors ['callables_kwargs.py:10:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.Unpack not supported yet [not-supported-yet]'] +Line 24: Unexpected errors ['callables_kwargs.py:24:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Unpack[TD2] [assert-type]'] +Line 32: Unexpected errors ['callables_kwargs.py:32:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Unpack[TD2] [assert-type]'] +Line 35: Unexpected errors ['callables_kwargs.py:35:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Unpack[TD2] [assert-type]'] +Line 41: Unexpected errors ['callables_kwargs.py:41:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: Dict[str, Unpack[TD1]] [assert-type]'] +Line 47: Unexpected errors ['callables_kwargs.py:47:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: Function func1 was called with the wrong arguments [wrong-arg-types]'] +Line 49: Unexpected errors ["callables_kwargs.py:49:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: Missing parameter 'v2' in call to function TD2.__init__ [missing-parameter]"] """ diff --git a/conformance/results/pytype/callables_protocol.toml b/conformance/results/pytype/callables_protocol.toml index c80c657f1..1f20354ff 100644 --- a/conformance/results/pytype/callables_protocol.toml +++ b/conformance/results/pytype/callables_protocol.toml @@ -3,15 +3,43 @@ notes = """ Does not properly handle type compatibility checks with callback protocols. """ output = """ -File "callables_protocol.py", line 9, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] -File "callables_protocol.py", line 10, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] -File "callables_protocol.py", line 121, in : Type annotation for cb6 does not match type of assignment [annotation-type-mismatch] -File "callables_protocol.py", line 173, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] -File "callables_protocol.py", line 188, in decorator1: bad return type [bad-return-type] +callables_protocol.py:9:10: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] + +InputT = TypeVar("InputT", contravariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_protocol.py:10:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +OutputT = TypeVar("OutputT", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_protocol.py:121:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for cb6 does not match type of assignment [annotation-type-mismatch] + +cb6: NotProto6 = cb6_bad1 # E: NotProto6 isn't a protocol class +\u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +callables_protocol.py:173:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +R = TypeVar("R", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_protocol.py:188:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in decorator1: bad return type [bad-return-type] + + return converted + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + Called from (traceback): line 191, in current file -File "callables_protocol.py", line 197, in : No attribute 'other_attribute2' on Proto9[Any, str] [attribute-error] -File "callables_protocol.py", line 199, in : Function Proto9.__call__ was called with the wrong arguments [wrong-arg-types] +callables_protocol.py:197:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'other_attribute2' on Proto9[Any, str] [attribute-error] + +print(cb9_good.other_attribute2) # E: unknown attribute + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_protocol.py:199:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Proto9.__call__ was called with the wrong arguments [wrong-arg-types] + +cb9_good(x=3) +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -30,9 +58,9 @@ Line 238: Expected 1 errors Line 260: Expected 1 errors Line 284: Expected 1 errors Line 311: Expected 1 errors -Line 9: Unexpected errors ['File "callables_protocol.py", line 9, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] -Line 10: Unexpected errors ['File "callables_protocol.py", line 10, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 173: Unexpected errors ['File "callables_protocol.py", line 173, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 188: Unexpected errors ['File "callables_protocol.py", line 188, in decorator1: bad return type [bad-return-type]'] -Line 199: Unexpected errors ['File "callables_protocol.py", line 199, in : Function Proto9.__call__ was called with the wrong arguments [wrong-arg-types]'] +Line 9: Unexpected errors ['callables_protocol.py:9:10: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] +Line 10: Unexpected errors ['callables_protocol.py:10:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 173: Unexpected errors ['callables_protocol.py:173:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 188: Unexpected errors ['callables_protocol.py:188:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in decorator1: bad return type [bad-return-type]'] +Line 199: Unexpected errors ['callables_protocol.py:199:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function Proto9.__call__ was called with the wrong arguments [wrong-arg-types]'] """ diff --git a/conformance/results/pytype/callables_subtyping.toml b/conformance/results/pytype/callables_subtyping.toml index 43e7ac96b..9d940c4ab 100644 --- a/conformance/results/pytype/callables_subtyping.toml +++ b/conformance/results/pytype/callables_subtyping.toml @@ -34,17 +34,41 @@ Line 240: Expected 1 errors Line 243: Expected 1 errors Line 273: Expected 1 errors Line 297: Expected 1 errors -Line 211: Unexpected errors ['File "callables_subtyping.py", line 211, in : Invalid type annotation \\'Callable[[P], None][P]\\' [invalid-annotation]'] -Line 213: Unexpected errors ['File "callables_subtyping.py", line 213, in func7: Invalid type annotation \\'TypeAliasWithP[P]\\' [invalid-annotation]'] -Line 255: Unexpected errors ['File "callables_subtyping.py", line 255, in __call__: @typing.overload-decorated \\'Overloaded9.__call__\\' object is not callable [not-callable]'] -Line 284: Unexpected errors ['File "callables_subtyping.py", line 284, in __call__: @typing.overload-decorated \\'Overloaded10.__call__\\' object is not callable [not-callable]'] +Line 211: Unexpected errors ["callables_subtyping.py:211:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Callable[[P], None][P]' [invalid-annotation]"] +Line 213: Unexpected errors ["callables_subtyping.py:213:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: Invalid type annotation 'TypeAliasWithP[P]' [invalid-annotation]"] +Line 255: Unexpected errors ["callables_subtyping.py:255:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __call__: @typing.overload-decorated 'Overloaded9.__call__' object is not callable [not-callable]"] +Line 284: Unexpected errors ["callables_subtyping.py:284:44: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __call__: @typing.overload-decorated 'Overloaded10.__call__' object is not callable [not-callable]"] """ output = """ -File "callables_subtyping.py", line 26, in func1: Type annotation for f6 does not match type of assignment [annotation-type-mismatch] -File "callables_subtyping.py", line 29, in func1: Type annotation for f8 does not match type of assignment [annotation-type-mismatch] -File "callables_subtyping.py", line 211, in : Invalid type annotation 'Callable[[P], None][P]' [invalid-annotation] -File "callables_subtyping.py", line 213, in func7: Invalid type annotation 'TypeAliasWithP[P]' [invalid-annotation] -File "callables_subtyping.py", line 255, in __call__: @typing.overload-decorated 'Overloaded9.__call__' object is not callable [not-callable] -File "callables_subtyping.py", line 284, in __call__: @typing.overload-decorated 'Overloaded10.__call__' object is not callable [not-callable] +callables_subtyping.py:26:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for f6 does not match type of assignment [annotation-type-mismatch] + + f6: Callable[[float], float] = cb3 # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +callables_subtyping.py:29:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for f8 does not match type of assignment [annotation-type-mismatch] + + f8: Callable[[int], int] = cb2 # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +callables_subtyping.py:211:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Callable[[P], None][P]' [invalid-annotation] + +def func7(proto: ProtocolWithP[P], ta: TypeAliasWithP[P]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_subtyping.py:213:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func7: Invalid type annotation 'TypeAliasWithP[P]' [invalid-annotation] + + f1: TypeAliasWithP[P] = proto # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +callables_subtyping.py:255:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __call__: @typing.overload-decorated 'Overloaded9.__call__' object is not callable [not-callable] + + def __call__(self, x: str) -> str: ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +callables_subtyping.py:284:44: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __call__: @typing.overload-decorated 'Overloaded10.__call__' object is not callable [not-callable] + + def __call__(self, x: str) -> complex: ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" diff --git a/conformance/results/pytype/classes_classvar.toml b/conformance/results/pytype/classes_classvar.toml index c79f592cb..d042ebf8d 100644 --- a/conformance/results/pytype/classes_classvar.toml +++ b/conformance/results/pytype/classes_classvar.toml @@ -12,19 +12,104 @@ Does not reject use of ClassVar in type alias definition. Does not reject assignment of ClassVar through instance of class. """ output = """ -File "classes_classvar.py", line 7, in : typing.TypeVarTuple not supported yet [not-supported-yet] -File "classes_classvar.py", line 29, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "classes_classvar.py", line 38, in ClassA: Invalid type annotation 'ClassVar[int, str]' [invalid-annotation] -File "classes_classvar.py", line 38, in ClassA: Invalid type annotation 'ClassVar[int, str]' [invalid-annotation] -File "classes_classvar.py", line 39, in ClassA: class ClassVar is not indexable [not-indexable] -File "classes_classvar.py", line 39, in ClassA: Invalid type annotation 'CV[3]' [invalid-annotation] -File "classes_classvar.py", line 40, in ClassA: Name 'var' is not defined [name-error] -File "classes_classvar.py", line 52, in ClassA: Type annotation for bad8 does not match type of assignment [annotation-type-mismatch] -File "classes_classvar.py", line 60, in ClassA: Type annotation for good4 does not match type of assignment [annotation-type-mismatch] -File "classes_classvar.py", line 68, in method2: bad return type [bad-return-type] -File "classes_classvar.py", line 78, in : ClassVar [assert-type] -File "classes_classvar.py", line 124, in ProtoA: Type annotation for z does not match type of assignment [annotation-type-mismatch] -File "classes_classvar.py", line 134, in : Type annotation for a does not match type of assignment [annotation-type-mismatch] +classes_classvar.py:7:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] + +from typing import ( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + Annotated, +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + Any, +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + Callable, +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + ClassVar, +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + Final, +\u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + Generic, +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + ParamSpec, +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + Protocol, +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + TypeAlias, +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + TypeVar, +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + TypeVarTuple, +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + assert_type, +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + cast, +\u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m +) +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +classes_classvar.py:29:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Ts = TypeVarTuple("Ts") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +classes_classvar.py:38:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Invalid type annotation 'ClassVar[int, str]' [invalid-annotation] + + bad1: ClassVar[int, str] = cast(Any, 0) # E: too many arguments + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +classes_classvar.py:38:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Invalid type annotation 'ClassVar[int, str]' [invalid-annotation] + + bad1: ClassVar[int, str] = cast(Any, 0) # E: too many arguments + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +classes_classvar.py:39:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: class ClassVar is not indexable [not-indexable] + + bad2: CV[3] = cast(Any, 0) # E: invalid type + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +classes_classvar.py:39:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Invalid type annotation 'CV[3]' [invalid-annotation] + + bad2: CV[3] = cast(Any, 0) # E: invalid type + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +classes_classvar.py:40:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Name 'var' is not defined [name-error] + + bad3: CV[var] = cast(Any, 0) # E: invalid type + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +classes_classvar.py:40:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Name 'var' is not defined [name-error] + + bad3: CV[var] = cast(Any, 0) # E: invalid type + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +classes_classvar.py:52:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Type annotation for bad8 does not match type of assignment [annotation-type-mismatch] + + bad8: ClassVar[list[str]] = {} # E: type violation in initialization + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +classes_classvar.py:60:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Type annotation for good4 does not match type of assignment [annotation-type-mismatch] + + good4: ClassVar = 3.1 + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +classes_classvar.py:68:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method2: bad return type [bad-return-type] + + return 3 + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +classes_classvar.py:78:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : ClassVar [assert-type] + +assert_type(ClassA.good4, float) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +classes_classvar.py:124:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ProtoA: Type annotation for z does not match type of assignment [annotation-type-mismatch] + + z: CV = [""] + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +classes_classvar.py:134:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for a does not match type of assignment [annotation-type-mismatch] + +a: ProtoA = ProtoAImpl() # E: y is not a ClassVar +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -40,10 +125,10 @@ Line 67: Expected 1 errors Line 71: Expected 1 errors Line 72: Expected 1 errors Line 105: Expected 1 errors -Line 7: Unexpected errors ['File "classes_classvar.py", line 7, in : typing.TypeVarTuple not supported yet [not-supported-yet]'] -Line 29: Unexpected errors ['File "classes_classvar.py", line 29, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 60: Unexpected errors ['File "classes_classvar.py", line 60, in ClassA: Type annotation for good4 does not match type of assignment [annotation-type-mismatch]'] -Line 68: Unexpected errors ['File "classes_classvar.py", line 68, in method2: bad return type [bad-return-type]'] -Line 78: Unexpected errors ['File "classes_classvar.py", line 78, in : ClassVar [assert-type]'] -Line 124: Unexpected errors ['File "classes_classvar.py", line 124, in ProtoA: Type annotation for z does not match type of assignment [annotation-type-mismatch]'] +Line 7: Unexpected errors ['classes_classvar.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] +Line 29: Unexpected errors ['classes_classvar.py:29:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 60: Unexpected errors ['classes_classvar.py:60:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in ClassA: Type annotation for good4 does not match type of assignment [annotation-type-mismatch]'] +Line 68: Unexpected errors ['classes_classvar.py:68:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: bad return type [bad-return-type]'] +Line 78: Unexpected errors ['classes_classvar.py:78:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : ClassVar [assert-type]'] +Line 124: Unexpected errors ['classes_classvar.py:124:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in ProtoA: Type annotation for z does not match type of assignment [annotation-type-mismatch]'] """ diff --git a/conformance/results/pytype/classes_override.toml b/conformance/results/pytype/classes_override.toml index 8395e9206..b3daac6bc 100644 --- a/conformance/results/pytype/classes_override.toml +++ b/conformance/results/pytype/classes_override.toml @@ -3,13 +3,47 @@ notes = """ Does not yet support the @override decorator. """ output = """ -File "classes_override.py", line 7, in : typing.override not supported yet [not-supported-yet] -File "classes_override.py", line 30, in method2: bad return type [bad-return-type] -File "classes_override.py", line 50, in method2: bad return type [bad-return-type] -File "classes_override.py", line 53, in ChildA: Attribute 'method3' not found on any parent class [override-error] -File "classes_override.py", line 57, in ChildA: Attribute 'method4' not found on any parent class [override-error] -File "classes_override.py", line 66, in method4: bad return type [bad-return-type] -File "classes_override.py", line 101, in ChildB: Attribute 'method1' not found on any parent class [override-error] +classes_override.py:7:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.override not supported yet [not-supported-yet] + +from typing import Any, Callable, overload, override +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +classes_override.py:30:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method2: bad return type [bad-return-type] + + return 0 + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +classes_override.py:50:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method2: bad return type [bad-return-type] + + return 0 + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +classes_override.py:53:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ChildA: Attribute 'method3' not found on any parent class [override-error] + + def method3(self) -> int: # E: no matching signature in ancestor + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + return 1 +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +classes_override.py:57:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ChildA: Attribute 'method4' not found on any parent class [override-error] + + def method4(self, x: int) -> int: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +classes_override.py:66:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method4: bad return type [bad-return-type] + + return 0 + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +classes_override.py:101:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ChildB: Attribute 'method1' not found on any parent class [override-error] + + def method1(self) -> None: # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -17,10 +51,10 @@ Line 79: Expected 1 errors Line 84: Expected 1 errors Line 89: Expected 1 errors Lines 56, 65: Expected error (tag 'method4') -Line 7: Unexpected errors ['File "classes_override.py", line 7, in : typing.override not supported yet [not-supported-yet]'] -Line 30: Unexpected errors ['File "classes_override.py", line 30, in method2: bad return type [bad-return-type]'] -Line 50: Unexpected errors ['File "classes_override.py", line 50, in method2: bad return type [bad-return-type]'] -Line 57: Unexpected errors ['File "classes_override.py", line 57, in ChildA: Attribute \\'method4\\' not found on any parent class [override-error]'] -Line 66: Unexpected errors ['File "classes_override.py", line 66, in method4: bad return type [bad-return-type]'] -Line 101: Unexpected errors ['File "classes_override.py", line 101, in ChildB: Attribute \\'method1\\' not found on any parent class [override-error]'] +Line 7: Unexpected errors ['classes_override.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.override not supported yet [not-supported-yet]'] +Line 30: Unexpected errors ['classes_override.py:30:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: bad return type [bad-return-type]'] +Line 50: Unexpected errors ['classes_override.py:50:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: bad return type [bad-return-type]'] +Line 57: Unexpected errors ["classes_override.py:57:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in ChildA: Attribute 'method4' not found on any parent class [override-error]"] +Line 66: Unexpected errors ['classes_override.py:66:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method4: bad return type [bad-return-type]'] +Line 101: Unexpected errors ["classes_override.py:101:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in ChildB: Attribute 'method1' not found on any parent class [override-error]"] """ diff --git a/conformance/results/pytype/constructors_call_init.toml b/conformance/results/pytype/constructors_call_init.toml index 0b8000993..b52f3b5b2 100644 --- a/conformance/results/pytype/constructors_call_init.toml +++ b/conformance/results/pytype/constructors_call_init.toml @@ -12,27 +12,79 @@ Line 21: Expected 1 errors Line 42: Expected 1 errors Line 56: Expected 1 errors Line 107: Expected 1 errors -Line 51: Unexpected errors ['File "constructors_call_init.py", line 51, in __init__: Invalid type annotation \\'Class4[int]\\' for self [invalid-annotation]'] -Line 72: Unexpected errors ['File "constructors_call_init.py", line 72, in : Class5 [assert-type]'] -Line 74: Unexpected errors ['File "constructors_call_init.py", line 74, in : Class5 [assert-type]'] -Line 88: Unexpected errors ['File "constructors_call_init.py", line 88, in Class6: Invalid type annotation \\'V2\\' [invalid-annotation]', 'File "constructors_call_init.py", line 88, in Class6: Invalid type annotation \\'V1\\' [invalid-annotation]', 'File "constructors_call_init.py", line 88, in __init__: Invalid type annotation \\'Class6[V1, V2]\\' for self [invalid-annotation]'] -Line 91: Unexpected errors ['File "constructors_call_init.py", line 91, in : Class6 [assert-type]'] -Line 96: Unexpected errors ['File "constructors_call_init.py", line 96, in Class7: Invalid type annotation \\'V2\\' [invalid-annotation]', 'File "constructors_call_init.py", line 96, in Class7: Invalid type annotation \\'V1\\' [invalid-annotation]', 'File "constructors_call_init.py", line 96, in __init__: Invalid type annotation \\'Class7[V2, V1]\\' for self [invalid-annotation]'] -Line 99: Unexpected errors ['File "constructors_call_init.py", line 99, in : Class7 [assert-type]'] -Line 108: Unexpected errors ['File "constructors_call_init.py", line 108, in __init__: Invalid type annotation \\'Class8[T2, T1]\\' for self [invalid-annotation]'] +Line 51: Unexpected errors ["constructors_call_init.py:51:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __init__: Invalid type annotation 'Class4[int]' for self [invalid-annotation]"] +Line 72: Unexpected errors ['constructors_call_init.py:72:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class5 [assert-type]'] +Line 74: Unexpected errors ['constructors_call_init.py:74:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class5 [assert-type]'] +Line 88: Unexpected errors ["constructors_call_init.py:88:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Class6: Invalid type annotation 'V2' [invalid-annotation]", "constructors_call_init.py:88:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Class6: Invalid type annotation 'V1' [invalid-annotation]", "constructors_call_init.py:88:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __init__: Invalid type annotation 'Class6[V1, V2]' for self [invalid-annotation]"] +Line 91: Unexpected errors ['constructors_call_init.py:91:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class6 [assert-type]'] +Line 96: Unexpected errors ["constructors_call_init.py:96:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Class7: Invalid type annotation 'V2' [invalid-annotation]", "constructors_call_init.py:96:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Class7: Invalid type annotation 'V1' [invalid-annotation]", "constructors_call_init.py:96:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __init__: Invalid type annotation 'Class7[V2, V1]' for self [invalid-annotation]"] +Line 99: Unexpected errors ['constructors_call_init.py:99:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class7 [assert-type]'] +Line 108: Unexpected errors ["constructors_call_init.py:108:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __init__: Invalid type annotation 'Class8[T2, T1]' for self [invalid-annotation]"] """ output = """ -File "constructors_call_init.py", line 51, in __init__: Invalid type annotation 'Class4[int]' for self [invalid-annotation] -File "constructors_call_init.py", line 72, in : Class5 [assert-type] -File "constructors_call_init.py", line 74, in : Class5 [assert-type] -File "constructors_call_init.py", line 88, in Class6: Invalid type annotation 'V2' [invalid-annotation] -File "constructors_call_init.py", line 88, in Class6: Invalid type annotation 'V1' [invalid-annotation] -File "constructors_call_init.py", line 88, in __init__: Invalid type annotation 'Class6[V1, V2]' for self [invalid-annotation] -File "constructors_call_init.py", line 91, in : Class6 [assert-type] -File "constructors_call_init.py", line 96, in Class7: Invalid type annotation 'V2' [invalid-annotation] -File "constructors_call_init.py", line 96, in Class7: Invalid type annotation 'V1' [invalid-annotation] -File "constructors_call_init.py", line 96, in __init__: Invalid type annotation 'Class7[V2, V1]' for self [invalid-annotation] -File "constructors_call_init.py", line 99, in : Class7 [assert-type] -File "constructors_call_init.py", line 108, in __init__: Invalid type annotation 'Class8[T2, T1]' for self [invalid-annotation] -File "constructors_call_init.py", line 130, in : Function Class11.__init__ expects 1 arg(s), got 2 [wrong-arg-count] +constructors_call_init.py:51:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __init__: Invalid type annotation 'Class4[int]' for self [invalid-annotation] + + def __init__(self: "Class4[int]") -> None: ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + +constructors_call_init.py:72:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class5 [assert-type] + +assert_type(Class5(0), Class5[list[int]]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_init.py:74:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class5 [assert-type] + +assert_type(Class5(""), Class5[set[str]]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_init.py:88:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Class6: Invalid type annotation 'V2' [invalid-annotation] + + def __init__(self: "Class6[V1, V2]", value1: V1, value2: V2) -> None: ... + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_init.py:88:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Class6: Invalid type annotation 'V1' [invalid-annotation] + + def __init__(self: "Class6[V1, V2]", value1: V1, value2: V2) -> None: ... + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_init.py:88:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __init__: Invalid type annotation 'Class6[V1, V2]' for self [invalid-annotation] + + def __init__(self: "Class6[V1, V2]", value1: V1, value2: V2) -> None: ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + +constructors_call_init.py:91:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class6 [assert-type] + +assert_type(Class6(0, ""), Class6[int, str]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_init.py:96:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Class7: Invalid type annotation 'V2' [invalid-annotation] + + def __init__(self: "Class7[V2, V1]", value1: V1, value2: V2) -> None: ... + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_init.py:96:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Class7: Invalid type annotation 'V1' [invalid-annotation] + + def __init__(self: "Class7[V2, V1]", value1: V1, value2: V2) -> None: ... + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_init.py:96:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __init__: Invalid type annotation 'Class7[V2, V1]' for self [invalid-annotation] + + def __init__(self: "Class7[V2, V1]", value1: V1, value2: V2) -> None: ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + +constructors_call_init.py:99:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class7 [assert-type] + +assert_type(Class7(0, ""), Class7[str, int]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_init.py:108:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __init__: Invalid type annotation 'Class8[T2, T1]' for self [invalid-annotation] + + pass + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +constructors_call_init.py:130:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Class11.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Class11(1) # E +\u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + """ diff --git a/conformance/results/pytype/constructors_call_metaclass.toml b/conformance/results/pytype/constructors_call_metaclass.toml index 377ea2840..3fe225c40 100644 --- a/conformance/results/pytype/constructors_call_metaclass.toml +++ b/conformance/results/pytype/constructors_call_metaclass.toml @@ -4,14 +4,38 @@ Does not honor metaclass __call__ method when evaluating constructor call. """ conformance_automated = "Fail" errors_diff = """ -Line 23: Unexpected errors ['File "constructors_call_metaclass.py", line 23, in : Missing parameter \\'x\\' in call to function Class1.__new__ [missing-parameter]', 'File "constructors_call_metaclass.py", line 23, in : Any [assert-type]'] -Line 36: Unexpected errors ['File "constructors_call_metaclass.py", line 36, in : Missing parameter \\'x\\' in call to function Class2.__new__ [missing-parameter]', 'File "constructors_call_metaclass.py", line 36, in : Any [assert-type]'] +Line 23: Unexpected errors ["constructors_call_metaclass.py:23:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'x' in call to function Class1.__new__ [missing-parameter]", 'constructors_call_metaclass.py:23:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] +Line 36: Unexpected errors ["constructors_call_metaclass.py:36:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'x' in call to function Class2.__new__ [missing-parameter]", 'constructors_call_metaclass.py:36:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] """ output = """ -File "constructors_call_metaclass.py", line 23, in : Missing parameter 'x' in call to function Class1.__new__ [missing-parameter] -File "constructors_call_metaclass.py", line 23, in : Any [assert-type] -File "constructors_call_metaclass.py", line 36, in : Missing parameter 'x' in call to function Class2.__new__ [missing-parameter] -File "constructors_call_metaclass.py", line 36, in : Any [assert-type] -File "constructors_call_metaclass.py", line 51, in : Missing parameter 'x' in call to function Class3.__new__ [missing-parameter] -File "constructors_call_metaclass.py", line 65, in : Missing parameter 'x' in call to function Class4.__new__ [missing-parameter] +constructors_call_metaclass.py:23:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'x' in call to function Class1.__new__ [missing-parameter] + +assert_type(Class1(), NoReturn) + \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_metaclass.py:23:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(Class1(), NoReturn) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_metaclass.py:36:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'x' in call to function Class2.__new__ [missing-parameter] + +assert_type(Class2(), int | Meta2) + \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_metaclass.py:36:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(Class2(), int | Meta2) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_metaclass.py:51:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'x' in call to function Class3.__new__ [missing-parameter] + +Class3() # E: Missing argument for 'x' parameter in __new__ +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_metaclass.py:65:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'x' in call to function Class4.__new__ [missing-parameter] + +Class4() # E: Missing argument for 'x' parameter in __new__ +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + """ diff --git a/conformance/results/pytype/constructors_call_new.toml b/conformance/results/pytype/constructors_call_new.toml index 022364fe5..970a8bbe3 100644 --- a/conformance/results/pytype/constructors_call_new.toml +++ b/conformance/results/pytype/constructors_call_new.toml @@ -7,19 +7,43 @@ Does not skip evaluation of __init__ based on __new__ return type. conformance_automated = "Fail" errors_diff = """ Line 21: Expected 1 errors -Line 76: Unexpected errors ['File "constructors_call_new.py", line 76, in : Any [assert-type]'] -Line 89: Unexpected errors ['File "constructors_call_new.py", line 89, in : Missing parameter \\'x\\' in call to function Class6.__init__ [missing-parameter]'] -Line 113: Unexpected errors ['File "constructors_call_new.py", line 113, in __new__: bad return type [bad-return-type]'] -Line 125: Unexpected errors ['File "constructors_call_new.py", line 125, in __new__: bad return type [bad-return-type]'] -Line 140: Unexpected errors ['File "constructors_call_new.py", line 140, in __new__: bad return type [bad-return-type]'] +Line 76: Unexpected errors ['constructors_call_new.py:76:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] +Line 89: Unexpected errors ["constructors_call_new.py:89:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'x' in call to function Class6.__init__ [missing-parameter]"] +Line 113: Unexpected errors ['constructors_call_new.py:113:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __new__: bad return type [bad-return-type]'] +Line 125: Unexpected errors ['constructors_call_new.py:125:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __new__: bad return type [bad-return-type]'] +Line 140: Unexpected errors ['constructors_call_new.py:140:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __new__: bad return type [bad-return-type]'] """ output = """ -File "constructors_call_new.py", line 76, in : Any [assert-type] -File "constructors_call_new.py", line 89, in : Missing parameter 'x' in call to function Class6.__init__ [missing-parameter] -File "constructors_call_new.py", line 113, in __new__: bad return type [bad-return-type] -File "constructors_call_new.py", line 125, in __new__: bad return type [bad-return-type] -File "constructors_call_new.py", line 140, in __new__: bad return type [bad-return-type] +constructors_call_new.py:76:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + + assert_type(Class5(), NoReturn) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_new.py:89:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'x' in call to function Class6.__init__ [missing-parameter] + +assert_type(Class6(), int | Class6) + \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_new.py:113:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __new__: bad return type [bad-return-type] + + def __new__(cls, *args, **kwargs) -> "Class8[list[T]]": ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + +constructors_call_new.py:125:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __new__: bad return type [bad-return-type] + + def __new__(cls, *args, **kwargs) -> Self: ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + +constructors_call_new.py:140:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __new__: bad return type [bad-return-type] + + def __new__(cls: "type[Class11[int]]") -> "Class11[int]": ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + Called from (traceback): line 143, in current file -File "constructors_call_new.py", line 145, in : Function Class11.__new__ was called with the wrong arguments [wrong-arg-types] +constructors_call_new.py:145:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Class11.__new__ was called with the wrong arguments [wrong-arg-types] + +Class11[str]() # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ diff --git a/conformance/results/pytype/constructors_call_type.toml b/conformance/results/pytype/constructors_call_type.toml index 7c07a5f50..9af05589a 100644 --- a/conformance/results/pytype/constructors_call_type.toml +++ b/conformance/results/pytype/constructors_call_type.toml @@ -9,18 +9,46 @@ Line 64: Expected 1 errors Line 72: Expected 1 errors Line 81: Expected 1 errors Line 82: Expected 1 errors -Line 25: Unexpected errors ['File "constructors_call_type.py", line 25, in __new__: Missing parameter \\'cls\\' in call to function object.__new__ [missing-parameter]', 'File "constructors_call_type.py", line 25, in __new__: Invalid keyword arguments (x, y) to function object.__new__ [wrong-keyword-args]'] -Line 62: Unexpected errors ['File "constructors_call_type.py", line 62, in : Invalid type annotation \\'T\\' [invalid-annotation]'] +Line 25: Unexpected errors ["constructors_call_type.py:25:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __new__: Missing parameter 'cls' in call to function object.__new__ [missing-parameter]", 'constructors_call_type.py:25:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __new__: Invalid keyword arguments (x, y) to function object.__new__ [wrong-keyword-args]'] +Line 62: Unexpected errors ["constructors_call_type.py:62:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T' [invalid-annotation]"] """ output = """ -File "constructors_call_type.py", line 25, in __new__: Missing parameter 'cls' in call to function object.__new__ [missing-parameter] +constructors_call_type.py:25:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __new__: Missing parameter 'cls' in call to function object.__new__ [missing-parameter] + + return super().__new__(*args, **kwargs) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + Called from (traceback): line 30, in func1 -File "constructors_call_type.py", line 25, in __new__: Invalid keyword arguments (x, y) to function object.__new__ [wrong-keyword-args] +constructors_call_type.py:25:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __new__: Invalid keyword arguments (x, y) to function object.__new__ [wrong-keyword-args] + + return super().__new__(*args, **kwargs) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + Called from (traceback): line 29, in func1 -File "constructors_call_type.py", line 40, in func2: Missing parameter 'x' in call to function Class2.__new__ [missing-parameter] -File "constructors_call_type.py", line 50, in func3: Missing parameter 'x' in call to function Class3.__init__ [missing-parameter] -File "constructors_call_type.py", line 59, in func4: Function Class4.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "constructors_call_type.py", line 62, in : Invalid type annotation 'T' [invalid-annotation] +constructors_call_type.py:40:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Missing parameter 'x' in call to function Class2.__new__ [missing-parameter] + + cls() # E + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +constructors_call_type.py:50:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Missing parameter 'x' in call to function Class3.__init__ [missing-parameter] + + cls() # E + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +constructors_call_type.py:59:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func4: Function Class4.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + + cls(1) # E + \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +constructors_call_type.py:62:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T' [invalid-annotation] + +def func5(cls: type[T]): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + cls() # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + cls(1) # E +\u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + """ diff --git a/conformance/results/pytype/constructors_callable.toml b/conformance/results/pytype/constructors_callable.toml index e1199f524..0074fa180 100644 --- a/conformance/results/pytype/constructors_callable.toml +++ b/conformance/results/pytype/constructors_callable.toml @@ -10,69 +10,221 @@ errors_diff = """ Line 51: Expected 1 errors Line 127: Expected 1 errors Line 144: Expected 1 errors -Line 36: Unexpected errors ['File "constructors_callable.py", line 36, in : Callable[[Any], Class1] [reveal-type]'] -Line 49: Unexpected errors ['File "constructors_callable.py", line 49, in : Callable[[Any], Class2] [reveal-type]'] -Line 50: Unexpected errors ['File "constructors_callable.py", line 50, in : Function expects 1 arg(s), got 0 [wrong-arg-count]', 'File "constructors_callable.py", line 50, in : Any [assert-type]'] -Line 57: Unexpected errors ['File "constructors_callable.py", line 57, in __new__: bad return type [bad-return-type]'] -Line 63: Unexpected errors ['File "constructors_callable.py", line 63, in : Callable[[Any], Class3] [reveal-type]'] -Line 73: Unexpected errors ['File "constructors_callable.py", line 73, in __new__: bad return type [bad-return-type]'] -Line 77: Unexpected errors ['File "constructors_callable.py", line 77, in : Callable[[Any], Class4] [reveal-type]'] -Line 78: Unexpected errors ['File "constructors_callable.py", line 78, in : nothing [assert-type]'] -Line 97: Unexpected errors ['File "constructors_callable.py", line 97, in : Callable[[Any], Class5] [reveal-type]'] -Line 100: Unexpected errors ['File "constructors_callable.py", line 100, in : Function expects 1 arg(s), got 0 [wrong-arg-count]', 'File "constructors_callable.py", line 100, in : Any [assert-type]'] -Line 105: Unexpected errors ['File "constructors_callable.py", line 105, in : Invalid keyword argument x to function [wrong-keyword-args]', 'File "constructors_callable.py", line 105, in : Any [assert-type]'] -Line 125: Unexpected errors ['File "constructors_callable.py", line 125, in : Callable[[Any], Class6] [reveal-type]'] -Line 126: Unexpected errors ['File "constructors_callable.py", line 126, in : Function expects 1 arg(s), got 0 [wrong-arg-count]', 'File "constructors_callable.py", line 126, in : Any [assert-type]'] -Line 142: Unexpected errors ['File "constructors_callable.py", line 142, in : Callable[[Any], Class6Any] [reveal-type]'] -Line 143: Unexpected errors ['File "constructors_callable.py", line 143, in : Function expects 1 arg(s), got 0 [wrong-arg-count]'] -Line 161: Unexpected errors ['File "constructors_callable.py", line 161, in : Callable[[Any], Class7] [reveal-type]'] -Line 164: Unexpected errors ['File "constructors_callable.py", line 164, in : Class7 [assert-type]'] -Line 165: Unexpected errors ['File "constructors_callable.py", line 165, in : Class7 [assert-type]'] -Line 182: Unexpected errors ['File "constructors_callable.py", line 182, in : Callable[[Any], Class8[nothing]] [reveal-type]'] -Line 183: Unexpected errors ['File "constructors_callable.py", line 183, in : Function expects 1 arg(s), got 2 [wrong-arg-count]', 'File "constructors_callable.py", line 183, in : Any [assert-type]'] -Line 193: Unexpected errors ['File "constructors_callable.py", line 193, in : Callable[[Any], Class9] [reveal-type]'] -Line 194: Unexpected errors ['File "constructors_callable.py", line 194, in : Function expects 1 arg(s), got 2 [wrong-arg-count]', 'File "constructors_callable.py", line 194, in : Any [assert-type]'] +Line 36: Unexpected errors ['constructors_callable.py:36:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class1] [reveal-type]'] +Line 49: Unexpected errors ['constructors_callable.py:49:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class2] [reveal-type]'] +Line 50: Unexpected errors ['constructors_callable.py:50:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count]', 'constructors_callable.py:50:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] +Line 57: Unexpected errors ['constructors_callable.py:57:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __new__: bad return type [bad-return-type]'] +Line 63: Unexpected errors ['constructors_callable.py:63:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class3] [reveal-type]'] +Line 73: Unexpected errors ['constructors_callable.py:73:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __new__: bad return type [bad-return-type]'] +Line 77: Unexpected errors ['constructors_callable.py:77:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class4] [reveal-type]'] +Line 78: Unexpected errors ['constructors_callable.py:78:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : nothing [assert-type]'] +Line 97: Unexpected errors ['constructors_callable.py:97:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class5] [reveal-type]'] +Line 100: Unexpected errors ['constructors_callable.py:100:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count]', 'constructors_callable.py:100:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] +Line 105: Unexpected errors ['constructors_callable.py:105:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid keyword argument x to function [wrong-keyword-args]', 'constructors_callable.py:105:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] +Line 125: Unexpected errors ['constructors_callable.py:125:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class6] [reveal-type]'] +Line 126: Unexpected errors ['constructors_callable.py:126:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count]', 'constructors_callable.py:126:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] +Line 142: Unexpected errors ['constructors_callable.py:142:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class6Any] [reveal-type]'] +Line 143: Unexpected errors ['constructors_callable.py:143:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count]'] +Line 161: Unexpected errors ['constructors_callable.py:161:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class7] [reveal-type]'] +Line 164: Unexpected errors ['constructors_callable.py:164:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class7 [assert-type]'] +Line 165: Unexpected errors ['constructors_callable.py:165:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class7 [assert-type]'] +Line 182: Unexpected errors ['constructors_callable.py:182:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class8[nothing]] [reveal-type]'] +Line 183: Unexpected errors ['constructors_callable.py:183:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function expects 1 arg(s), got 2 [wrong-arg-count]', 'constructors_callable.py:183:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] +Line 193: Unexpected errors ['constructors_callable.py:193:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class9] [reveal-type]'] +Line 194: Unexpected errors ['constructors_callable.py:194:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function expects 1 arg(s), got 2 [wrong-arg-count]', 'constructors_callable.py:194:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] """ output = """ -File "constructors_callable.py", line 36, in : Callable[[Any], Class1] [reveal-type] -File "constructors_callable.py", line 38, in : Function expects 1 arg(s), got 0 [wrong-arg-count] -File "constructors_callable.py", line 39, in : Invalid keyword argument y to function [wrong-keyword-args] -File "constructors_callable.py", line 49, in : Callable[[Any], Class2] [reveal-type] -File "constructors_callable.py", line 50, in : Function expects 1 arg(s), got 0 [wrong-arg-count] -File "constructors_callable.py", line 50, in : Any [assert-type] -File "constructors_callable.py", line 57, in __new__: bad return type [bad-return-type] +constructors_callable.py:36:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class1] [reveal-type] + +reveal_type(r1) # `def (x: int) -> Class1` +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:38:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count] + +r1() # E +\u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +constructors_callable.py:39:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument y to function [wrong-keyword-args] + +r1(y=1) # E +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:49:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class2] [reveal-type] + +reveal_type(r2) # `def () -> Class2` +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:50:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count] + +assert_type(r2(), Class2) + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +constructors_callable.py:50:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(r2(), Class2) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:57:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __new__: bad return type [bad-return-type] + + def __new__(cls, *args, **kwargs) -> Self: ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + Called from (traceback): line 64, in current file -File "constructors_callable.py", line 63, in : Callable[[Any], Class3] [reveal-type] -File "constructors_callable.py", line 65, in : Function expects 1 arg(s), got 0 [wrong-arg-count] -File "constructors_callable.py", line 66, in : Invalid keyword argument y to function [wrong-keyword-args] -File "constructors_callable.py", line 67, in : Function expects 1 arg(s), got 2 [wrong-arg-count] -File "constructors_callable.py", line 73, in __new__: bad return type [bad-return-type] +constructors_callable.py:63:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class3] [reveal-type] + +reveal_type(r3) # `def (x: int) -> Class3` +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:65:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count] + +r3() # E +\u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +constructors_callable.py:66:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument y to function [wrong-keyword-args] + +r3(y=1) # E +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:67:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 2 [wrong-arg-count] + +r3(1, 2) # E +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:73:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __new__: bad return type [bad-return-type] + + def __new__(cls, x: int) -> int: ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + Called from (traceback): line 78, in current file -File "constructors_callable.py", line 77, in : Callable[[Any], Class4] [reveal-type] -File "constructors_callable.py", line 78, in : nothing [assert-type] -File "constructors_callable.py", line 79, in : Function expects 1 arg(s), got 0 [wrong-arg-count] -File "constructors_callable.py", line 80, in : Invalid keyword argument y to function [wrong-keyword-args] -File "constructors_callable.py", line 97, in : Callable[[Any], Class5] [reveal-type] -File "constructors_callable.py", line 100, in : Function expects 1 arg(s), got 0 [wrong-arg-count] -File "constructors_callable.py", line 100, in : Any [assert-type] -File "constructors_callable.py", line 105, in : Invalid keyword argument x to function [wrong-keyword-args] -File "constructors_callable.py", line 105, in : Any [assert-type] -File "constructors_callable.py", line 125, in : Callable[[Any], Class6] [reveal-type] -File "constructors_callable.py", line 126, in : Function expects 1 arg(s), got 0 [wrong-arg-count] -File "constructors_callable.py", line 126, in : Any [assert-type] -File "constructors_callable.py", line 142, in : Callable[[Any], Class6Any] [reveal-type] -File "constructors_callable.py", line 143, in : Function expects 1 arg(s), got 0 [wrong-arg-count] -File "constructors_callable.py", line 161, in : Callable[[Any], Class7] [reveal-type] -File "constructors_callable.py", line 164, in : Class7 [assert-type] -File "constructors_callable.py", line 165, in : Class7 [assert-type] -File "constructors_callable.py", line 182, in : Callable[[Any], Class8[nothing]] [reveal-type] -File "constructors_callable.py", line 183, in : Function expects 1 arg(s), got 2 [wrong-arg-count] -File "constructors_callable.py", line 183, in : Any [assert-type] -File "constructors_callable.py", line 184, in : Function expects 1 arg(s), got 2 [wrong-arg-count] -File "constructors_callable.py", line 193, in : Callable[[Any], Class9] [reveal-type] -File "constructors_callable.py", line 194, in : Function expects 1 arg(s), got 2 [wrong-arg-count] -File "constructors_callable.py", line 194, in : Any [assert-type] -File "constructors_callable.py", line 195, in : Function expects 1 arg(s), got 2 [wrong-arg-count] +constructors_callable.py:77:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class4] [reveal-type] + +reveal_type(r4) # `def (x: int) -> int` +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:78:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : nothing [assert-type] + +assert_type(r4(1), int) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:79:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count] + +r4() # E +\u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +constructors_callable.py:80:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument y to function [wrong-keyword-args] + +r4(y=1) # E +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:97:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class5] [reveal-type] + +reveal_type(r5) # `def (*args: Any, **kwargs: Any) -> NoReturn` +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:100:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count] + + assert_type(r5(), NoReturn) + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +constructors_callable.py:100:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + + assert_type(r5(), NoReturn) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:105:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument x to function [wrong-keyword-args] + + assert_type(r5(1, x=1), NoReturn) + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:105:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + + assert_type(r5(1, x=1), NoReturn) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:125:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class6] [reveal-type] + +reveal_type(r6) # `def () -> Class6Proxy` +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:126:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count] + +assert_type(r6(), Class6Proxy) + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +constructors_callable.py:126:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(r6(), Class6Proxy) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:142:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class6Any] [reveal-type] + +reveal_type(r6_any) # `def () -> Any` +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:143:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count] + +assert_type(r6_any(), Any) + \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:161:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class7] [reveal-type] + +reveal_type( +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + r7 +\u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m +) # overload of `def (x: int) -> Class7[int]` and `def (x: str) -> Class7[str]` +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +constructors_callable.py:164:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class7 [assert-type] + +assert_type(r7(0), Class7[int]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:165:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class7 [assert-type] + +assert_type(r7(""), Class7[str]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:182:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class8[nothing]] [reveal-type] + +reveal_type(r8) # `def [T] (x: T, y: list[T]) -> Class8[T]` +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:183:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 2 [wrong-arg-count] + +assert_type(r8([""], [""]), Class8[str]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:183:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(r8([""], [""]), Class8[str]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:184:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 2 [wrong-arg-count] + +r8([1], [""]) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:193:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class9] [reveal-type] + +reveal_type(r9) # `def [T] (x: list[T], y: list[T]) -> Class9` +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:194:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 2 [wrong-arg-count] + +assert_type(r9([""], [""]), Class9) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:194:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(r9([""], [""]), Class9) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:195:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 2 [wrong-arg-count] + +r9([1], [""]) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ diff --git a/conformance/results/pytype/dataclasses_descriptors.toml b/conformance/results/pytype/dataclasses_descriptors.toml index f27186ccd..04f115500 100644 --- a/conformance/results/pytype/dataclasses_descriptors.toml +++ b/conformance/results/pytype/dataclasses_descriptors.toml @@ -3,36 +3,76 @@ notes = """ Does not understand descriptor objects in dataclass. """ output = """ -File "dataclasses_descriptors.py", line 24, in __get__: bad return type [bad-return-type] +dataclasses_descriptors.py:24:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __get__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 38, in current file -File "dataclasses_descriptors.py", line 24, in __get__: bad return type [bad-return-type] +dataclasses_descriptors.py:24:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __get__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 37, in current file -File "dataclasses_descriptors.py", line 35, in : Function DC1.__init__ was called with the wrong arguments [wrong-arg-types] -File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type] +dataclasses_descriptors.py:35:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC1.__init__ was called with the wrong arguments [wrong-arg-types] + +dc1 = DC1(3) + \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +dataclasses_descriptors.py:51:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __get__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 68, in current file -File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type] +dataclasses_descriptors.py:51:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __get__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 67, in current file -File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type] +dataclasses_descriptors.py:51:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __get__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 66, in current file -File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type] +dataclasses_descriptors.py:51:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __get__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 63, in current file -File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type] +dataclasses_descriptors.py:51:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __get__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 62, in current file -File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type] +dataclasses_descriptors.py:51:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __get__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 61, in current file -File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type] +dataclasses_descriptors.py:51:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __get__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 24: Unexpected errors ['File "dataclasses_descriptors.py", line 24, in __get__: bad return type [bad-return-type]', 'File "dataclasses_descriptors.py", line 24, in __get__: bad return type [bad-return-type]'] -Line 35: Unexpected errors ['File "dataclasses_descriptors.py", line 35, in : Function DC1.__init__ was called with the wrong arguments [wrong-arg-types]'] -Line 51: Unexpected errors ['File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type]', 'File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type]', 'File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type]', 'File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type]', 'File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type]', 'File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type]', 'File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type]'] +Line 24: Unexpected errors ['dataclasses_descriptors.py:24:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __get__: bad return type [bad-return-type]', 'dataclasses_descriptors.py:24:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __get__: bad return type [bad-return-type]'] +Line 35: Unexpected errors ['dataclasses_descriptors.py:35:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function DC1.__init__ was called with the wrong arguments [wrong-arg-types]'] +Line 51: Unexpected errors ['dataclasses_descriptors.py:51:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __get__: bad return type [bad-return-type]', 'dataclasses_descriptors.py:51:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __get__: bad return type [bad-return-type]', 'dataclasses_descriptors.py:51:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __get__: bad return type [bad-return-type]', 'dataclasses_descriptors.py:51:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __get__: bad return type [bad-return-type]', 'dataclasses_descriptors.py:51:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __get__: bad return type [bad-return-type]', 'dataclasses_descriptors.py:51:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __get__: bad return type [bad-return-type]', 'dataclasses_descriptors.py:51:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __get__: bad return type [bad-return-type]'] """ diff --git a/conformance/results/pytype/dataclasses_final.toml b/conformance/results/pytype/dataclasses_final.toml index 3e6e604f3..7d9d915f0 100644 --- a/conformance/results/pytype/dataclasses_final.toml +++ b/conformance/results/pytype/dataclasses_final.toml @@ -6,12 +6,28 @@ errors_diff = """ Line 27: Expected 1 errors Line 35: Expected 1 errors Line 37: Expected 1 errors -Line 18: Unexpected errors ['File "dataclasses_final.py", line 18, in D: Invalid use of typing.Final [final-error]', 'File "dataclasses_final.py", line 18, in D: Invalid type annotation \\'ClassVar[Final[int]]\\' [invalid-annotation]'] +Line 18: Unexpected errors ['dataclasses_final.py:18:21: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in D: Invalid use of typing.Final [final-error]', "dataclasses_final.py:18:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in D: Invalid type annotation 'ClassVar[Final[int]]' [invalid-annotation]"] """ output = """ -File "dataclasses_final.py", line 18, in D: Invalid use of typing.Final [final-error] -File "dataclasses_final.py", line 18, in D: Invalid type annotation 'ClassVar[Final[int]]' [invalid-annotation] -File "dataclasses_final.py", line 36, in : Assigning to attribute final_with_default, which was annotated with Final [final-error] -File "dataclasses_final.py", line 38, in : Assigning to attribute final_with_default, which was annotated with Final [final-error] +dataclasses_final.py:18:21: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in D: Invalid use of typing.Final [final-error] + + final_classvar: ClassVar[Final[int]] = 4 + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_final.py:18:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in D: Invalid type annotation 'ClassVar[Final[int]]' [invalid-annotation] + + final_classvar: ClassVar[Final[int]] = 4 + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_final.py:36:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Assigning to attribute final_with_default, which was annotated with Final [final-error] + +d.final_with_default = "baz" # E: can't assign to final attribute +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_final.py:38:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Assigning to attribute final_with_default, which was annotated with Final [final-error] + +D.final_with_default = "baz" # E: can't assign to final attribute +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" diff --git a/conformance/results/pytype/dataclasses_kwonly.toml b/conformance/results/pytype/dataclasses_kwonly.toml index 76a22f8af..4166e7030 100644 --- a/conformance/results/pytype/dataclasses_kwonly.toml +++ b/conformance/results/pytype/dataclasses_kwonly.toml @@ -4,18 +4,46 @@ Incorrectly reports error when kw_only field has default value. Incorrectly rejects kw_only field with default before positional field. """ output = """ -File "dataclasses_kwonly.py", line 23, in : Function DC1.__init__ expects 2 arg(s), got 3 [wrong-arg-count] -File "dataclasses_kwonly.py", line 38, in : Function DC2.__init__ expects 2 arg(s), got 3 [wrong-arg-count] -File "dataclasses_kwonly.py", line 47, in : Missing parameter 'a' in call to function DC3.__init__ [missing-parameter] -File "dataclasses_kwonly.py", line 50, in : Missing parameter 'a' in call to function DC3.__init__ [missing-parameter] -File "dataclasses_kwonly.py", line 53, in : Missing parameter 'a' in call to function DC3.__init__ [missing-parameter] -File "dataclasses_kwonly.py", line 56, in : In method __init__, non-default argument c follows default argument [invalid-function-definition] -File "dataclasses_kwonly.py", line 61, in : function DC4.__init__ got multiple values for keyword argument 'b' [duplicate-keyword-argument] +dataclasses_kwonly.py:23:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC1.__init__ expects 2 arg(s), got 3 [wrong-arg-count] + +DC1("hi", 1) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_kwonly.py:38:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC2.__init__ expects 2 arg(s), got 3 [wrong-arg-count] + +DC2("hi", 1) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_kwonly.py:47:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'a' in call to function DC3.__init__ [missing-parameter] + +DC3("hi") +\u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_kwonly.py:50:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'a' in call to function DC3.__init__ [missing-parameter] + +DC3("hi", b=1) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_kwonly.py:53:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'a' in call to function DC3.__init__ [missing-parameter] + +DC3("hi", 1) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_kwonly.py:56:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : In method __init__, non-default argument c follows default argument [invalid-function-definition] + +@dataclass + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_kwonly.py:61:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : function DC4.__init__ got multiple values for keyword argument 'b' [duplicate-keyword-argument] + +DC4("", 0.2, b=3) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 47: Unexpected errors ['File "dataclasses_kwonly.py", line 47, in : Missing parameter \\'a\\' in call to function DC3.__init__ [missing-parameter]'] -Line 50: Unexpected errors ['File "dataclasses_kwonly.py", line 50, in : Missing parameter \\'a\\' in call to function DC3.__init__ [missing-parameter]'] -Line 56: Unexpected errors ['File "dataclasses_kwonly.py", line 56, in : In method __init__, non-default argument c follows default argument [invalid-function-definition]'] -Line 61: Unexpected errors ['File "dataclasses_kwonly.py", line 61, in : function DC4.__init__ got multiple values for keyword argument \\'b\\' [duplicate-keyword-argument]'] +Line 47: Unexpected errors ["dataclasses_kwonly.py:47:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'a' in call to function DC3.__init__ [missing-parameter]"] +Line 50: Unexpected errors ["dataclasses_kwonly.py:50:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'a' in call to function DC3.__init__ [missing-parameter]"] +Line 56: Unexpected errors ['dataclasses_kwonly.py:56:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : In method __init__, non-default argument c follows default argument [invalid-function-definition]'] +Line 61: Unexpected errors ["dataclasses_kwonly.py:61:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : function DC4.__init__ got multiple values for keyword argument 'b' [duplicate-keyword-argument]"] """ diff --git a/conformance/results/pytype/dataclasses_postinit.toml b/conformance/results/pytype/dataclasses_postinit.toml index cf8fa0720..286e7a3d9 100644 --- a/conformance/results/pytype/dataclasses_postinit.toml +++ b/conformance/results/pytype/dataclasses_postinit.toml @@ -4,13 +4,27 @@ Does not validate `__post_init__` method. Reports incorrect error for incompatible `__post_init__` method override. """ output = """ -File "dataclasses_postinit.py", line 28, in : No attribute 'x' on DC1 [attribute-error] -File "dataclasses_postinit.py", line 29, in : No attribute 'y' on DC1 [attribute-error] -File "dataclasses_postinit.py", line 54, in DC4: Overriding method signature mismatch [signature-mismatch] +dataclasses_postinit.py:28:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'x' on DC1 [attribute-error] + +print(dc1.x) # E: cannot access InitVar + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +dataclasses_postinit.py:29:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'y' on DC1 [attribute-error] + +print(dc1.y) # E: cannot access InitVar + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +dataclasses_postinit.py:54:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in DC4: Overriding method signature mismatch [signature-mismatch] + + def __post_init__(self, _name: str, _age: int): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 19: Expected 1 errors Line 36: Expected 1 errors -Line 54: Unexpected errors ['File "dataclasses_postinit.py", line 54, in DC4: Overriding method signature mismatch [signature-mismatch]'] +Line 54: Unexpected errors ['dataclasses_postinit.py:54:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in DC4: Overriding method signature mismatch [signature-mismatch]'] """ diff --git a/conformance/results/pytype/dataclasses_slots.toml b/conformance/results/pytype/dataclasses_slots.toml index e9c80134a..be10aba0c 100644 --- a/conformance/results/pytype/dataclasses_slots.toml +++ b/conformance/results/pytype/dataclasses_slots.toml @@ -5,16 +5,32 @@ Does not reject write to instance variable that is not defined in __slots__. Incorrectly reports error when accessing `__slots__` when `slots=True`. """ output = """ -File "dataclasses_slots.py", line 56, in : No attribute '__slots__' on Type[DC5] [attribute-error] -File "dataclasses_slots.py", line 57, in : No attribute '__slots__' on DC5 [attribute-error] -File "dataclasses_slots.py", line 66, in : No attribute '__slots__' on Type[DC6] [attribute-error] -File "dataclasses_slots.py", line 69, in : No attribute '__slots__' on DC6 [attribute-error] +dataclasses_slots.py:56:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute '__slots__' on Type[DC5] [attribute-error] + +DC5.__slots__ +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_slots.py:57:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute '__slots__' on DC5 [attribute-error] + +DC5(1).__slots__ +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_slots.py:66:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute '__slots__' on Type[DC6] [attribute-error] + +DC6.__slots__ # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_slots.py:69:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute '__slots__' on DC6 [attribute-error] + +DC6(1).__slots__ # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 25: Expected 1 errors Line 38: Expected 1 errors Lines 10, 11: Expected error (tag 'DC1') -Line 56: Unexpected errors ['File "dataclasses_slots.py", line 56, in : No attribute \\'__slots__\\' on Type[DC5] [attribute-error]'] -Line 57: Unexpected errors ['File "dataclasses_slots.py", line 57, in : No attribute \\'__slots__\\' on DC5 [attribute-error]'] +Line 56: Unexpected errors ["dataclasses_slots.py:56:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : No attribute '__slots__' on Type[DC5] [attribute-error]"] +Line 57: Unexpected errors ["dataclasses_slots.py:57:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : No attribute '__slots__' on DC5 [attribute-error]"] """ diff --git a/conformance/results/pytype/dataclasses_transform_class.toml b/conformance/results/pytype/dataclasses_transform_class.toml index 8d25adeb7..5bbaceedc 100644 --- a/conformance/results/pytype/dataclasses_transform_class.toml +++ b/conformance/results/pytype/dataclasses_transform_class.toml @@ -3,11 +3,43 @@ notes = """ Does not understand @dataclass_transform. """ output = """ -File "dataclasses_transform_class.py", line 23, in : Arguments to dataclass_transform not supported yet [not-supported-yet] -File "dataclasses_transform_class.py", line 60, in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args] -File "dataclasses_transform_class.py", line 85, in : Arguments to dataclass_transform not supported yet [not-supported-yet] -File "dataclasses_transform_class.py", line 106, in : Invalid keyword argument id to function GenericCustomer.__init__ [wrong-keyword-args] -File "dataclasses_transform_class.py", line 109, in : Arguments to dataclass_transform not supported yet [not-supported-yet] +dataclasses_transform_class.py:23:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] + +@dataclass_transform( + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + kw_only_default=True, +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + field_specifiers=(ModelField, model_field), +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +) +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +dataclasses_transform_class.py:60:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args] + +c1_1 = Customer1(id=3, name="Sue", other_name="Susan") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_class.py:85:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] + +@dataclass_transform( + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + kw_only_default=True, +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + field_specifiers=(ModelField, model_field), +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +) +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +dataclasses_transform_class.py:106:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument id to function GenericCustomer.__init__ [wrong-keyword-args] + +gc_1 = GenericCustomer(id=3) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_class.py:109:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] + +@dataclass_transform(frozen_default=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -17,9 +49,9 @@ Line 66: Expected 1 errors Line 72: Expected 1 errors Line 82: Expected 1 errors Line 122: Expected 1 errors -Line 23: Unexpected errors ['File "dataclasses_transform_class.py", line 23, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] -Line 60: Unexpected errors ['File "dataclasses_transform_class.py", line 60, in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args]'] -Line 85: Unexpected errors ['File "dataclasses_transform_class.py", line 85, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] -Line 106: Unexpected errors ['File "dataclasses_transform_class.py", line 106, in : Invalid keyword argument id to function GenericCustomer.__init__ [wrong-keyword-args]'] -Line 109: Unexpected errors ['File "dataclasses_transform_class.py", line 109, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 23: Unexpected errors ['dataclasses_transform_class.py:23:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 60: Unexpected errors ['dataclasses_transform_class.py:60:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args]'] +Line 85: Unexpected errors ['dataclasses_transform_class.py:85:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 106: Unexpected errors ['dataclasses_transform_class.py:106:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid keyword argument id to function GenericCustomer.__init__ [wrong-keyword-args]'] +Line 109: Unexpected errors ['dataclasses_transform_class.py:109:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] """ diff --git a/conformance/results/pytype/dataclasses_transform_converter.toml b/conformance/results/pytype/dataclasses_transform_converter.toml index a67010840..14fa83e82 100644 --- a/conformance/results/pytype/dataclasses_transform_converter.toml +++ b/conformance/results/pytype/dataclasses_transform_converter.toml @@ -6,46 +6,118 @@ conformance_automated = "Fail" errors_diff = """ Line 49: Expected 1 errors Line 118: Expected 1 errors -Line 26: Unexpected errors ['File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type]', 'File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type]', 'File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type]', 'File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type]', 'File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type]'] -Line 29: Unexpected errors ['File "dataclasses_transform_converter.py", line 29, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] -Line 112: Unexpected errors ['File "dataclasses_transform_converter.py", line 112, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types]'] -Line 114: Unexpected errors ['File "dataclasses_transform_converter.py", line 114, in : Type annotation for field0 does not match type of assignment [annotation-type-mismatch]'] -Line 115: Unexpected errors ['File "dataclasses_transform_converter.py", line 115, in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch]'] -Line 116: Unexpected errors ['File "dataclasses_transform_converter.py", line 116, in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch]'] -Line 121: Unexpected errors ['File "dataclasses_transform_converter.py", line 121, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types]'] +Line 26: Unexpected errors ['dataclasses_transform_converter.py:26:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in model_field: bad return type [bad-return-type]', 'dataclasses_transform_converter.py:26:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in model_field: bad return type [bad-return-type]', 'dataclasses_transform_converter.py:26:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in model_field: bad return type [bad-return-type]', 'dataclasses_transform_converter.py:26:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in model_field: bad return type [bad-return-type]', 'dataclasses_transform_converter.py:26:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in model_field: bad return type [bad-return-type]'] +Line 29: Unexpected errors ['dataclasses_transform_converter.py:29:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 112: Unexpected errors ['dataclasses_transform_converter.py:112:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types]'] +Line 114: Unexpected errors ['dataclasses_transform_converter.py:114:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for field0 does not match type of assignment [annotation-type-mismatch]'] +Line 115: Unexpected errors ['dataclasses_transform_converter.py:115:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch]'] +Line 116: Unexpected errors ['dataclasses_transform_converter.py:116:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch]'] +Line 121: Unexpected errors ['dataclasses_transform_converter.py:121:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types]'] """ output = """ -File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type] +dataclasses_transform_converter.py:26:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in model_field: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 98, in current file line 99, in DC2 -File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type] +dataclasses_transform_converter.py:26:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in model_field: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 98, in current file line 104, in DC2 -File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type] +dataclasses_transform_converter.py:26:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in model_field: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 98, in current file line 102, in DC2 -File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type] +dataclasses_transform_converter.py:26:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in model_field: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 98, in current file line 100, in DC2 -File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type] +dataclasses_transform_converter.py:26:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in model_field: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 47, in current file line 49, in DC1 -File "dataclasses_transform_converter.py", line 29, in : Arguments to dataclass_transform not supported yet [not-supported-yet] -File "dataclasses_transform_converter.py", line 48, in DC1: Function model_field was called with the wrong arguments [wrong-arg-types] -File "dataclasses_transform_converter.py", line 107, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] -File "dataclasses_transform_converter.py", line 108, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] -File "dataclasses_transform_converter.py", line 109, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] -File "dataclasses_transform_converter.py", line 112, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] -File "dataclasses_transform_converter.py", line 114, in : Type annotation for field0 does not match type of assignment [annotation-type-mismatch] -File "dataclasses_transform_converter.py", line 115, in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch] -File "dataclasses_transform_converter.py", line 116, in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch] -File "dataclasses_transform_converter.py", line 119, in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch] -File "dataclasses_transform_converter.py", line 121, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] -File "dataclasses_transform_converter.py", line 130, in DC3: Function model_field was called with the wrong arguments [wrong-arg-types] -File "dataclasses_transform_converter.py", line 133, in DC3: Function model_field was called with the wrong arguments [wrong-arg-types] +dataclasses_transform_converter.py:29:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] + +@dataclass_transform(field_specifiers=(model_field,)) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_converter.py:48:19: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in DC1: Function model_field was called with the wrong arguments [wrong-arg-types] + + field1: int = model_field(converter=bad_converter1) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_converter.py:107:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] + +DC2(1, "f1", "f2", b"f3", []) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_converter.py:108:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] + +DC2("f0", "f1", "f2", 1, []) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_converter.py:109:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] + +DC2("f0", "f1", "f2", "f3", 3j) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_converter.py:112:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] + +dc1 = DC2("f0", "f1", "f2", b"f6", []) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_converter.py:114:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for field0 does not match type of assignment [annotation-type-mismatch] + +dc1.field0 = "f1" +\u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_converter.py:115:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch] + +dc1.field3 = "f6" +\u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_converter.py:116:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch] + +dc1.field3 = b"f6" +\u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_converter.py:119:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch] + +dc1.field3 = 1 # E +\u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_converter.py:121:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] + +dc2 = DC2("f0", "f1", "f2", "f6", "1", (("a", "1"), ("b", "2"))) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_converter.py:130:19: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in DC3: Function model_field was called with the wrong arguments [wrong-arg-types] + + field1: int = model_field(converter=converter_simple, default=1) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_converter.py:133:19: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in DC3: Function model_field was called with the wrong arguments [wrong-arg-types] + + field3: int = model_field(converter=converter_simple, default_factory=int) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ diff --git a/conformance/results/pytype/dataclasses_transform_field.toml b/conformance/results/pytype/dataclasses_transform_field.toml index 26f330ebc..62c34fded 100644 --- a/conformance/results/pytype/dataclasses_transform_field.toml +++ b/conformance/results/pytype/dataclasses_transform_field.toml @@ -3,13 +3,21 @@ notes = """ Does not understand @dataclass_transform. """ output = """ -File "dataclasses_transform_field.py", line 48, in : Arguments to dataclass_transform not supported yet [not-supported-yet] -File "dataclasses_transform_field.py", line 50, in create_model: bad return type [bad-return-type] +dataclasses_transform_field.py:48:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] + +@dataclass_transform(kw_only_default=True, field_specifiers=(field1, field2)) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_field.py:50:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in create_model: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 64: Expected 1 errors Line 75: Expected 1 errors -Line 48: Unexpected errors ['File "dataclasses_transform_field.py", line 48, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] -Line 50: Unexpected errors ['File "dataclasses_transform_field.py", line 50, in create_model: bad return type [bad-return-type]'] +Line 48: Unexpected errors ['dataclasses_transform_field.py:48:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 50: Unexpected errors ['dataclasses_transform_field.py:50:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in create_model: bad return type [bad-return-type]'] """ diff --git a/conformance/results/pytype/dataclasses_transform_func.toml b/conformance/results/pytype/dataclasses_transform_func.toml index 89a1ae2ee..1479e2bcb 100644 --- a/conformance/results/pytype/dataclasses_transform_func.toml +++ b/conformance/results/pytype/dataclasses_transform_func.toml @@ -3,30 +3,74 @@ notes = """ Does not understand @dataclass_transform. """ output = """ -File "dataclasses_transform_func.py", line 13, in : Arguments to dataclass_transform not supported yet [not-supported-yet] -File "dataclasses_transform_func.py", line 19, in : Arguments to dataclass_transform not supported yet [not-supported-yet] -File "dataclasses_transform_func.py", line 30, in create_model: bad return type [bad-return-type] +dataclasses_transform_func.py:13:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] + +@dataclass_transform(kw_only_default=True, order_default=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_func.py:19:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] + +@dataclass_transform(kw_only_default=True, order_default=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_func.py:30:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in create_model: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 89, in current file -File "dataclasses_transform_func.py", line 30, in create_model: bad return type [bad-return-type] -File "dataclasses_transform_func.py", line 50, in : Invalid keyword arguments (id, name) to function Customer1.__init__ [wrong-keyword-args] -File "dataclasses_transform_func.py", line 53, in : Function Customer1.__init__ expects 1 arg(s), got 3 [wrong-arg-count] -File "dataclasses_transform_func.py", line 57, in : Type annotation for name does not match type of assignment [annotation-type-mismatch] -File "dataclasses_transform_func.py", line 65, in : Invalid keyword arguments (id, name, salary) to function Customer1.__init__ [wrong-keyword-args] -File "dataclasses_transform_func.py", line 67, in : Invalid keyword arguments (id, name) to function Customer2.__init__ [wrong-keyword-args] -File "dataclasses_transform_func.py", line 71, in : Function Customer2.__init__ expects 1 arg(s), got 3 [wrong-arg-count] -File "dataclasses_transform_func.py", line 76, in : Arguments to dataclass_transform not supported yet [not-supported-yet] +dataclasses_transform_func.py:30:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in create_model: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +dataclasses_transform_func.py:50:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword arguments (id, name) to function Customer1.__init__ [wrong-keyword-args] + +c1_1 = Customer1(id=3, name="Sue") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_func.py:53:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Customer1.__init__ expects 1 arg(s), got 3 [wrong-arg-count] + +c1_2 = Customer1(3, "Sue") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_func.py:57:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for name does not match type of assignment [annotation-type-mismatch] + +c1_2.name = 3 # E +\u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_func.py:65:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword arguments (id, name, salary) to function Customer1.__init__ [wrong-keyword-args] + +c1_3 = Customer1(id=3, name="Sue", salary=40000) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_func.py:67:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword arguments (id, name) to function Customer2.__init__ [wrong-keyword-args] + +c2_1 = Customer2(id=0, name="John") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_func.py:71:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Customer2.__init__ expects 1 arg(s), got 3 [wrong-arg-count] + +c2_2 = Customer2(0, "John") # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_func.py:76:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] + +@dataclass_transform(kw_only_default=True, order_default=True, frozen_default=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 61: Expected 1 errors Line 97: Expected 1 errors Lines 89, 90: Expected error (tag 'Customer3Subclass') -Line 13: Unexpected errors ['File "dataclasses_transform_func.py", line 13, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] -Line 19: Unexpected errors ['File "dataclasses_transform_func.py", line 19, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] -Line 30: Unexpected errors ['File "dataclasses_transform_func.py", line 30, in create_model: bad return type [bad-return-type]', 'File "dataclasses_transform_func.py", line 30, in create_model: bad return type [bad-return-type]'] -Line 50: Unexpected errors ['File "dataclasses_transform_func.py", line 50, in : Invalid keyword arguments (id, name) to function Customer1.__init__ [wrong-keyword-args]'] -Line 53: Unexpected errors ['File "dataclasses_transform_func.py", line 53, in : Function Customer1.__init__ expects 1 arg(s), got 3 [wrong-arg-count]'] -Line 67: Unexpected errors ['File "dataclasses_transform_func.py", line 67, in : Invalid keyword arguments (id, name) to function Customer2.__init__ [wrong-keyword-args]'] -Line 76: Unexpected errors ['File "dataclasses_transform_func.py", line 76, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 13: Unexpected errors ['dataclasses_transform_func.py:13:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 19: Unexpected errors ['dataclasses_transform_func.py:19:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 30: Unexpected errors ['dataclasses_transform_func.py:30:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in create_model: bad return type [bad-return-type]', 'dataclasses_transform_func.py:30:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in create_model: bad return type [bad-return-type]'] +Line 50: Unexpected errors ['dataclasses_transform_func.py:50:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid keyword arguments (id, name) to function Customer1.__init__ [wrong-keyword-args]'] +Line 53: Unexpected errors ['dataclasses_transform_func.py:53:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function Customer1.__init__ expects 1 arg(s), got 3 [wrong-arg-count]'] +Line 67: Unexpected errors ['dataclasses_transform_func.py:67:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid keyword arguments (id, name) to function Customer2.__init__ [wrong-keyword-args]'] +Line 76: Unexpected errors ['dataclasses_transform_func.py:76:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] """ diff --git a/conformance/results/pytype/dataclasses_transform_meta.toml b/conformance/results/pytype/dataclasses_transform_meta.toml index bf8168419..93cf0058c 100644 --- a/conformance/results/pytype/dataclasses_transform_meta.toml +++ b/conformance/results/pytype/dataclasses_transform_meta.toml @@ -3,9 +3,27 @@ notes = """ Does not understand @dataclass_transform. """ output = """ -File "dataclasses_transform_meta.py", line 21, in : Arguments to dataclass_transform not supported yet [not-supported-yet] -File "dataclasses_transform_meta.py", line 60, in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args] -File "dataclasses_transform_meta.py", line 86, in : Arguments to dataclass_transform not supported yet [not-supported-yet] +dataclasses_transform_meta.py:21:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] + +@dataclass_transform( + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + kw_only_default=True, +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + field_specifiers=(ModelField, model_field), +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +) +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +dataclasses_transform_meta.py:60:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args] + +c1_1 = Customer1(id=3, name="Sue", other_name="Susan") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_meta.py:86:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] + +@dataclass_transform(frozen_default=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -15,7 +33,7 @@ Line 66: Expected 1 errors Line 73: Expected 1 errors Line 83: Expected 1 errors Line 103: Expected 1 errors -Line 21: Unexpected errors ['File "dataclasses_transform_meta.py", line 21, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] -Line 60: Unexpected errors ['File "dataclasses_transform_meta.py", line 60, in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args]'] -Line 86: Unexpected errors ['File "dataclasses_transform_meta.py", line 86, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 21: Unexpected errors ['dataclasses_transform_meta.py:21:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 60: Unexpected errors ['dataclasses_transform_meta.py:60:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args]'] +Line 86: Unexpected errors ['dataclasses_transform_meta.py:86:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] """ diff --git a/conformance/results/pytype/dataclasses_usage.toml b/conformance/results/pytype/dataclasses_usage.toml index 6690e24d5..cc9e6e713 100644 --- a/conformance/results/pytype/dataclasses_usage.toml +++ b/conformance/results/pytype/dataclasses_usage.toml @@ -1,16 +1,60 @@ conformant = "Pass" output = """ -File "dataclasses_usage.py", line 50, in : Missing parameter 'unit_price' in call to function InventoryItem.__init__ [missing-parameter] -File "dataclasses_usage.py", line 51, in : Function InventoryItem.__init__ was called with the wrong arguments [wrong-arg-types] -File "dataclasses_usage.py", line 52, in : Function InventoryItem.__init__ expects 3 arg(s), got 5 [wrong-arg-count] -File "dataclasses_usage.py", line 58, in : In method __init__, non-default argument b follows default argument [invalid-function-definition] -File "dataclasses_usage.py", line 64, in : In method __init__, non-default argument b follows default argument [invalid-function-definition] -File "dataclasses_usage.py", line 70, in : In method __init__, non-default argument b follows default argument [invalid-function-definition] -File "dataclasses_usage.py", line 83, in : Function DC4.__init__ expects 2 arg(s), got 3 [wrong-arg-count] -File "dataclasses_usage.py", line 88, in DC5: Type annotation for a does not match type of assignment [annotation-type-mismatch] -File "dataclasses_usage.py", line 127, in : Function DC7.__init__ expects 2 arg(s), got 3 [wrong-arg-count] -File "dataclasses_usage.py", line 130, in : Missing parameter 'y' in call to function DC8.__init__ [missing-parameter] -File "dataclasses_usage.py", line 179, in : Function DC13.__init__ expects 1 arg(s), got 2 [wrong-arg-count] +dataclasses_usage.py:50:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'unit_price' in call to function InventoryItem.__init__ [missing-parameter] + +v2 = InventoryItem("name") # E: missing unit_price + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_usage.py:51:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function InventoryItem.__init__ was called with the wrong arguments [wrong-arg-types] + +v3 = InventoryItem("name", "price") # E: incorrect type for unit_price + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_usage.py:52:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function InventoryItem.__init__ expects 3 arg(s), got 5 [wrong-arg-count] + +v4 = InventoryItem("name", 3.1, 3, 4) # E: too many arguments + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_usage.py:58:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : In method __init__, non-default argument b follows default argument [invalid-function-definition] + +@dataclass # E[DC1] + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_usage.py:64:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : In method __init__, non-default argument b follows default argument [invalid-function-definition] + +@dataclass # E[DC2] + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_usage.py:70:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : In method __init__, non-default argument b follows default argument [invalid-function-definition] + +@dataclass # E[DC3] + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_usage.py:83:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC4.__init__ expects 2 arg(s), got 3 [wrong-arg-count] + +v6 = DC4(0, 1) # E: too many parameters + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_usage.py:88:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in DC5: Type annotation for a does not match type of assignment [annotation-type-mismatch] + + a: int = field(default_factory=str) # E: type mismatch + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +dataclasses_usage.py:127:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC7.__init__ expects 2 arg(s), got 3 [wrong-arg-count] + +DC7(3, 4) # E +\u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_usage.py:130:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'y' in call to function DC8.__init__ [missing-parameter] + +DC8(a) # E +\u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +dataclasses_usage.py:179:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC13.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +DC13(3) # E +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pytype/directives_assert_type.toml b/conformance/results/pytype/directives_assert_type.toml index a77a3f9ec..288cc6558 100644 --- a/conformance/results/pytype/directives_assert_type.toml +++ b/conformance/results/pytype/directives_assert_type.toml @@ -3,11 +3,31 @@ notes = """ Incorrectly allows assert(x, int) where x is a Literal. """ output = """ -File "directives_assert_type.py", line 27, in func1: Union[int, str] [assert-type] -File "directives_assert_type.py", line 28, in func1: Any [assert-type] -File "directives_assert_type.py", line 31, in func1: Function assert_type expects 2 arg(s), got 0 [wrong-arg-count] -File "directives_assert_type.py", line 32, in func1: str [assert-type] -File "directives_assert_type.py", line 33, in func1: Function assert_type expects 2 arg(s), got 3 [wrong-arg-count] +directives_assert_type.py:27:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Union[int, str] [assert-type] + + assert_type(a, int) # E: Type mismatch + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +directives_assert_type.py:28:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Any [assert-type] + + assert_type(c, int) # E: Type mismatch + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +directives_assert_type.py:31:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Function assert_type expects 2 arg(s), got 0 [wrong-arg-count] + + assert_type() # E: not enough arguments + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +directives_assert_type.py:32:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: str [assert-type] + + assert_type("", int) # E: wrong argument type + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +directives_assert_type.py:33:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Function assert_type expects 2 arg(s), got 3 [wrong-arg-count] + + assert_type(a, int | str, a) # E: too many arguments + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pytype/directives_cast.toml b/conformance/results/pytype/directives_cast.toml index 28cc3470d..edb229b98 100644 --- a/conformance/results/pytype/directives_cast.toml +++ b/conformance/results/pytype/directives_cast.toml @@ -3,8 +3,16 @@ notes = """ Does not reject a call to "cast" with additional arguments. """ output = """ -File "directives_cast.py", line 15, in : Missing parameter 'typ' in call to function typing.cast [missing-parameter] -File "directives_cast.py", line 16, in : Invalid type annotation '1' for typing.cast [invalid-annotation] +directives_cast.py:15:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'typ' in call to function typing.cast [missing-parameter] + +bad1 = cast() # E: Too few arguments + \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +directives_cast.py:16:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '1' for typing.cast [invalid-annotation] + +bad2 = cast(1, "") # E: Bad first argument type + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pytype/directives_deprecated.toml b/conformance/results/pytype/directives_deprecated.toml index 8928ce99c..26c189937 100644 --- a/conformance/results/pytype/directives_deprecated.toml +++ b/conformance/results/pytype/directives_deprecated.toml @@ -15,13 +15,29 @@ Line 48: Expected 1 errors Line 58: Expected 1 errors Line 69: Expected 1 errors Line 98: Expected 1 errors -Line 10: Unexpected errors ['File "directives_deprecated.py", line 10, in : typing.override not supported yet [not-supported-yet]'] -Line 11: Unexpected errors ['File "directives_deprecated.py", line 11, in : typing_extensions.deprecated not supported yet [not-supported-yet]'] -Line 19: Unexpected errors ['File "directives_deprecated.py", line 19, in : Can\\'t find module \\'_directives_deprecated_library\\'. [import-error]'] +Line 10: Unexpected errors ['directives_deprecated.py:10:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.override not supported yet [not-supported-yet]'] +Line 11: Unexpected errors ['directives_deprecated.py:11:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing_extensions.deprecated not supported yet [not-supported-yet]'] +Line 19: Unexpected errors ["directives_deprecated.py:19:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Can't find module '_directives_deprecated_library'. [import-error]"] """ output = """ -File "directives_deprecated.py", line 10, in : typing.override not supported yet [not-supported-yet] -File "directives_deprecated.py", line 11, in : typing_extensions.deprecated not supported yet [not-supported-yet] -File "directives_deprecated.py", line 18, in : Can't find module '_directives_deprecated_library'. [import-error] -File "directives_deprecated.py", line 19, in : Can't find module '_directives_deprecated_library'. [import-error] +directives_deprecated.py:10:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.override not supported yet [not-supported-yet] + +from typing import Protocol, override +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +directives_deprecated.py:11:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing_extensions.deprecated not supported yet [not-supported-yet] + +from typing_extensions import deprecated +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +directives_deprecated.py:18:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Can't find module '_directives_deprecated_library'. [import-error] + +from _directives_deprecated_library import Ham # E: Use of deprecated class Ham +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +directives_deprecated.py:19:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Can't find module '_directives_deprecated_library'. [import-error] + +import _directives_deprecated_library as library +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ diff --git a/conformance/results/pytype/directives_no_type_check.toml b/conformance/results/pytype/directives_no_type_check.toml index b90eb6f63..22229130f 100644 --- a/conformance/results/pytype/directives_no_type_check.toml +++ b/conformance/results/pytype/directives_no_type_check.toml @@ -3,11 +3,31 @@ notes = """ Does not honor @no_type_check decorator. """ output = """ -File "directives_no_type_check.py", line 15, in ClassA: Type annotation for x does not match type of assignment [annotation-type-mismatch] -File "directives_no_type_check.py", line 25, in func1: unsupported operand type(s) for +: int and str [unsupported-operands] -File "directives_no_type_check.py", line 26, in func1: bad return type [bad-return-type] -File "directives_no_type_check.py", line 29, in : Function func1 was called with the wrong arguments [wrong-arg-types] -File "directives_no_type_check.py", line 32, in : Missing parameter 'a' in call to function func1 [missing-parameter] +directives_no_type_check.py:15:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Type annotation for x does not match type of assignment [annotation-type-mismatch] + + x: int = "" # E?: No error should be reported + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +directives_no_type_check.py:25:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: unsupported operand type(s) for +: int and str [unsupported-operands] + + c = a + b # E?: No error should be reported + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +directives_no_type_check.py:26:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: bad return type [bad-return-type] + + return 1 # E?: No error should be reported + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +directives_no_type_check.py:29:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function func1 was called with the wrong arguments [wrong-arg-types] + +func1(b"invalid", b"arguments") # E?: No error should be reported +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +directives_no_type_check.py:32:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'a' in call to function func1 [missing-parameter] + +func1() # E: incorrect arguments for parameters +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pytype/directives_reveal_type.toml b/conformance/results/pytype/directives_reveal_type.toml index 38e08038c..a18c7d076 100644 --- a/conformance/results/pytype/directives_reveal_type.toml +++ b/conformance/results/pytype/directives_reveal_type.toml @@ -4,17 +4,37 @@ Does not reject call to reveal_type with zero arguments. Does not reject call to reveal_type with too many arguments. """ output = """ -File "directives_reveal_type.py", line 14, in func1: Union[int, str] [reveal-type] -File "directives_reveal_type.py", line 15, in func1: List[int] [reveal-type] -File "directives_reveal_type.py", line 16, in func1: Any [reveal-type] -File "directives_reveal_type.py", line 17, in func1: ForwardReference [reveal-type] -File "directives_reveal_type.py", line 20, in func1: Union[int, str] [reveal-type] +directives_reveal_type.py:14:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Union[int, str] [reveal-type] + + reveal_type(a) # Revealed type is "int | str" + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +directives_reveal_type.py:15:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: List[int] [reveal-type] + + reveal_type(b) # Revealed type is "list[int]" + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +directives_reveal_type.py:16:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Any [reveal-type] + + reveal_type(c) # Revealed type is "Any" + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +directives_reveal_type.py:17:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: ForwardReference [reveal-type] + + reveal_type(d) # Revealed type is "ForwardReference" + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +directives_reveal_type.py:20:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Union[int, str] [reveal-type] + + reveal_type(a, a) # E: Too many arguments + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 19: Expected 1 errors -Line 14: Unexpected errors ['File "directives_reveal_type.py", line 14, in func1: Union[int, str] [reveal-type]'] -Line 15: Unexpected errors ['File "directives_reveal_type.py", line 15, in func1: List[int] [reveal-type]'] -Line 16: Unexpected errors ['File "directives_reveal_type.py", line 16, in func1: Any [reveal-type]'] -Line 17: Unexpected errors ['File "directives_reveal_type.py", line 17, in func1: ForwardReference [reveal-type]'] +Line 14: Unexpected errors ['directives_reveal_type.py:14:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Union[int, str] [reveal-type]'] +Line 15: Unexpected errors ['directives_reveal_type.py:15:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: List[int] [reveal-type]'] +Line 16: Unexpected errors ['directives_reveal_type.py:16:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Any [reveal-type]'] +Line 17: Unexpected errors ['directives_reveal_type.py:17:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: ForwardReference [reveal-type]'] """ diff --git a/conformance/results/pytype/directives_type_ignore.toml b/conformance/results/pytype/directives_type_ignore.toml index 70b1732e5..0fd583385 100644 --- a/conformance/results/pytype/directives_type_ignore.toml +++ b/conformance/results/pytype/directives_type_ignore.toml @@ -3,10 +3,19 @@ notes = """ Does not honor "# type: ignore" comment if comment includes additional text. """ output = """ -File "directives_type_ignore.py", line 11, in : Type annotation for y does not match type of assignment [annotation-type-mismatch] -File "directives_type_ignore.py", line 11: Stray type comment: ignore - additional stuff [ignored-type-comment] +directives_type_ignore.py:11:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for y does not match type of assignment [annotation-type-mismatch] + +y: int = "" # type: ignore - additional stuff +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +directives_type_ignore.py:11:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: : Stray type comment: ignore - additional stuff [ignored-type-comment] + +y: int = "" # type: ignore - additional stuff\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +y: int = "" # type: ignore - additional stuff +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 11: Unexpected errors ['File "directives_type_ignore.py", line 11, in : Type annotation for y does not match type of assignment [annotation-type-mismatch]', 'File "directives_type_ignore.py", line 11: Stray type comment: ignore - additional stuff [ignored-type-comment]'] +Line 11: Unexpected errors ['directives_type_ignore.py:11:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for y does not match type of assignment [annotation-type-mismatch]', 'directives_type_ignore.py:11:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: : Stray type comment: ignore - additional stuff [ignored-type-comment]'] """ diff --git a/conformance/results/pytype/directives_version_platform.toml b/conformance/results/pytype/directives_version_platform.toml index 6d9473c7f..dd6558f4b 100644 --- a/conformance/results/pytype/directives_version_platform.toml +++ b/conformance/results/pytype/directives_version_platform.toml @@ -4,9 +4,21 @@ Does not understand three-element form of sys.version checks. Does not understand os.name checks. """ output = """ -File "directives_version_platform.py", line 27, in : Type annotation for val3 does not match type of assignment [annotation-type-mismatch] -File "directives_version_platform.py", line 40, in : Type annotation for val7 does not match type of assignment [annotation-type-mismatch] -File "directives_version_platform.py", line 45, in : Type annotation for val8 does not match type of assignment [annotation-type-mismatch] +directives_version_platform.py:27:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for val3 does not match type of assignment [annotation-type-mismatch] + + val3: int = "" # E?: May not generate an error (support for three-element sys.version is optional) + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +directives_version_platform.py:40:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for val7 does not match type of assignment [annotation-type-mismatch] + + val7: int = "" # E?: May not generate an error (support for os.name is optional) + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +directives_version_platform.py:45:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for val8 does not match type of assignment [annotation-type-mismatch] + + val8: int = "" # E?: May not generate an error (support for os.name is optional) + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pytype/enums_definition.toml b/conformance/results/pytype/enums_definition.toml index 29c66d614..bc2a8230e 100644 --- a/conformance/results/pytype/enums_definition.toml +++ b/conformance/results/pytype/enums_definition.toml @@ -5,6 +5,10 @@ Does not support some functional forms for Enum class definitions (optional). errors_diff = """ """ output = """ -File "enums_definition.py", line 24, in : Function unsolveable.__new__ was called with the wrong arguments [wrong-arg-types] +enums_definition.py:24:10: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function unsolveable.__new__ was called with the wrong arguments [wrong-arg-types] + +Color2 = Enum("Color2", "RED", "GREEN", "BLUE") # E? + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Pass" diff --git a/conformance/results/pytype/enums_member_values.toml b/conformance/results/pytype/enums_member_values.toml index c562dce2a..bf9325764 100644 --- a/conformance/results/pytype/enums_member_values.toml +++ b/conformance/results/pytype/enums_member_values.toml @@ -8,11 +8,67 @@ Does not evaluate literal types for auto values (optional). conformance_automated = "Fail" errors_diff = """ Line 78: Expected 1 errors -Line 41: Unexpected errors ['File "enums_member_values.py", line 41, in : Missing parameter \\'mass\\' in call to function Planet.__init__ [missing-parameter]', 'File "enums_member_values.py", line 41, in : Function Planet.__init__ was called with the wrong arguments [wrong-arg-types]'] +Line 41: Unexpected errors ["enums_member_values.py:41:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'mass' in call to function Planet.__init__ [missing-parameter]", 'enums_member_values.py:41:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function Planet.__init__ was called with the wrong arguments [wrong-arg-types]'] """ output = """ -File "enums_member_values.py", line 41, in : Missing parameter 'mass' in call to function Planet.__init__ [missing-parameter] -File "enums_member_values.py", line 41, in : Function Planet.__init__ was called with the wrong arguments [wrong-arg-types] -File "enums_member_values.py", line 85, in __init__: Type annotation for _value_ does not match type of assignment [annotation-type-mismatch] -File "enums_member_values.py", line 96, in : Any [assert-type] +enums_member_values.py:41:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'mass' in call to function Planet.__init__ [missing-parameter] + +class Planet(Enum): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def __init__(self, value: int, mass: float, radius: float): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + self._value_ = value +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + self.mass = mass +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + self.radius = radius +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + MERCURY = (1, 3.303e23, 2.4397e6) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + VENUS = (2, 4.869e24, 6.0518e6) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + EARTH = (3, 5.976e24, 6.37814e6) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + MARS = (6.421e23, 3.3972e6) # E?: Type checker error (optional) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + JUPITER = 5 # E?: Type checker error (optional) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_member_values.py:41:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Planet.__init__ was called with the wrong arguments [wrong-arg-types] + +class Planet(Enum): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def __init__(self, value: int, mass: float, radius: float): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + self._value_ = value +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + self.mass = mass +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + self.radius = radius +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + MERCURY = (1, 3.303e23, 2.4397e6) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + VENUS = (2, 4.869e24, 6.0518e6) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + EARTH = (3, 5.976e24, 6.37814e6) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + MARS = (6.421e23, 3.3972e6) # E?: Type checker error (optional) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + JUPITER = 5 # E?: Type checker error (optional) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_member_values.py:85:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __init__: Type annotation for _value_ does not match type of assignment [annotation-type-mismatch] + + self._value_ = value # E + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_member_values.py:96:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(ColumnType.DORIC.value, int) # E? +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ diff --git a/conformance/results/pytype/enums_members.toml b/conformance/results/pytype/enums_members.toml index 000700425..2f5eb964d 100644 --- a/conformance/results/pytype/enums_members.toml +++ b/conformance/results/pytype/enums_members.toml @@ -9,32 +9,126 @@ errors_diff = """ Line 50: Expected 1 errors Line 116: Expected 1 errors Line 129: Expected 1 errors -Line 7: Unexpected errors ['File "enums_members.py", line 7, in : enum.nonmember not supported yet [not-supported-yet]', 'File "enums_members.py", line 7, in : enum.member not supported yet [not-supported-yet]'] -Line 35: Unexpected errors ['File "enums_members.py", line 35, in : _enums_members.Pet2 [assert-type]'] -Line 36: Unexpected errors ['File "enums_members.py", line 36, in : _enums_members.Pet2 [assert-type]'] -Line 107: Unexpected errors ['File "enums_members.py", line 107, in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count]'] -Line 108: Unexpected errors ['File "enums_members.py", line 108, in Example: Function enum.nonmember expects 0 arg(s), got 1 [wrong-arg-count]'] -Line 110: Unexpected errors ['File "enums_members.py", line 110, in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count]'] -Line 128: Unexpected errors ['File "enums_members.py", line 128, in method: Example2 [reveal-type]'] +Line 7: Unexpected errors ['enums_members.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : enum.nonmember not supported yet [not-supported-yet]', 'enums_members.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : enum.member not supported yet [not-supported-yet]'] +Line 35: Unexpected errors ['enums_members.py:35:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : _enums_members.Pet2 [assert-type]'] +Line 36: Unexpected errors ['enums_members.py:36:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : _enums_members.Pet2 [assert-type]'] +Line 107: Unexpected errors ['enums_members.py:107:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count]'] +Line 108: Unexpected errors ['enums_members.py:108:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Example: Function enum.nonmember expects 0 arg(s), got 1 [wrong-arg-count]'] +Line 110: Unexpected errors ['enums_members.py:110:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count]'] +Line 128: Unexpected errors ['enums_members.py:128:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method: Example2 [reveal-type]'] """ output = """ -File "enums_members.py", line 7, in : enum.nonmember not supported yet [not-supported-yet] -File "enums_members.py", line 7, in : enum.member not supported yet [not-supported-yet] -File "enums_members.py", line 15, in : Function Pet.__init__ was called with the wrong arguments [wrong-arg-types] -File "enums_members.py", line 35, in : _enums_members.Pet2 [assert-type] -File "enums_members.py", line 36, in : _enums_members.Pet2 [assert-type] -File "enums_members.py", line 82, in : Invalid type annotation 'Literal' [invalid-annotation] -File "enums_members.py", line 82, in : Callable[[Any], Any] [assert-type] -File "enums_members.py", line 83, in : Invalid type annotation 'Literal' [invalid-annotation] -File "enums_members.py", line 83, in : Callable[[int], int] [assert-type] -File "enums_members.py", line 84, in : property [assert-type] -File "enums_members.py", line 84, in : Invalid type annotation 'Literal' [invalid-annotation] -File "enums_members.py", line 85, in : Invalid type annotation 'Literal' [invalid-annotation] -File "enums_members.py", line 85, in : Callable[[Any], None] [assert-type] -File "enums_members.py", line 107, in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count] -File "enums_members.py", line 108, in Example: Function enum.nonmember expects 0 arg(s), got 1 [wrong-arg-count] -File "enums_members.py", line 110, in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count] -File "enums_members.py", line 128, in method: Example2 [reveal-type] -File "enums_members.py", line 146, in : Pet5 [assert-type] -File "enums_members.py", line 147, in : Pet5 [assert-type] +enums_members.py:7:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : enum.nonmember not supported yet [not-supported-yet] + +from enum import Enum, member, nonmember +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:7:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : enum.member not supported yet [not-supported-yet] + +from enum import Enum, member, nonmember +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:15:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Pet.__init__ was called with the wrong arguments [wrong-arg-types] + +class Pet(Enum): # E?: Uninitialized attributes (pyre) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + genus: str # Non-member attribute +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + species: str # Non-member attribute +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + CAT = 1 # Member attribute +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + DOG = 2 # Member attribute +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + def __init__(self, genus: str, species: str) -> None: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + self.genus = genus +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + self.species = species +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:35:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : _enums_members.Pet2 [assert-type] + +assert_type(Pet2.genus, str) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:36:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : _enums_members.Pet2 [assert-type] + +assert_type(Pet2.species, str) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:82:29: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +assert_type(Pet4.converter, Literal[Pet4.converter]) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:82:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Any] [assert-type] + +assert_type(Pet4.converter, Literal[Pet4.converter]) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:83:29: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +assert_type(Pet4.transform, Literal[Pet4.transform]) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:83:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[int], int] [assert-type] + +assert_type(Pet4.transform, Literal[Pet4.transform]) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:84:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : property [assert-type] + +assert_type(Pet4.species, Literal[Pet4.species]) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:84:27: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +assert_type(Pet4.species, Literal[Pet4.species]) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:85:25: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +assert_type(Pet4.speak, Literal[Pet4.speak]) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:85:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], None] [assert-type] + +assert_type(Pet4.speak, Literal[Pet4.speak]) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:107:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count] + + a = member(1) # Member attribute + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:108:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Example: Function enum.nonmember expects 0 arg(s), got 1 [wrong-arg-count] + + b = nonmember(2) # Non-member attribute + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:110:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count] + + @member + \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +enums_members.py:128:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method: Example2 [reveal-type] + + reveal_type(Example2.__B) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:146:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Pet5 [assert-type] + +assert_type(Pet5.DOG, int) # E?: Literal[2] is also acceptable +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:147:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Pet5 [assert-type] + +assert_type(Pet5.FISH, int) # E?: Literal[3] is also acceptable +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ diff --git a/conformance/results/pytype/exceptions_context_managers.toml b/conformance/results/pytype/exceptions_context_managers.toml index 5abf283a5..4d195209d 100644 --- a/conformance/results/pytype/exceptions_context_managers.toml +++ b/conformance/results/pytype/exceptions_context_managers.toml @@ -4,10 +4,18 @@ Does not support code flow analysis. """ conformance_automated = "Fail" errors_diff = """ -Line 50: Unexpected errors ['File "exceptions_context_managers.py", line 50, in suppress1: str [assert-type]'] -Line 57: Unexpected errors ['File "exceptions_context_managers.py", line 57, in suppress2: str [assert-type]'] +Line 50: Unexpected errors ['exceptions_context_managers.py:50:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in suppress1: str [assert-type]'] +Line 57: Unexpected errors ['exceptions_context_managers.py:57:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in suppress2: str [assert-type]'] """ output = """ -File "exceptions_context_managers.py", line 50, in suppress1: str [assert-type] -File "exceptions_context_managers.py", line 57, in suppress2: str [assert-type] +exceptions_context_managers.py:50:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in suppress1: str [assert-type] + + assert_type(x, int | str) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +exceptions_context_managers.py:57:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in suppress2: str [assert-type] + + assert_type(x, int | str) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ diff --git a/conformance/results/pytype/generics_base_class.toml b/conformance/results/pytype/generics_base_class.toml index b108aa62e..096f7d009 100644 --- a/conformance/results/pytype/generics_base_class.toml +++ b/conformance/results/pytype/generics_base_class.toml @@ -4,10 +4,28 @@ False negative on passing SymbolTable to dict[str, list[object]]. Does not reject illegal use of Generic. """ output = """ -File "generics_base_class.py", line 29, in : Invalid type annotation 'T' [invalid-annotation] -File "generics_base_class.py", line 49, in : Invalid type annotation 'LinkedList[int, int]' [invalid-annotation] -File "generics_base_class.py", line 61, in : Invalid type annotation 'MyDict[int, int]' [invalid-annotation] -File "generics_base_class.py", line 68, in : Invalid type annotation 'Generic' [invalid-annotation] +generics_base_class.py:29:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T' [invalid-annotation] + +def func1(y: Generic[T]): # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + x: Generic # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_base_class.py:49:22: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'LinkedList[int, int]' [invalid-annotation] + +linked_list_invalid: LinkedList[int, int] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_base_class.py:61:18: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'MyDict[int, int]' [invalid-annotation] + +my_dict_invalid: MyDict[int, int] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_base_class.py:68:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class BadClass1(Generic[T, T]): # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pytype/generics_basic.toml b/conformance/results/pytype/generics_basic.toml index 2089cc5d7..5ab2769bc 100644 --- a/conformance/results/pytype/generics_basic.toml +++ b/conformance/results/pytype/generics_basic.toml @@ -4,27 +4,79 @@ False positives in examples using constrained type variables. False negative for generic metaclass. """ output = """ -File "generics_basic.py", line 34, in concat: bad return type [bad-return-type] +generics_basic.py:34:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in concat: bad return type [bad-return-type] + + return x + y + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + Called from (traceback): line 67, in test_concat_subtype -File "generics_basic.py", line 40, in test_concat: Function concat was called with the wrong arguments [wrong-arg-types] -File "generics_basic.py", line 41, in test_concat: Function concat was called with the wrong arguments [wrong-arg-types] -File "generics_basic.py", line 49, in : Invalid TypeVar: the number of constraints must be 0 or more than 1 [invalid-typevar] -File "generics_basic.py", line 55, in Test: Invalid TypeVar: constraint cannot contain TypeVars [invalid-typevar] -File "generics_basic.py", line 67, in test_concat_subtype: MyStr [assert-type] -File "generics_basic.py", line 68, in test_concat_subtype: Function concat was called with the wrong arguments [wrong-arg-types] -File "generics_basic.py", line 68, in test_concat_subtype: Any [assert-type] -File "generics_basic.py", line 69, in test_concat_subtype: Function concat was called with the wrong arguments [wrong-arg-types] -File "generics_basic.py", line 121, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_basic.py", line 157, in test_my_map: unsupported operand type(s) for item retrieval: MyMap1[str, int] and int [unsupported-operands] -File "generics_basic.py", line 158, in test_my_map: unsupported operand type(s) for item retrieval: MyMap2[int, str] and int [unsupported-operands] -File "generics_basic.py", line 182, in test_my_iterable_any: Iterator[nothing] [assert-type] +generics_basic.py:40:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_concat: Function concat was called with the wrong arguments [wrong-arg-types] + + concat(s, b) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_basic.py:41:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_concat: Function concat was called with the wrong arguments [wrong-arg-types] + + concat(b, s) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_basic.py:49:18: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid TypeVar: the number of constraints must be 0 or more than 1 [invalid-typevar] + +BadConstraint1 = TypeVar("BadConstraint1", str) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_basic.py:55:22: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Test: Invalid TypeVar: constraint cannot contain TypeVars [invalid-typevar] + + BadConstraint2 = TypeVar("BadConstraint2", str, list[T]) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_basic.py:67:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_concat_subtype: MyStr [assert-type] + + assert_type(concat(m, m), str) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_basic.py:68:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_concat_subtype: Function concat was called with the wrong arguments [wrong-arg-types] + + assert_type(concat(m, s), str) + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_basic.py:68:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_concat_subtype: Any [assert-type] + + assert_type(concat(m, s), str) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_basic.py:69:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_concat_subtype: Function concat was called with the wrong arguments [wrong-arg-types] + + concat(m, b) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_basic.py:121:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Pair2(Generic[T, T]): # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_basic.py:157:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_my_map: unsupported operand type(s) for item retrieval: MyMap1[str, int] and int [unsupported-operands] + + m1[0] # E + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +generics_basic.py:158:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_my_map: unsupported operand type(s) for item retrieval: MyMap2[int, str] and int [unsupported-operands] + + m2[0] # E + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +generics_basic.py:182:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_my_iterable_any: Iterator[nothing] [assert-type] + + assert_type(iter(m), Iterator[Any]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 191: Expected 1 errors -Line 34: Unexpected errors ['File "generics_basic.py", line 34, in concat: bad return type [bad-return-type]'] -Line 67: Unexpected errors ['File "generics_basic.py", line 67, in test_concat_subtype: MyStr [assert-type]'] -Line 68: Unexpected errors ['File "generics_basic.py", line 68, in test_concat_subtype: Function concat was called with the wrong arguments [wrong-arg-types]', 'File "generics_basic.py", line 68, in test_concat_subtype: Any [assert-type]'] -Line 182: Unexpected errors ['File "generics_basic.py", line 182, in test_my_iterable_any: Iterator[nothing] [assert-type]'] +Line 34: Unexpected errors ['generics_basic.py:34:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in concat: bad return type [bad-return-type]'] +Line 67: Unexpected errors ['generics_basic.py:67:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in test_concat_subtype: MyStr [assert-type]'] +Line 68: Unexpected errors ['generics_basic.py:68:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in test_concat_subtype: Function concat was called with the wrong arguments [wrong-arg-types]', 'generics_basic.py:68:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in test_concat_subtype: Any [assert-type]'] +Line 182: Unexpected errors ['generics_basic.py:182:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in test_my_iterable_any: Iterator[nothing] [assert-type]'] """ diff --git a/conformance/results/pytype/generics_defaults.toml b/conformance/results/pytype/generics_defaults.toml index 64fb88a2e..f5258ae43 100644 --- a/conformance/results/pytype/generics_defaults.toml +++ b/conformance/results/pytype/generics_defaults.toml @@ -1,98 +1,329 @@ conformant = "Unsupported" output = """ -File "generics_defaults.py", line 7, in : typing.Unpack not supported yet [not-supported-yet] -File "generics_defaults.py", line 8, in : typing_extensions.TypeVarTuple not supported yet [not-supported-yet] -File "generics_defaults.py", line 11, in : wrong arguments [invalid-typevar] -File "generics_defaults.py", line 12, in : wrong arguments [invalid-typevar] -File "generics_defaults.py", line 13, in : wrong arguments [invalid-typevar] -File "generics_defaults.py", line 24, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults.py", line 27, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults.py", line 30, in : class NoNonDefaults is not indexable [not-indexable] -File "generics_defaults.py", line 31, in : class NoNonDefaults is not indexable [not-indexable] -File "generics_defaults.py", line 32, in : class NoNonDefaults is not indexable [not-indexable] -File "generics_defaults.py", line 35, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults.py", line 38, in : Invalid type annotation 'OneDefault[float, bool]' [invalid-annotation] -File "generics_defaults.py", line 39, in : Invalid type annotation 'OneDefault[float, bool]' [invalid-annotation] -File "generics_defaults.py", line 42, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults.py", line 45, in : Invalid type annotation 'AllTheDefaults[Any, Any, str, int, bool]' [invalid-annotation] -File "generics_defaults.py", line 47, in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] -File "generics_defaults.py", line 50, in : Invalid type annotation 'AllTheDefaults[int]' [invalid-annotation] -File "generics_defaults.py", line 53, in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] -File "generics_defaults.py", line 56, in : Invalid type annotation 'AllTheDefaults[int, complex, str]' [invalid-annotation] -File "generics_defaults.py", line 57, in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] -File "generics_defaults.py", line 60, in : Invalid type annotation 'AllTheDefaults[int, complex, str, int]' [invalid-annotation] -File "generics_defaults.py", line 61, in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] -File "generics_defaults.py", line 64, in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] -File "generics_defaults.py", line 65, in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] -File "generics_defaults.py", line 73, in : wrong arguments [invalid-typevar] -File "generics_defaults.py", line 76, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults.py", line 79, in : class Class_ParamSpec is not indexable [not-indexable] -File "generics_defaults.py", line 80, in : class Class_ParamSpec is not indexable [not-indexable] -File "generics_defaults.py", line 81, in : class Class_ParamSpec is not indexable [not-indexable] -File "generics_defaults.py", line 91, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults.py", line 94, in : class Class_TypeVarTuple is not indexable [not-indexable] -File "generics_defaults.py", line 95, in : class Class_TypeVarTuple is not indexable [not-indexable] -File "generics_defaults.py", line 96, in : class Class_TypeVarTuple is not indexable [not-indexable] -File "generics_defaults.py", line 103, in : wrong arguments [invalid-typevar] -File "generics_defaults.py", line 104, in : wrong arguments [invalid-typevar] -File "generics_defaults.py", line 110, in : wrong arguments [invalid-typevar] -File "generics_defaults.py", line 111, in : wrong arguments [invalid-typevar] -File "generics_defaults.py", line 121, in : wrong arguments [invalid-typevar] -File "generics_defaults.py", line 127, in : Any [assert-type] -File "generics_defaults.py", line 135, in : wrong arguments [invalid-typevar] -File "generics_defaults.py", line 138, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults.py", line 145, in : wrong arguments [invalid-typevar] -File "generics_defaults.py", line 148, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults.py", line 151, in : class Foo6 is not indexable [not-indexable] -File "generics_defaults.py", line 152, in : class Foo6 is not indexable [not-indexable] -File "generics_defaults.py", line 159, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults.py", line 166, in : class Foo7 is not indexable [not-indexable] -File "generics_defaults.py", line 166, in : Callable[[Any], Self] [assert-type] -File "generics_defaults.py", line 167, in : Any [assert-type] +generics_defaults.py:7:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.Unpack not supported yet [not-supported-yet] + +from typing import Any, Callable, Generic, Self, Unpack, assert_type +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:8:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing_extensions.TypeVarTuple not supported yet [not-supported-yet] + +from typing_extensions import TypeVar, ParamSpec, TypeVarTuple +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:11:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +DefaultStrT = TypeVar("DefaultStrT", default=str) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:12:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +DefaultIntT = TypeVar("DefaultIntT", default=int) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:13:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +DefaultBoolT = TypeVar("DefaultBoolT", default=bool) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:24:32: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class NonDefaultFollowsDefault(Generic[DefaultStrT, T]): ... # E: non-default TypeVars cannot follow ones with defaults + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:27:21: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class NoNonDefaults(Generic[DefaultStrT, DefaultIntT]): ... + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:30:33: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class NoNonDefaults is not indexable [not-indexable] + +assert_type(NoNonDefaults, type[NoNonDefaults[str, int]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:31:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class NoNonDefaults is not indexable [not-indexable] + +assert_type(NoNonDefaults[str], type[NoNonDefaults[str, int]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:31:38: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class NoNonDefaults is not indexable [not-indexable] + +assert_type(NoNonDefaults[str], type[NoNonDefaults[str, int]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:32:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class NoNonDefaults is not indexable [not-indexable] + +assert_type(NoNonDefaults[str, int], type[NoNonDefaults[str, int]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:32:43: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class NoNonDefaults is not indexable [not-indexable] + +assert_type(NoNonDefaults[str, int], type[NoNonDefaults[str, int]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:35:18: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class OneDefault(Generic[T, DefaultBoolT]): ... + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:38:37: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'OneDefault[float, bool]' [invalid-annotation] + +assert_type(OneDefault[float], type[OneDefault[float, bool]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:39:34: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'OneDefault[float, bool]' [invalid-annotation] + +assert_type(OneDefault[float](), OneDefault[float, bool]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:42:22: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class AllTheDefaults(Generic[T1, T2, DefaultStrT, DefaultIntT, DefaultBoolT]): ... + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:45:34: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[Any, Any, str, int, bool]' [invalid-annotation] + +assert_type(AllTheDefaults, type[AllTheDefaults[Any, Any, str, int, bool]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:47:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] + + AllTheDefaults[int, complex], type[AllTheDefaults[int, complex, str, int, bool]] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:50:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[int]' [invalid-annotation] + +AllTheDefaults[int] # E: expected 2 arguments to AllTheDefaults +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:53:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] + + AllTheDefaults[int, complex], type[AllTheDefaults[int, complex, str, int, bool]] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:56:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str]' [invalid-annotation] + + AllTheDefaults[int, complex, str], + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:57:10: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] + + type[AllTheDefaults[int, complex, str, int, bool]], + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:60:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int]' [invalid-annotation] + + AllTheDefaults[int, complex, str, int], + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:61:10: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] + + type[AllTheDefaults[int, complex, str, int, bool]], + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:64:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] + + AllTheDefaults[int, complex, str, int, bool], + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:65:10: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] + + type[AllTheDefaults[int, complex, str, int, bool]], + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:73:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +DefaultP = ParamSpec("DefaultP", default=[str, int]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:76:23: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Class_ParamSpec(Generic[DefaultP]): ... + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:79:35: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Class_ParamSpec is not indexable [not-indexable] + +assert_type(Class_ParamSpec, type[Class_ParamSpec[str, int]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:80:32: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Class_ParamSpec is not indexable [not-indexable] + +assert_type(Class_ParamSpec(), Class_ParamSpec[str, int]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:81:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Class_ParamSpec is not indexable [not-indexable] + +assert_type(Class_ParamSpec[[bool, bool]](), Class_ParamSpec[bool, bool]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:81:46: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Class_ParamSpec is not indexable [not-indexable] + +assert_type(Class_ParamSpec[[bool, bool]](), Class_ParamSpec[bool, bool]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:91:26: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Class_TypeVarTuple(Generic[*DefaultTs]): ... + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:94:38: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable] + +assert_type(Class_TypeVarTuple, type[Class_TypeVarTuple[*tuple[str, int]]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:95:35: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable] + +assert_type(Class_TypeVarTuple(), Class_TypeVarTuple[str, int]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:96:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable] + +assert_type(Class_TypeVarTuple[int, bool](), Class_TypeVarTuple[int, bool]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:96:46: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable] + +assert_type(Class_TypeVarTuple[int, bool](), Class_TypeVarTuple[int, bool]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:103:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +TypeVar("Ok", bound=float, default=int) # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:104:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +TypeVar("Invalid", bound=str, default=int) # E: the bound and default are incompatible +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:110:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +TypeVar("Ok", float, str, default=float) # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:111:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +TypeVar("Invalid", float, str, default=int) # E: expected one of float or str got int +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:121:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +T4 = TypeVar("T4", default=int) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:127:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(func1(0), int) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:135:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +T5 = TypeVar("T5", default=bool) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:138:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Foo5(Generic[*Ts, T5]): ... # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:145:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +P = ParamSpec("P", default=[float, bool]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:148:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Foo6(Generic[*Ts, P]): ... # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:151:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo6 is not indexable [not-indexable] + +assert_type(Foo6[int, str], type[Foo6[int, str, [float, bool]]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:151:34: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo6 is not indexable [not-indexable] + +assert_type(Foo6[int, str], type[Foo6[int, str, [float, bool]]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:152:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo6 is not indexable [not-indexable] + +assert_type(Foo6[int, str, [bytes]], type[Foo6[int, str, [bytes]]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:152:43: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo6 is not indexable [not-indexable] + +assert_type(Foo6[int, str, [bytes]], type[Foo6[int, str, [bytes]]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:159:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Foo7(Generic[DefaultIntT]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:166:34: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo7 is not indexable [not-indexable] + +assert_type(Foo7.meth, Callable[[Foo7[int]], Foo7[int]]) + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:166:46: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo7 is not indexable [not-indexable] + +assert_type(Foo7.meth, Callable[[Foo7[int]], Foo7[int]]) + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:166:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Self] [assert-type] + +assert_type(Foo7.meth, Callable[[Foo7[int]], Foo7[int]]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:167:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(Foo7.attr, int) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 7: Unexpected errors ['File "generics_defaults.py", line 7, in : typing.Unpack not supported yet [not-supported-yet]'] -Line 8: Unexpected errors ['File "generics_defaults.py", line 8, in : typing_extensions.TypeVarTuple not supported yet [not-supported-yet]'] -Line 11: Unexpected errors ['File "generics_defaults.py", line 11, in : wrong arguments [invalid-typevar]'] -Line 12: Unexpected errors ['File "generics_defaults.py", line 12, in : wrong arguments [invalid-typevar]'] -Line 13: Unexpected errors ['File "generics_defaults.py", line 13, in : wrong arguments [invalid-typevar]'] -Line 27: Unexpected errors ['File "generics_defaults.py", line 27, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 30: Unexpected errors ['File "generics_defaults.py", line 30, in : class NoNonDefaults is not indexable [not-indexable]'] -Line 31: Unexpected errors ['File "generics_defaults.py", line 31, in : class NoNonDefaults is not indexable [not-indexable]'] -Line 32: Unexpected errors ['File "generics_defaults.py", line 32, in : class NoNonDefaults is not indexable [not-indexable]'] -Line 35: Unexpected errors ['File "generics_defaults.py", line 35, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 38: Unexpected errors ['File "generics_defaults.py", line 38, in : Invalid type annotation \\'OneDefault[float, bool]\\' [invalid-annotation]'] -Line 39: Unexpected errors ['File "generics_defaults.py", line 39, in : Invalid type annotation \\'OneDefault[float, bool]\\' [invalid-annotation]'] -Line 42: Unexpected errors ['File "generics_defaults.py", line 42, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 45: Unexpected errors ['File "generics_defaults.py", line 45, in : Invalid type annotation \\'AllTheDefaults[Any, Any, str, int, bool]\\' [invalid-annotation]'] -Line 47: Unexpected errors ['File "generics_defaults.py", line 47, in : Invalid type annotation \\'AllTheDefaults[int, complex, str, int, bool]\\' [invalid-annotation]'] -Line 53: Unexpected errors ['File "generics_defaults.py", line 53, in : Invalid type annotation \\'AllTheDefaults[int, complex, str, int, bool]\\' [invalid-annotation]'] -Line 56: Unexpected errors ['File "generics_defaults.py", line 56, in : Invalid type annotation \\'AllTheDefaults[int, complex, str]\\' [invalid-annotation]'] -Line 57: Unexpected errors ['File "generics_defaults.py", line 57, in : Invalid type annotation \\'AllTheDefaults[int, complex, str, int, bool]\\' [invalid-annotation]'] -Line 60: Unexpected errors ['File "generics_defaults.py", line 60, in : Invalid type annotation \\'AllTheDefaults[int, complex, str, int]\\' [invalid-annotation]'] -Line 61: Unexpected errors ['File "generics_defaults.py", line 61, in : Invalid type annotation \\'AllTheDefaults[int, complex, str, int, bool]\\' [invalid-annotation]'] -Line 64: Unexpected errors ['File "generics_defaults.py", line 64, in : Invalid type annotation \\'AllTheDefaults[int, complex, str, int, bool]\\' [invalid-annotation]'] -Line 65: Unexpected errors ['File "generics_defaults.py", line 65, in : Invalid type annotation \\'AllTheDefaults[int, complex, str, int, bool]\\' [invalid-annotation]'] -Line 73: Unexpected errors ['File "generics_defaults.py", line 73, in : wrong arguments [invalid-typevar]'] -Line 76: Unexpected errors ['File "generics_defaults.py", line 76, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 79: Unexpected errors ['File "generics_defaults.py", line 79, in : class Class_ParamSpec is not indexable [not-indexable]'] -Line 80: Unexpected errors ['File "generics_defaults.py", line 80, in : class Class_ParamSpec is not indexable [not-indexable]'] -Line 81: Unexpected errors ['File "generics_defaults.py", line 81, in : class Class_ParamSpec is not indexable [not-indexable]'] -Line 91: Unexpected errors ['File "generics_defaults.py", line 91, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 94: Unexpected errors ['File "generics_defaults.py", line 94, in : class Class_TypeVarTuple is not indexable [not-indexable]'] -Line 95: Unexpected errors ['File "generics_defaults.py", line 95, in : class Class_TypeVarTuple is not indexable [not-indexable]'] -Line 96: Unexpected errors ['File "generics_defaults.py", line 96, in : class Class_TypeVarTuple is not indexable [not-indexable]'] -Line 103: Unexpected errors ['File "generics_defaults.py", line 103, in : wrong arguments [invalid-typevar]'] -Line 110: Unexpected errors ['File "generics_defaults.py", line 110, in : wrong arguments [invalid-typevar]'] -Line 121: Unexpected errors ['File "generics_defaults.py", line 121, in : wrong arguments [invalid-typevar]'] -Line 127: Unexpected errors ['File "generics_defaults.py", line 127, in : Any [assert-type]'] -Line 135: Unexpected errors ['File "generics_defaults.py", line 135, in : wrong arguments [invalid-typevar]'] -Line 145: Unexpected errors ['File "generics_defaults.py", line 145, in : wrong arguments [invalid-typevar]'] -Line 148: Unexpected errors ['File "generics_defaults.py", line 148, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 151: Unexpected errors ['File "generics_defaults.py", line 151, in : class Foo6 is not indexable [not-indexable]'] -Line 152: Unexpected errors ['File "generics_defaults.py", line 152, in : class Foo6 is not indexable [not-indexable]'] -Line 159: Unexpected errors ['File "generics_defaults.py", line 159, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 166: Unexpected errors ['File "generics_defaults.py", line 166, in : class Foo7 is not indexable [not-indexable]', 'File "generics_defaults.py", line 166, in : Callable[[Any], Self] [assert-type]'] -Line 167: Unexpected errors ['File "generics_defaults.py", line 167, in : Any [assert-type]'] +Line 7: Unexpected errors ['generics_defaults.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.Unpack not supported yet [not-supported-yet]'] +Line 8: Unexpected errors ['generics_defaults.py:8:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing_extensions.TypeVarTuple not supported yet [not-supported-yet]'] +Line 11: Unexpected errors ['generics_defaults.py:11:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 12: Unexpected errors ['generics_defaults.py:12:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 13: Unexpected errors ['generics_defaults.py:13:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 27: Unexpected errors ["generics_defaults.py:27:21: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 30: Unexpected errors ['generics_defaults.py:30:33: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class NoNonDefaults is not indexable [not-indexable]'] +Line 31: Unexpected errors ['generics_defaults.py:31:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class NoNonDefaults is not indexable [not-indexable]', 'generics_defaults.py:31:38: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class NoNonDefaults is not indexable [not-indexable]'] +Line 32: Unexpected errors ['generics_defaults.py:32:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class NoNonDefaults is not indexable [not-indexable]', 'generics_defaults.py:32:43: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class NoNonDefaults is not indexable [not-indexable]'] +Line 35: Unexpected errors ["generics_defaults.py:35:18: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 38: Unexpected errors ["generics_defaults.py:38:37: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'OneDefault[float, bool]' [invalid-annotation]"] +Line 39: Unexpected errors ["generics_defaults.py:39:34: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'OneDefault[float, bool]' [invalid-annotation]"] +Line 42: Unexpected errors ["generics_defaults.py:42:22: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 45: Unexpected errors ["generics_defaults.py:45:34: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'AllTheDefaults[Any, Any, str, int, bool]' [invalid-annotation]"] +Line 47: Unexpected errors ["generics_defaults.py:47:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation]"] +Line 53: Unexpected errors ["generics_defaults.py:53:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation]"] +Line 56: Unexpected errors ["generics_defaults.py:56:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str]' [invalid-annotation]"] +Line 57: Unexpected errors ["generics_defaults.py:57:10: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation]"] +Line 60: Unexpected errors ["generics_defaults.py:60:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int]' [invalid-annotation]"] +Line 61: Unexpected errors ["generics_defaults.py:61:10: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation]"] +Line 64: Unexpected errors ["generics_defaults.py:64:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation]"] +Line 65: Unexpected errors ["generics_defaults.py:65:10: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation]"] +Line 73: Unexpected errors ['generics_defaults.py:73:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 76: Unexpected errors ["generics_defaults.py:76:23: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 79: Unexpected errors ['generics_defaults.py:79:35: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_ParamSpec is not indexable [not-indexable]'] +Line 80: Unexpected errors ['generics_defaults.py:80:32: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_ParamSpec is not indexable [not-indexable]'] +Line 81: Unexpected errors ['generics_defaults.py:81:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_ParamSpec is not indexable [not-indexable]', 'generics_defaults.py:81:46: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_ParamSpec is not indexable [not-indexable]'] +Line 91: Unexpected errors ["generics_defaults.py:91:26: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 94: Unexpected errors ['generics_defaults.py:94:38: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable]'] +Line 95: Unexpected errors ['generics_defaults.py:95:35: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable]'] +Line 96: Unexpected errors ['generics_defaults.py:96:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable]', 'generics_defaults.py:96:46: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable]'] +Line 103: Unexpected errors ['generics_defaults.py:103:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 110: Unexpected errors ['generics_defaults.py:110:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 121: Unexpected errors ['generics_defaults.py:121:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 127: Unexpected errors ['generics_defaults.py:127:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] +Line 135: Unexpected errors ['generics_defaults.py:135:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 145: Unexpected errors ['generics_defaults.py:145:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 148: Unexpected errors ["generics_defaults.py:148:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 151: Unexpected errors ['generics_defaults.py:151:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo6 is not indexable [not-indexable]', 'generics_defaults.py:151:34: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo6 is not indexable [not-indexable]'] +Line 152: Unexpected errors ['generics_defaults.py:152:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo6 is not indexable [not-indexable]', 'generics_defaults.py:152:43: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo6 is not indexable [not-indexable]'] +Line 159: Unexpected errors ["generics_defaults.py:159:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 166: Unexpected errors ['generics_defaults.py:166:34: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo7 is not indexable [not-indexable]', 'generics_defaults.py:166:46: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo7 is not indexable [not-indexable]', 'generics_defaults.py:166:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Self] [assert-type]'] +Line 167: Unexpected errors ['generics_defaults.py:167:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] """ diff --git a/conformance/results/pytype/generics_defaults_referential.toml b/conformance/results/pytype/generics_defaults_referential.toml index 133bd7943..2a72e5070 100644 --- a/conformance/results/pytype/generics_defaults_referential.toml +++ b/conformance/results/pytype/generics_defaults_referential.toml @@ -1,65 +1,217 @@ conformant = "Unsupported" output = """ -File "generics_defaults_referential.py", line 14, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 15, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 16, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 17, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 20, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults_referential.py", line 23, in : class slice is not indexable [not-indexable] -File "generics_defaults_referential.py", line 24, in : class slice is not indexable [not-indexable] -File "generics_defaults_referential.py", line 25, in : class slice is not indexable [not-indexable] -File "generics_defaults_referential.py", line 26, in : class slice is not indexable [not-indexable] -File "generics_defaults_referential.py", line 28, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 31, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults_referential.py", line 35, in : class Foo is not indexable [not-indexable] -File "generics_defaults_referential.py", line 36, in : class Foo is not indexable [not-indexable] -File "generics_defaults_referential.py", line 37, in : class Foo is not indexable [not-indexable] -File "generics_defaults_referential.py", line 43, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 46, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults_referential.py", line 49, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 50, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 53, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults_referential.py", line 60, in Foo3: Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults_referential.py", line 66, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 67, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 68, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 74, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 77, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 78, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 87, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 90, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults_referential.py", line 94, in : Invalid type annotation 'Bar[Any, list]' [invalid-annotation] -File "generics_defaults_referential.py", line 95, in : Invalid type annotation 'Bar[int, List[int]]' [invalid-annotation] -File "generics_defaults_referential.py", line 96, in : Invalid type annotation 'Bar[int, List[int]]' [invalid-annotation] -File "generics_defaults_referential.py", line 97, in : Invalid type annotation 'Bar[int, List[str]]' [invalid-annotation] -File "generics_defaults_referential.py", line 98, in : Invalid type annotation 'Bar[int, str]' [invalid-annotation] +generics_defaults_referential.py:14:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +DefaultStrT = TypeVar("DefaultStrT", default=str) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:15:10: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +StartT = TypeVar("StartT", default=int) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:16:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +StopT = TypeVar("StopT", default=StartT) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:17:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +StepT = TypeVar("StepT", default=int | None) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:20:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class slice(Generic[StartT, StopT, StepT]): ... + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:23:25: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class slice is not indexable [not-indexable] + +assert_type(slice, type[slice[int, int, int | None]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:24:22: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class slice is not indexable [not-indexable] + +assert_type(slice(), slice[int, int, int | None]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:25:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class slice is not indexable [not-indexable] + +assert_type(slice[str](), slice[str, str, int | None]) + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:25:27: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class slice is not indexable [not-indexable] + +assert_type(slice[str](), slice[str, str, int | None]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:26:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class slice is not indexable [not-indexable] + +assert_type(slice[str, bool, complex](), slice[str, bool, complex]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:26:42: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class slice is not indexable [not-indexable] + +assert_type(slice[str, bool, complex](), slice[str, bool, complex]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:28:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +T2 = TypeVar("T2", default=DefaultStrT) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:31:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Foo(Generic[DefaultStrT, T2]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:35:25: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo is not indexable [not-indexable] + +assert_type(Foo(1, ""), Foo[int, str]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:36:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo is not indexable [not-indexable] + +Foo[int](1, "") # E: Foo[int, str] cannot be assigned to self: Foo[int, int] in Foo.__init__ +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:37:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo is not indexable [not-indexable] + +Foo[int]("", 1) # E: Foo[str, int] cannot be assigned to self: Foo[int, int] in Foo.__init__ +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:43:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +S2 = TypeVar("S2", default=S1) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:46:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Foo2(Generic[S1, S2]): ... # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:49:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +Start2T = TypeVar("Start2T", default="StopT") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:50:10: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +Stop2T = TypeVar("Stop2T", default=int) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:53:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class slice2(Generic[Start2T, Stop2T, StepT]): ... # E: bad ordering + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:60:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Foo3: Invalid type annotation 'Generic' [invalid-annotation] + + class Bar2(Generic[S2]): ... # E + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:66:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +TypeVar("Ok1", default=X1, bound=float) # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:67:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +TypeVar("AlsoOk1", default=X1, bound=int) # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:68:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +TypeVar("Invalid1", default=X1, bound=str) # E: int is not a subtype of str +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:74:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +TypeVar("Invalid2", float, str, default=Y1) # E: upper bound int is incompatible with constraints float or str +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:77:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +TypeVar("AlsoOk2", int, str, bool, default=Y2) # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:78:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +TypeVar("AlsoInvalid2", bool, complex, default=Y2) # E: {bool, complex} is not a superset of {int, str} +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:87:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +ListDefaultT = TypeVar("ListDefaultT", default=list[Z1]) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:90:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Bar(Generic[Z1, ListDefaultT]): # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:94:23: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[Any, list]' [invalid-annotation] + +assert_type(Bar, type[Bar[Any, list[Any]]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:95:28: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, List[int]]' [invalid-annotation] + +assert_type(Bar[int], type[Bar[int, list[int]]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:96:30: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, List[int]]' [invalid-annotation] + +assert_type(Bar[int](0, []), Bar[int, list[int]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:97:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, List[str]]' [invalid-annotation] + +assert_type(Bar[int, list[str]](0, []), Bar[int, list[str]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:97:41: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, List[str]]' [invalid-annotation] + +assert_type(Bar[int, list[str]](0, []), Bar[int, list[str]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:98:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, str]' [invalid-annotation] + +assert_type(Bar[int, str](0, ""), Bar[int, str]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:98:35: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, str]' [invalid-annotation] + +assert_type(Bar[int, str](0, ""), Bar[int, str]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 14: Unexpected errors ['File "generics_defaults_referential.py", line 14, in : wrong arguments [invalid-typevar]'] -Line 15: Unexpected errors ['File "generics_defaults_referential.py", line 15, in : wrong arguments [invalid-typevar]'] -Line 16: Unexpected errors ['File "generics_defaults_referential.py", line 16, in : wrong arguments [invalid-typevar]'] -Line 17: Unexpected errors ['File "generics_defaults_referential.py", line 17, in : wrong arguments [invalid-typevar]'] -Line 20: Unexpected errors ['File "generics_defaults_referential.py", line 20, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 23: Unexpected errors ['File "generics_defaults_referential.py", line 23, in : class slice is not indexable [not-indexable]'] -Line 24: Unexpected errors ['File "generics_defaults_referential.py", line 24, in : class slice is not indexable [not-indexable]'] -Line 25: Unexpected errors ['File "generics_defaults_referential.py", line 25, in : class slice is not indexable [not-indexable]'] -Line 26: Unexpected errors ['File "generics_defaults_referential.py", line 26, in : class slice is not indexable [not-indexable]'] -Line 28: Unexpected errors ['File "generics_defaults_referential.py", line 28, in : wrong arguments [invalid-typevar]'] -Line 31: Unexpected errors ['File "generics_defaults_referential.py", line 31, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 35: Unexpected errors ['File "generics_defaults_referential.py", line 35, in : class Foo is not indexable [not-indexable]'] -Line 43: Unexpected errors ['File "generics_defaults_referential.py", line 43, in : wrong arguments [invalid-typevar]'] -Line 46: Unexpected errors ['File "generics_defaults_referential.py", line 46, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 49: Unexpected errors ['File "generics_defaults_referential.py", line 49, in : wrong arguments [invalid-typevar]'] -Line 50: Unexpected errors ['File "generics_defaults_referential.py", line 50, in : wrong arguments [invalid-typevar]'] -Line 66: Unexpected errors ['File "generics_defaults_referential.py", line 66, in : wrong arguments [invalid-typevar]'] -Line 67: Unexpected errors ['File "generics_defaults_referential.py", line 67, in : wrong arguments [invalid-typevar]'] -Line 77: Unexpected errors ['File "generics_defaults_referential.py", line 77, in : wrong arguments [invalid-typevar]'] -Line 87: Unexpected errors ['File "generics_defaults_referential.py", line 87, in : wrong arguments [invalid-typevar]'] -Line 90: Unexpected errors ['File "generics_defaults_referential.py", line 90, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 94: Unexpected errors ['File "generics_defaults_referential.py", line 94, in : Invalid type annotation \\'Bar[Any, list]\\' [invalid-annotation]'] -Line 95: Unexpected errors ['File "generics_defaults_referential.py", line 95, in : Invalid type annotation \\'Bar[int, List[int]]\\' [invalid-annotation]'] -Line 96: Unexpected errors ['File "generics_defaults_referential.py", line 96, in : Invalid type annotation \\'Bar[int, List[int]]\\' [invalid-annotation]'] -Line 97: Unexpected errors ['File "generics_defaults_referential.py", line 97, in : Invalid type annotation \\'Bar[int, List[str]]\\' [invalid-annotation]'] -Line 98: Unexpected errors ['File "generics_defaults_referential.py", line 98, in : Invalid type annotation \\'Bar[int, str]\\' [invalid-annotation]'] +Line 14: Unexpected errors ['generics_defaults_referential.py:14:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 15: Unexpected errors ['generics_defaults_referential.py:15:10: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 16: Unexpected errors ['generics_defaults_referential.py:16:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 17: Unexpected errors ['generics_defaults_referential.py:17:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 20: Unexpected errors ["generics_defaults_referential.py:20:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 23: Unexpected errors ['generics_defaults_referential.py:23:25: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class slice is not indexable [not-indexable]'] +Line 24: Unexpected errors ['generics_defaults_referential.py:24:22: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class slice is not indexable [not-indexable]'] +Line 25: Unexpected errors ['generics_defaults_referential.py:25:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class slice is not indexable [not-indexable]', 'generics_defaults_referential.py:25:27: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class slice is not indexable [not-indexable]'] +Line 26: Unexpected errors ['generics_defaults_referential.py:26:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class slice is not indexable [not-indexable]', 'generics_defaults_referential.py:26:42: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class slice is not indexable [not-indexable]'] +Line 28: Unexpected errors ['generics_defaults_referential.py:28:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 31: Unexpected errors ["generics_defaults_referential.py:31:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 35: Unexpected errors ['generics_defaults_referential.py:35:25: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo is not indexable [not-indexable]'] +Line 43: Unexpected errors ['generics_defaults_referential.py:43:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 46: Unexpected errors ["generics_defaults_referential.py:46:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 49: Unexpected errors ['generics_defaults_referential.py:49:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 50: Unexpected errors ['generics_defaults_referential.py:50:10: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 66: Unexpected errors ['generics_defaults_referential.py:66:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 67: Unexpected errors ['generics_defaults_referential.py:67:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 77: Unexpected errors ['generics_defaults_referential.py:77:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 87: Unexpected errors ['generics_defaults_referential.py:87:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 90: Unexpected errors ["generics_defaults_referential.py:90:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 94: Unexpected errors ["generics_defaults_referential.py:94:23: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[Any, list]' [invalid-annotation]"] +Line 95: Unexpected errors ["generics_defaults_referential.py:95:28: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, List[int]]' [invalid-annotation]"] +Line 96: Unexpected errors ["generics_defaults_referential.py:96:30: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, List[int]]' [invalid-annotation]"] +Line 97: Unexpected errors ["generics_defaults_referential.py:97:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, List[str]]' [invalid-annotation]", "generics_defaults_referential.py:97:41: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, List[str]]' [invalid-annotation]"] +Line 98: Unexpected errors ["generics_defaults_referential.py:98:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, str]' [invalid-annotation]", "generics_defaults_referential.py:98:35: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, str]' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/generics_defaults_specialization.toml b/conformance/results/pytype/generics_defaults_specialization.toml index 2256fad5c..2b77a0a3e 100644 --- a/conformance/results/pytype/generics_defaults_specialization.toml +++ b/conformance/results/pytype/generics_defaults_specialization.toml @@ -1,35 +1,104 @@ conformant = "Unsupported" output = """ -File "generics_defaults_specialization.py", line 15, in : wrong arguments [invalid-typevar] -File "generics_defaults_specialization.py", line 16, in : wrong arguments [invalid-typevar] -File "generics_defaults_specialization.py", line 25, in : Invalid type annotation 'SomethingWithNoDefaults[int, Any][bool]' [invalid-annotation] -File "generics_defaults_specialization.py", line 26, in func1: SomethingWithNoDefaults[int, Any] [assert-type] -File "generics_defaults_specialization.py", line 27, in func1: SomethingWithNoDefaults[int, Any] [assert-type] -File "generics_defaults_specialization.py", line 30, in : Invalid type annotation 'SomethingWithNoDefaults[int, Any][bool, int]' [invalid-annotation] -File "generics_defaults_specialization.py", line 38, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults_specialization.py", line 42, in : Invalid type annotation 'SubclassMe[int, Any]' [invalid-annotation] -File "generics_defaults_specialization.py", line 45, in : class Bar is not indexable [not-indexable] -File "generics_defaults_specialization.py", line 46, in : class Bar is not indexable [not-indexable] -File "generics_defaults_specialization.py", line 47, in : class Bar is not indexable [not-indexable] -File "generics_defaults_specialization.py", line 53, in : Any [assert-type] -File "generics_defaults_specialization.py", line 55, in : class Foo is not indexable [not-indexable] -File "generics_defaults_specialization.py", line 58, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults_specialization.py", line 65, in : class Baz is not indexable [not-indexable] -File "generics_defaults_specialization.py", line 65, in : Invalid type annotation 'Baz[int, str]' [invalid-annotation] +generics_defaults_specialization.py:15:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +DefaultIntT = TypeVar("DefaultIntT", default=int) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:16:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +DefaultStrT = TypeVar("DefaultStrT", default=str) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:25:28: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'SomethingWithNoDefaults[int, Any][bool]' [invalid-annotation] + +def func1(p1: MyAlias, p2: MyAlias[bool]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:26:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: SomethingWithNoDefaults[int, Any] [assert-type] + + assert_type(p1, SomethingWithNoDefaults[int, str]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:27:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: SomethingWithNoDefaults[int, Any] [assert-type] + + assert_type(p2, SomethingWithNoDefaults[int, bool]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:30:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'SomethingWithNoDefaults[int, Any][bool, int]' [invalid-annotation] + +MyAlias[bool, int] # E: too many arguments passed to MyAlias +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:38:18: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class SubclassMe(Generic[T1, DefaultStrT]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:42:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'SubclassMe[int, Any]' [invalid-annotation] + +class Bar(SubclassMe[int, DefaultStrT]): ... + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:45:23: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Bar is not indexable [not-indexable] + +assert_type(Bar, type[Bar[str]]) + \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:46:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Bar is not indexable [not-indexable] + +assert_type(Bar(), Bar[str]) + \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:47:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Bar is not indexable [not-indexable] + +assert_type(Bar[bool](), Bar[bool]) + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:47:26: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Bar is not indexable [not-indexable] + +assert_type(Bar[bool](), Bar[bool]) + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:53:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(Foo().x, str) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:55:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo is not indexable [not-indexable] + +Foo[str] # E: Foo cannot be further subscripted +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:58:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Baz(Generic[DefaultIntT, DefaultStrT]): ... + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:65:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Baz is not indexable [not-indexable] + +v1: Baz[int, str] = Spam() + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:65:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Baz[int, str]' [invalid-annotation] + +v1: Baz[int, str] = Spam() +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 15: Unexpected errors ['File "generics_defaults_specialization.py", line 15, in : wrong arguments [invalid-typevar]'] -Line 16: Unexpected errors ['File "generics_defaults_specialization.py", line 16, in : wrong arguments [invalid-typevar]'] -Line 25: Unexpected errors ['File "generics_defaults_specialization.py", line 25, in : Invalid type annotation \\'SomethingWithNoDefaults[int, Any][bool]\\' [invalid-annotation]'] -Line 26: Unexpected errors ['File "generics_defaults_specialization.py", line 26, in func1: SomethingWithNoDefaults[int, Any] [assert-type]'] -Line 27: Unexpected errors ['File "generics_defaults_specialization.py", line 27, in func1: SomethingWithNoDefaults[int, Any] [assert-type]'] -Line 38: Unexpected errors ['File "generics_defaults_specialization.py", line 38, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 42: Unexpected errors ['File "generics_defaults_specialization.py", line 42, in : Invalid type annotation \\'SubclassMe[int, Any]\\' [invalid-annotation]'] -Line 45: Unexpected errors ['File "generics_defaults_specialization.py", line 45, in : class Bar is not indexable [not-indexable]'] -Line 46: Unexpected errors ['File "generics_defaults_specialization.py", line 46, in : class Bar is not indexable [not-indexable]'] -Line 47: Unexpected errors ['File "generics_defaults_specialization.py", line 47, in : class Bar is not indexable [not-indexable]'] -Line 53: Unexpected errors ['File "generics_defaults_specialization.py", line 53, in : Any [assert-type]'] -Line 58: Unexpected errors ['File "generics_defaults_specialization.py", line 58, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 65: Unexpected errors ['File "generics_defaults_specialization.py", line 65, in : class Baz is not indexable [not-indexable]', 'File "generics_defaults_specialization.py", line 65, in : Invalid type annotation \\'Baz[int, str]\\' [invalid-annotation]'] +Line 15: Unexpected errors ['generics_defaults_specialization.py:15:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 16: Unexpected errors ['generics_defaults_specialization.py:16:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 25: Unexpected errors ["generics_defaults_specialization.py:25:28: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'SomethingWithNoDefaults[int, Any][bool]' [invalid-annotation]"] +Line 26: Unexpected errors ['generics_defaults_specialization.py:26:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: SomethingWithNoDefaults[int, Any] [assert-type]'] +Line 27: Unexpected errors ['generics_defaults_specialization.py:27:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: SomethingWithNoDefaults[int, Any] [assert-type]'] +Line 38: Unexpected errors ["generics_defaults_specialization.py:38:18: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 42: Unexpected errors ["generics_defaults_specialization.py:42:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'SubclassMe[int, Any]' [invalid-annotation]"] +Line 45: Unexpected errors ['generics_defaults_specialization.py:45:23: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Bar is not indexable [not-indexable]'] +Line 46: Unexpected errors ['generics_defaults_specialization.py:46:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Bar is not indexable [not-indexable]'] +Line 47: Unexpected errors ['generics_defaults_specialization.py:47:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Bar is not indexable [not-indexable]', 'generics_defaults_specialization.py:47:26: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Bar is not indexable [not-indexable]'] +Line 53: Unexpected errors ['generics_defaults_specialization.py:53:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] +Line 58: Unexpected errors ["generics_defaults_specialization.py:58:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 65: Unexpected errors ['generics_defaults_specialization.py:65:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Baz is not indexable [not-indexable]', "generics_defaults_specialization.py:65:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Baz[int, str]' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/generics_paramspec_specialization.toml b/conformance/results/pytype/generics_paramspec_specialization.toml index e4e920c9b..cbe272e96 100644 --- a/conformance/results/pytype/generics_paramspec_specialization.toml +++ b/conformance/results/pytype/generics_paramspec_specialization.toml @@ -5,27 +5,75 @@ Does not reject invalid specialization of class with both TypeVar and ParamSpec. Reports error for valid method call involving ParamSpec. """ output = """ -File "generics_paramspec_specialization.py", line 32, in : Invalid type annotation '[int, bool]' [invalid-annotation] -File "generics_paramspec_specialization.py", line 32, in : Invalid type annotation 'Ellipsis' [invalid-annotation] -File "generics_paramspec_specialization.py", line 36, in : Invalid type annotation 'Ellipsis' [invalid-annotation] -File "generics_paramspec_specialization.py", line 40, in : Invalid type annotation '[]' [invalid-annotation] -File "generics_paramspec_specialization.py", line 52, in : Invalid type annotation '[int, str, bool]' [invalid-annotation] -File "generics_paramspec_specialization.py", line 53, in func30: Function expects 1 arg(s), got 3 [wrong-arg-count] -File "generics_paramspec_specialization.py", line 54, in func30: Function expects 1 arg(s), got 3 [wrong-arg-count] -File "generics_paramspec_specialization.py", line 55, in func30: Function expects 1 arg(s), got 3 [wrong-arg-count] -File "generics_paramspec_specialization.py", line 58, in : Invalid type annotation 'ClassC[int, str, bool]' [invalid-annotation] -File "generics_paramspec_specialization.py", line 59, in func31: Function expects 1 arg(s), got 3 [wrong-arg-count] -File "generics_paramspec_specialization.py", line 60, in func31: Function expects 1 arg(s), got 3 [wrong-arg-count] -File "generics_paramspec_specialization.py", line 61, in func31: Function expects 1 arg(s), got 3 [wrong-arg-count] +generics_paramspec_specialization.py:32:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[int, bool]' [invalid-annotation] + +def func22(x: ClassB[int, [int, bool], ...]) -> str: # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_paramspec_specialization.py:32:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Ellipsis' [invalid-annotation] + +def func22(x: ClassB[int, [int, bool], ...]) -> str: # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_paramspec_specialization.py:36:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Ellipsis' [invalid-annotation] + +def func23(x: ClassA[int, ...]) -> str: # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_paramspec_specialization.py:40:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[]' [invalid-annotation] + +def func24(x: ClassB[int, [], []]) -> str: # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_paramspec_specialization.py:52:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[int, str, bool]' [invalid-annotation] + +def func30(x: ClassC[[int, str, bool]]) -> None: # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_paramspec_specialization.py:53:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func30: Function expects 1 arg(s), got 3 [wrong-arg-count] + + x.f(0, "", True) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_paramspec_specialization.py:54:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func30: Function expects 1 arg(s), got 3 [wrong-arg-count] + + x.f("", "", True) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_paramspec_specialization.py:55:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func30: Function expects 1 arg(s), got 3 [wrong-arg-count] + + x.f(0, "", "") # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_paramspec_specialization.py:58:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'ClassC[int, str, bool]' [invalid-annotation] + +def func31(x: ClassC[int, str, bool]) -> None: # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_paramspec_specialization.py:59:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func31: Function expects 1 arg(s), got 3 [wrong-arg-count] + + x.f(0, "", True) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_paramspec_specialization.py:60:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func31: Function expects 1 arg(s), got 3 [wrong-arg-count] + + x.f("", "", True) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_paramspec_specialization.py:61:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func31: Function expects 1 arg(s), got 3 [wrong-arg-count] + + x.f(0, "", "") # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 44: Expected 1 errors -Line 32: Unexpected errors ['File "generics_paramspec_specialization.py", line 32, in : Invalid type annotation \\'[int, bool]\\' [invalid-annotation]', 'File "generics_paramspec_specialization.py", line 32, in : Invalid type annotation \\'Ellipsis\\' [invalid-annotation]'] -Line 36: Unexpected errors ['File "generics_paramspec_specialization.py", line 36, in : Invalid type annotation \\'Ellipsis\\' [invalid-annotation]'] -Line 40: Unexpected errors ['File "generics_paramspec_specialization.py", line 40, in : Invalid type annotation \\'[]\\' [invalid-annotation]'] -Line 52: Unexpected errors ['File "generics_paramspec_specialization.py", line 52, in : Invalid type annotation \\'[int, str, bool]\\' [invalid-annotation]'] -Line 53: Unexpected errors ['File "generics_paramspec_specialization.py", line 53, in func30: Function expects 1 arg(s), got 3 [wrong-arg-count]'] -Line 58: Unexpected errors ['File "generics_paramspec_specialization.py", line 58, in : Invalid type annotation \\'ClassC[int, str, bool]\\' [invalid-annotation]'] -Line 59: Unexpected errors ['File "generics_paramspec_specialization.py", line 59, in func31: Function expects 1 arg(s), got 3 [wrong-arg-count]'] +Line 32: Unexpected errors ["generics_paramspec_specialization.py:32:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[int, bool]' [invalid-annotation]", "generics_paramspec_specialization.py:32:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Ellipsis' [invalid-annotation]"] +Line 36: Unexpected errors ["generics_paramspec_specialization.py:36:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Ellipsis' [invalid-annotation]"] +Line 40: Unexpected errors ["generics_paramspec_specialization.py:40:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[]' [invalid-annotation]"] +Line 52: Unexpected errors ["generics_paramspec_specialization.py:52:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[int, str, bool]' [invalid-annotation]"] +Line 53: Unexpected errors ['generics_paramspec_specialization.py:53:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func30: Function expects 1 arg(s), got 3 [wrong-arg-count]'] +Line 58: Unexpected errors ["generics_paramspec_specialization.py:58:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'ClassC[int, str, bool]' [invalid-annotation]"] +Line 59: Unexpected errors ['generics_paramspec_specialization.py:59:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func31: Function expects 1 arg(s), got 3 [wrong-arg-count]'] """ diff --git a/conformance/results/pytype/generics_scoping.toml b/conformance/results/pytype/generics_scoping.toml index ec46810e8..d9f7e61d4 100644 --- a/conformance/results/pytype/generics_scoping.toml +++ b/conformance/results/pytype/generics_scoping.toml @@ -4,15 +4,85 @@ Fails to reject type alias within generic class that uses class's type variable. Fails to reject unbound type variable in constructor call in global scope. """ output = """ -File "generics_scoping.py", line 29, in : Function MyClass.meth_2 was called with the wrong arguments [wrong-arg-types] -File "generics_scoping.py", line 50, in fun_3: Invalid type annotation 'List[S]' for z [invalid-annotation] -File "generics_scoping.py", line 54, in Bar: Invalid type annotation 'List[S]' for an_attr [invalid-annotation] -File "generics_scoping.py", line 63, in fun_4: Invalid type annotation 'T' [invalid-annotation] -File "generics_scoping.py", line 74, in : Invalid type annotation 'Outer' [invalid-annotation] -File "generics_scoping.py", line 78, in AlsoBad: Invalid type annotation 'List[T]' for x [invalid-annotation] -File "generics_scoping.py", line 80, in AlsoBad: Invalid type annotation 'T' [invalid-annotation] -File "generics_scoping.py", line 94, in : Invalid type annotation 'T' for global_var1 [invalid-annotation] -File "generics_scoping.py", line 95, in : Invalid type annotation 'List[T]' for global_var2 [invalid-annotation] +generics_scoping.py:29:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function MyClass.meth_2 was called with the wrong arguments [wrong-arg-types] + +a.meth_2('a') # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_scoping.py:50:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in fun_3: Invalid type annotation 'List[S]' for z [invalid-annotation] + + z: list[S] = [] # E + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +generics_scoping.py:54:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Bar: Invalid type annotation 'List[S]' for an_attr [invalid-annotation] + + an_attr: list[S] = [] # E + \u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_scoping.py:63:23: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in fun_4: Invalid type annotation 'T' [invalid-annotation] + + a_list: list[T] = [] # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +generics_scoping.py:74:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Outer' [invalid-annotation] + +class Outer(Generic[T]): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + class Bad(Iterable[T]): # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + class AlsoBad: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + x: list[T] # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + def __init__(self, x: list[T]) -> None: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + self.x = x +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + class Inner(Iterable[S]): # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + attr: Inner[T] # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + alias: TypeAlias = list[T] # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + def __init__(self, attr: Inner[T]) -> None: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + self.attr = attr +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_scoping.py:78:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in AlsoBad: Invalid type annotation 'List[T]' for x [invalid-annotation] + + x: list[T] # E + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_scoping.py:80:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in AlsoBad: Invalid type annotation 'T' [invalid-annotation] + + def __init__(self, x: list[T]) -> None: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + self.x = x +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_scoping.py:94:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T' for global_var1 [invalid-annotation] + +global_var1: T # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_scoping.py:95:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'List[T]' for global_var2 [invalid-annotation] + +global_var2: list[T] = [] # E +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -20,7 +90,7 @@ Line 65: Expected 1 errors Line 75: Expected 1 errors Line 87: Expected 1 errors Line 96: Expected 1 errors -Line 63: Unexpected errors ['File "generics_scoping.py", line 63, in fun_4: Invalid type annotation \\'T\\' [invalid-annotation]'] -Line 74: Unexpected errors ['File "generics_scoping.py", line 74, in : Invalid type annotation \\'Outer\\' [invalid-annotation]'] -Line 80: Unexpected errors ['File "generics_scoping.py", line 80, in AlsoBad: Invalid type annotation \\'T\\' [invalid-annotation]'] +Line 63: Unexpected errors ["generics_scoping.py:63:23: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in fun_4: Invalid type annotation 'T' [invalid-annotation]"] +Line 74: Unexpected errors ["generics_scoping.py:74:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Outer' [invalid-annotation]"] +Line 80: Unexpected errors ["generics_scoping.py:80:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in AlsoBad: Invalid type annotation 'T' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/generics_self_advanced.toml b/conformance/results/pytype/generics_self_advanced.toml index 253ce01a6..9a818632f 100644 --- a/conformance/results/pytype/generics_self_advanced.toml +++ b/conformance/results/pytype/generics_self_advanced.toml @@ -3,37 +3,89 @@ notes = """ Does not understand `Self` type. """ output = """ -File "generics_self_advanced.py", line 12, in prop1: bad return type [bad-return-type] +generics_self_advanced.py:12:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in prop1: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 19, in current file -File "generics_self_advanced.py", line 12, in prop1: bad return type [bad-return-type] +generics_self_advanced.py:12:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in prop1: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 18, in current file -File "generics_self_advanced.py", line 19, in : ParentA [assert-type] -File "generics_self_advanced.py", line 29, in method1: bad return type [bad-return-type] +generics_self_advanced.py:19:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : ParentA [assert-type] + +assert_type(ChildA().prop1, ChildA) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_advanced.py:29:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method1: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 38, in method2 -File "generics_self_advanced.py", line 29, in method1: bad return type [bad-return-type] -File "generics_self_advanced.py", line 35, in method2: ChildB [assert-type] -File "generics_self_advanced.py", line 36, in method2: List[ChildB] [assert-type] -File "generics_self_advanced.py", line 37, in method2: ChildB [assert-type] -File "generics_self_advanced.py", line 38, in method2: ChildB [assert-type] -File "generics_self_advanced.py", line 42, in method3: Type[ChildB] [assert-type] -File "generics_self_advanced.py", line 43, in method3: List[ChildB] [assert-type] -File "generics_self_advanced.py", line 44, in method3: ChildB [assert-type] -File "generics_self_advanced.py", line 45, in method3: ChildB [assert-type] +generics_self_advanced.py:29:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method1: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_self_advanced.py:35:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method2: ChildB [assert-type] + + assert_type(self, Self) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_advanced.py:36:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method2: List[ChildB] [assert-type] + + assert_type(self.a, list[Self]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_advanced.py:37:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method2: ChildB [assert-type] + + assert_type(self.a[0], Self) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_advanced.py:38:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method2: ChildB [assert-type] + + assert_type(self.method1(), Self) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_advanced.py:42:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method3: Type[ChildB] [assert-type] + + assert_type(cls, type[Self]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_advanced.py:43:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method3: List[ChildB] [assert-type] + + assert_type(cls.a, list[Self]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_advanced.py:44:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method3: ChildB [assert-type] + + assert_type(cls.a[0], Self) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_advanced.py:45:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method3: ChildB [assert-type] + + assert_type(cls.method1(), Self) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 12: Unexpected errors ['File "generics_self_advanced.py", line 12, in prop1: bad return type [bad-return-type]', 'File "generics_self_advanced.py", line 12, in prop1: bad return type [bad-return-type]'] -Line 19: Unexpected errors ['File "generics_self_advanced.py", line 19, in : ParentA [assert-type]'] -Line 29: Unexpected errors ['File "generics_self_advanced.py", line 29, in method1: bad return type [bad-return-type]', 'File "generics_self_advanced.py", line 29, in method1: bad return type [bad-return-type]'] -Line 35: Unexpected errors ['File "generics_self_advanced.py", line 35, in method2: ChildB [assert-type]'] -Line 36: Unexpected errors ['File "generics_self_advanced.py", line 36, in method2: List[ChildB] [assert-type]'] -Line 37: Unexpected errors ['File "generics_self_advanced.py", line 37, in method2: ChildB [assert-type]'] -Line 38: Unexpected errors ['File "generics_self_advanced.py", line 38, in method2: ChildB [assert-type]'] -Line 42: Unexpected errors ['File "generics_self_advanced.py", line 42, in method3: Type[ChildB] [assert-type]'] -Line 43: Unexpected errors ['File "generics_self_advanced.py", line 43, in method3: List[ChildB] [assert-type]'] -Line 44: Unexpected errors ['File "generics_self_advanced.py", line 44, in method3: ChildB [assert-type]'] -Line 45: Unexpected errors ['File "generics_self_advanced.py", line 45, in method3: ChildB [assert-type]'] +Line 12: Unexpected errors ['generics_self_advanced.py:12:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in prop1: bad return type [bad-return-type]', 'generics_self_advanced.py:12:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in prop1: bad return type [bad-return-type]'] +Line 19: Unexpected errors ['generics_self_advanced.py:19:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : ParentA [assert-type]'] +Line 29: Unexpected errors ['generics_self_advanced.py:29:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method1: bad return type [bad-return-type]', 'generics_self_advanced.py:29:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method1: bad return type [bad-return-type]'] +Line 35: Unexpected errors ['generics_self_advanced.py:35:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: ChildB [assert-type]'] +Line 36: Unexpected errors ['generics_self_advanced.py:36:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: List[ChildB] [assert-type]'] +Line 37: Unexpected errors ['generics_self_advanced.py:37:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: ChildB [assert-type]'] +Line 38: Unexpected errors ['generics_self_advanced.py:38:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: ChildB [assert-type]'] +Line 42: Unexpected errors ['generics_self_advanced.py:42:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method3: Type[ChildB] [assert-type]'] +Line 43: Unexpected errors ['generics_self_advanced.py:43:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method3: List[ChildB] [assert-type]'] +Line 44: Unexpected errors ['generics_self_advanced.py:44:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method3: ChildB [assert-type]'] +Line 45: Unexpected errors ['generics_self_advanced.py:45:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method3: ChildB [assert-type]'] """ diff --git a/conformance/results/pytype/generics_self_attributes.toml b/conformance/results/pytype/generics_self_attributes.toml index 940249455..8079a601d 100644 --- a/conformance/results/pytype/generics_self_attributes.toml +++ b/conformance/results/pytype/generics_self_attributes.toml @@ -3,7 +3,11 @@ notes = """ Does not understand `Self` type. """ output = """ -File "generics_self_attributes.py", line 26, in : Function OrdinalLinkedList.__init__ was called with the wrong arguments [wrong-arg-types] +generics_self_attributes.py:26:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function OrdinalLinkedList.__init__ was called with the wrong arguments [wrong-arg-types] + +xs = OrdinalLinkedList(value=1, next=LinkedList[int](value=2)) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pytype/generics_self_basic.toml b/conformance/results/pytype/generics_self_basic.toml index 717547ba0..0eb9ab43e 100644 --- a/conformance/results/pytype/generics_self_basic.toml +++ b/conformance/results/pytype/generics_self_basic.toml @@ -3,32 +3,68 @@ notes = """ Does not understand `Self` type. """ output = """ -File "generics_self_basic.py", line 14, in set_scale: Shape [assert-type] -File "generics_self_basic.py", line 14, in set_scale: Circle [assert-type] +generics_self_basic.py:14:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in set_scale: Shape [assert-type] + + assert_type(self, Self) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_basic.py:14:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in set_scale: Circle [assert-type] + + assert_type(self, Self) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + Called from (traceback): line 52, in current file -File "generics_self_basic.py", line 27, in from_config: Type[Shape] [assert-type] +generics_self_basic.py:27:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in from_config: Type[Shape] [assert-type] + + assert_type(cls, type[Self]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + Called from (traceback): line 54, in current file -File "generics_self_basic.py", line 27, in from_config: Type[Circle] [assert-type] +generics_self_basic.py:27:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in from_config: Type[Circle] [assert-type] + + assert_type(cls, type[Self]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + Called from (traceback): line 55, in current file -File "generics_self_basic.py", line 40, in difference: Shape [assert-type] -File "generics_self_basic.py", line 64, in set_value: bad return type [bad-return-type] +generics_self_basic.py:40:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in difference: Shape [assert-type] + + assert_type(other, Self) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_basic.py:64:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in set_value: bad return type [bad-return-type] + + def set_value(self, value: T) -> Self: ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + Called from (traceback): line 75, in object_with_concrete_type -File "generics_self_basic.py", line 64, in set_value: bad return type [bad-return-type] +generics_self_basic.py:64:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in set_value: bad return type [bad-return-type] + + def set_value(self, value: T) -> Self: ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + Called from (traceback): line 74, in object_with_concrete_type -File "generics_self_basic.py", line 64, in set_value: bad return type [bad-return-type] -File "generics_self_basic.py", line 67, in Container: unsupported operand type(s) for item retrieval: 'Self: TypeVar' and 'int: Type[int]' [unsupported-operands] +generics_self_basic.py:64:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in set_value: bad return type [bad-return-type] + + def set_value(self, value: T) -> Self: ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + +generics_self_basic.py:67:26: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Container: unsupported operand type(s) for item retrieval: 'Self: TypeVar' and 'int: Type[int]' [unsupported-operands] + + def foo(self, other: Self[int]) -> None: # E + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 20: Expected 1 errors Line 33: Expected 1 errors -Line 14: Unexpected errors ['File "generics_self_basic.py", line 14, in set_scale: Shape [assert-type]', 'File "generics_self_basic.py", line 14, in set_scale: Circle [assert-type]'] -Line 27: Unexpected errors ['File "generics_self_basic.py", line 27, in from_config: Type[Shape] [assert-type]', 'File "generics_self_basic.py", line 27, in from_config: Type[Circle] [assert-type]'] -Line 40: Unexpected errors ['File "generics_self_basic.py", line 40, in difference: Shape [assert-type]'] -Line 64: Unexpected errors ['File "generics_self_basic.py", line 64, in set_value: bad return type [bad-return-type]', 'File "generics_self_basic.py", line 64, in set_value: bad return type [bad-return-type]', 'File "generics_self_basic.py", line 64, in set_value: bad return type [bad-return-type]'] +Line 14: Unexpected errors ['generics_self_basic.py:14:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in set_scale: Shape [assert-type]', 'generics_self_basic.py:14:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in set_scale: Circle [assert-type]'] +Line 27: Unexpected errors ['generics_self_basic.py:27:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in from_config: Type[Shape] [assert-type]', 'generics_self_basic.py:27:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in from_config: Type[Circle] [assert-type]'] +Line 40: Unexpected errors ['generics_self_basic.py:40:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in difference: Shape [assert-type]'] +Line 64: Unexpected errors ['generics_self_basic.py:64:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in set_value: bad return type [bad-return-type]', 'generics_self_basic.py:64:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in set_value: bad return type [bad-return-type]', 'generics_self_basic.py:64:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in set_value: bad return type [bad-return-type]'] """ diff --git a/conformance/results/pytype/generics_self_usage.toml b/conformance/results/pytype/generics_self_usage.toml index d0a2b4aa4..84de50aed 100644 --- a/conformance/results/pytype/generics_self_usage.toml +++ b/conformance/results/pytype/generics_self_usage.toml @@ -3,18 +3,68 @@ notes = """ Does not understand `Self` type. """ output = """ -File "generics_self_usage.py", line 58, in foo: Invalid type annotation 'Self' [invalid-annotation] -File "generics_self_usage.py", line 73, in : Invalid type annotation 'Self' [invalid-annotation] -File "generics_self_usage.py", line 76, in : Invalid type annotation 'Self' for bar [invalid-annotation] -File "generics_self_usage.py", line 82, in has_existing_self_annotation: bad return type [bad-return-type] -File "generics_self_usage.py", line 86, in return_concrete_type: bad return type [bad-return-type] +generics_self_usage.py:58:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in foo: Invalid type annotation 'Self' [invalid-annotation] + + def nested(z: int, inner_self: Self) -> Self: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + print(z) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + print(inner_self.x) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + return inner_self +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_usage.py:73:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Self' [invalid-annotation] + +def foo(bar: Self) -> Self: ... # E: not within a class +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_usage.py:76:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Self' for bar [invalid-annotation] + +bar: Self # E: not within a class +\u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_usage.py:82:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in has_existing_self_annotation: bad return type [bad-return-type] + + def has_existing_self_annotation(self: TFoo2) -> Self: ... # E +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + +generics_self_usage.py:86:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in return_concrete_type: bad return type [bad-return-type] + + return Foo3() # E (see FooChild below for rationale) + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + Called from (traceback): line 92, in child_method -File "generics_self_usage.py", line 103, in : Invalid base class: Self [base-class-error] -File "generics_self_usage.py", line 111, in Base: Invalid type annotation 'Self' [invalid-annotation] -File "generics_self_usage.py", line 116, in Base: Invalid type annotation 'Self' [invalid-annotation] -File "generics_self_usage.py", line 122, in __new__: bad return type [bad-return-type] -File "generics_self_usage.py", line 126, in __mul__: bad return type [bad-return-type] +generics_self_usage.py:103:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: Self [base-class-error] + +class Baz2(Self): ... # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_usage.py:111:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Base: Invalid type annotation 'Self' [invalid-annotation] + + def make() -> Self: # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_usage.py:116:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Base: Invalid type annotation 'Self' [invalid-annotation] + + def return_parameter(foo: Self) -> Self: # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_usage.py:122:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __new__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_self_usage.py:126:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __mul__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -22,7 +72,7 @@ Line 101: Expected 1 errors Line 106: Expected 1 errors Line 121: Expected 1 errors Line 125: Expected 1 errors -Line 58: Unexpected errors ['File "generics_self_usage.py", line 58, in foo: Invalid type annotation \\'Self\\' [invalid-annotation]'] -Line 122: Unexpected errors ['File "generics_self_usage.py", line 122, in __new__: bad return type [bad-return-type]'] -Line 126: Unexpected errors ['File "generics_self_usage.py", line 126, in __mul__: bad return type [bad-return-type]'] +Line 58: Unexpected errors ["generics_self_usage.py:58:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in foo: Invalid type annotation 'Self' [invalid-annotation]"] +Line 122: Unexpected errors ['generics_self_usage.py:122:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __new__: bad return type [bad-return-type]'] +Line 126: Unexpected errors ['generics_self_usage.py:126:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __mul__: bad return type [bad-return-type]'] """ diff --git a/conformance/results/pytype/generics_syntax_infer_variance.toml b/conformance/results/pytype/generics_syntax_infer_variance.toml index ba30a2890..05c5d9bee 100644 --- a/conformance/results/pytype/generics_syntax_infer_variance.toml +++ b/conformance/results/pytype/generics_syntax_infer_variance.toml @@ -3,7 +3,7 @@ notes = """ Type parameter syntax not yet support. """ output = """ -SyntaxError: Type parameter lists are only supported in Python 3.12 and greater (, line 125) +SyntaxError: Type parameter lists are only supported in Python 3.12 and greater (, line 132) """ conformance_automated = "Fail" errors_diff = """ @@ -12,18 +12,17 @@ Line 17: Expected 1 errors Line 29: Expected 1 errors Line 37: Expected 1 errors Line 46: Expected 1 errors -Line 55: Expected 1 errors -Line 68: Expected 1 errors -Line 79: Expected 1 errors -Line 95: Expected 1 errors -Line 96: Expected 1 errors -Line 110: Expected 1 errors -Line 111: 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 119: Expected 1 errors -Line 120: Expected 1 errors -Line 121: Expected 1 errors -Line 129: Expected 1 errors -Line 137: Expected 1 errors -Line 148: Expected 1 errors +Line 125: Expected 1 errors +Line 126: 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 """ diff --git a/conformance/results/pytype/generics_typevartuple_args.toml b/conformance/results/pytype/generics_typevartuple_args.toml index f74bb0691..91227fe9d 100644 --- a/conformance/results/pytype/generics_typevartuple_args.toml +++ b/conformance/results/pytype/generics_typevartuple_args.toml @@ -3,28 +3,110 @@ notes = """ Does not support TypeVarTuple. """ output = """ -File "generics_typevartuple_args.py", line 10, in : typing.TypeVarTuple not supported yet [not-supported-yet] -File "generics_typevartuple_args.py", line 13, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_args.py", line 16, in : No attribute '__iter__' on TypeVarTuple [attribute-error] -File "generics_typevartuple_args.py", line 16, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_args.py", line 17, in args_to_tuple: bad return type [bad-return-type] +generics_typevartuple_args.py:10:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] + +from typing import TypeVarTuple, assert_type +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:13:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Ts = TypeVarTuple("Ts") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:16:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute '__iter__' on TypeVarTuple [attribute-error] + +def args_to_tuple(*args: *Ts) -> tuple[*Ts]: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:16:34: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def args_to_tuple(*args: *Ts) -> tuple[*Ts]: + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:17:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in args_to_tuple: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 20, in current file -File "generics_typevartuple_args.py", line 20, in : Tuple[Any] [assert-type] -File "generics_typevartuple_args.py", line 27, in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter] -File "generics_typevartuple_args.py", line 27, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_args.py", line 27, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_args.py", line 28, in exec_le: bad return type [bad-return-type] +generics_typevartuple_args.py:20:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Any] [assert-type] + +assert_type(args_to_tuple(1, "a"), tuple[int, str]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:27:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter] + +def exec_le(path: str, *args: * tuple[*Ts, Env], env: Env | None = None) -> tuple[*Ts]: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:27:77: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def exec_le(path: str, *args: * tuple[*Ts, Env], env: Env | None = None) -> tuple[*Ts]: + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:27:33: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def exec_le(path: str, *args: * tuple[*Ts, Env], env: Env | None = None) -> tuple[*Ts]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:28:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in exec_le: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 31, in current file -File "generics_typevartuple_args.py", line 31, in : Tuple[Any] [assert-type] -File "generics_typevartuple_args.py", line 32, in : Tuple[Any] [assert-type] -File "generics_typevartuple_args.py", line 42, in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter] -File "generics_typevartuple_args.py", line 51, in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter] -File "generics_typevartuple_args.py", line 51, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_args.py", line 62, in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter] -File "generics_typevartuple_args.py", line 70, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_args.py", line 75, in : Function func4 was called with the wrong arguments [wrong-arg-types] +generics_typevartuple_args.py:31:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Any] [assert-type] + +assert_type(exec_le("", Env()), tuple[()]) # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:32:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Any] [assert-type] + +assert_type(exec_le("", 0, "", Env()), tuple[int, str]) # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:42:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter] + +def func1(*args: * tuple[int, ...]) -> None: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:51:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter] + +def func2(*args: * tuple[int, *tuple[str, ...], str]) -> None: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:51:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func2(*args: * tuple[int, *tuple[str, ...], str]) -> None: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:62:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter] + +def func3(*args: * tuple[int, str]) -> None: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:70:18: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func4(*args: tuple[*Ts]): + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:75:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function func4 was called with the wrong arguments [wrong-arg-types] + +func4((0,), (1, 2)) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -36,17 +118,17 @@ Line 58: Expected 1 errors Line 59: Expected 1 errors Line 67: Expected 1 errors Line 76: Expected 1 errors -Line 10: Unexpected errors ['File "generics_typevartuple_args.py", line 10, in : typing.TypeVarTuple not supported yet [not-supported-yet]'] -Line 13: Unexpected errors ['File "generics_typevartuple_args.py", line 13, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 16: Unexpected errors ['File "generics_typevartuple_args.py", line 16, in : No attribute \\'__iter__\\' on TypeVarTuple [attribute-error]', 'File "generics_typevartuple_args.py", line 16, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 17: Unexpected errors ['File "generics_typevartuple_args.py", line 17, in args_to_tuple: bad return type [bad-return-type]'] -Line 20: Unexpected errors ['File "generics_typevartuple_args.py", line 20, in : Tuple[Any] [assert-type]'] -Line 27: Unexpected errors ['File "generics_typevartuple_args.py", line 27, in : Missing parameter \\'self\\' in call to function tuple.__iter__ [missing-parameter]', 'File "generics_typevartuple_args.py", line 27, in : Invalid type annotation \\'\\' [invalid-annotation]', 'File "generics_typevartuple_args.py", line 27, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 28: Unexpected errors ['File "generics_typevartuple_args.py", line 28, in exec_le: bad return type [bad-return-type]'] -Line 31: Unexpected errors ['File "generics_typevartuple_args.py", line 31, in : Tuple[Any] [assert-type]'] -Line 32: Unexpected errors ['File "generics_typevartuple_args.py", line 32, in : Tuple[Any] [assert-type]'] -Line 42: Unexpected errors ['File "generics_typevartuple_args.py", line 42, in : Missing parameter \\'self\\' in call to function tuple.__iter__ [missing-parameter]'] -Line 51: Unexpected errors ['File "generics_typevartuple_args.py", line 51, in : Missing parameter \\'self\\' in call to function tuple.__iter__ [missing-parameter]', 'File "generics_typevartuple_args.py", line 51, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 62: Unexpected errors ['File "generics_typevartuple_args.py", line 62, in : Missing parameter \\'self\\' in call to function tuple.__iter__ [missing-parameter]'] -Line 70: Unexpected errors ['File "generics_typevartuple_args.py", line 70, in : Invalid type annotation \\'\\' [invalid-annotation]'] +Line 10: Unexpected errors ['generics_typevartuple_args.py:10:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] +Line 13: Unexpected errors ['generics_typevartuple_args.py:13:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 16: Unexpected errors ["generics_typevartuple_args.py:16:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : No attribute '__iter__' on TypeVarTuple [attribute-error]", "generics_typevartuple_args.py:16:34: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 17: Unexpected errors ['generics_typevartuple_args.py:17:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in args_to_tuple: bad return type [bad-return-type]'] +Line 20: Unexpected errors ['generics_typevartuple_args.py:20:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Any] [assert-type]'] +Line 27: Unexpected errors ["generics_typevartuple_args.py:27:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter]", "generics_typevartuple_args.py:27:77: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_args.py:27:33: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 28: Unexpected errors ['generics_typevartuple_args.py:28:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in exec_le: bad return type [bad-return-type]'] +Line 31: Unexpected errors ['generics_typevartuple_args.py:31:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Any] [assert-type]'] +Line 32: Unexpected errors ['generics_typevartuple_args.py:32:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Any] [assert-type]'] +Line 42: Unexpected errors ["generics_typevartuple_args.py:42:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter]"] +Line 51: Unexpected errors ["generics_typevartuple_args.py:51:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter]", "generics_typevartuple_args.py:51:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 62: Unexpected errors ["generics_typevartuple_args.py:62:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter]"] +Line 70: Unexpected errors ["generics_typevartuple_args.py:70:18: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/generics_typevartuple_basic.toml b/conformance/results/pytype/generics_typevartuple_basic.toml index 3116b579d..8bd98126e 100644 --- a/conformance/results/pytype/generics_typevartuple_basic.toml +++ b/conformance/results/pytype/generics_typevartuple_basic.toml @@ -3,78 +3,304 @@ notes = """ Does not support TypeVarTuple. """ output = """ -File "generics_typevartuple_basic.py", line 7, in : typing.TypeVarTuple not supported yet [not-supported-yet] -File "generics_typevartuple_basic.py", line 9, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_basic.py", line 12, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_typevartuple_basic.py", line 16, in : No attribute '__iter__' on TypeVarTuple [attribute-error] -File "generics_typevartuple_basic.py", line 16, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_basic.py", line 17, in func1: bad return type [bad-return-type] -File "generics_typevartuple_basic.py", line 20, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_basic.py", line 23, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_typevartuple_basic.py", line 24, in Array: Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_basic.py", line 25, in __init__: Invalid type annotation 'tuple[*Shape,]' [invalid-annotation] -File "generics_typevartuple_basic.py", line 27, in Array: Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_basic.py", line 36, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_basic.py", line 36, in : Invalid type annotation 'Array[Height, Width]' [invalid-annotation] -File "generics_typevartuple_basic.py", line 36, in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_basic.py", line 37, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_basic.py", line 37, in : Invalid type annotation 'Array[Batch, Height, Width]' [invalid-annotation] -File "generics_typevartuple_basic.py", line 37, in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_basic.py", line 38, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_basic.py", line 38, in : Invalid type annotation 'Array[Time, Batch, Height, Width]' [invalid-annotation] -File "generics_typevartuple_basic.py", line 38, in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_basic.py", line 42, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_basic.py", line 42, in : Invalid type annotation 'Array[Height, Width]' [invalid-annotation] -File "generics_typevartuple_basic.py", line 42, in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_basic.py", line 43, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_basic.py", line 43, in : Invalid type annotation 'Array[Batch, Height, Width]' [invalid-annotation] -File "generics_typevartuple_basic.py", line 43, in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_basic.py", line 44, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_basic.py", line 44, in : Invalid type annotation 'Array[Time, Batch, Height, Width]' [invalid-annotation] -File "generics_typevartuple_basic.py", line 44, in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_basic.py", line 52, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_typevartuple_basic.py", line 53, in ClassA: Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_basic.py", line 54, in __init__: Invalid type annotation 'tuple[*Shape,]' [invalid-annotation] -File "generics_typevartuple_basic.py", line 56, in ClassA: Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_basic.py", line 59, in ClassA: Invalid type annotation '' for args [invalid-annotation] -File "generics_typevartuple_basic.py", line 65, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 3 [wrong-arg-count] -File "generics_typevartuple_basic.py", line 66, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 4 [wrong-arg-count] -File "generics_typevartuple_basic.py", line 67, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 3 [wrong-arg-count] -File "generics_typevartuple_basic.py", line 75, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_basic.py", line 76, in func2: bad return type [bad-return-type] +generics_typevartuple_basic.py:7:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] + +from typing import Generic, NewType, TypeVarTuple, assert_type +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:9:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Ts = TypeVarTuple("Ts") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:12:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Array1(Generic[*Ts]): + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:16:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute '__iter__' on TypeVarTuple [attribute-error] + +def func1(*args: *Ts) -> tuple[*Ts]: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:16:26: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func1(*args: *Ts) -> tuple[*Ts]: + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:17:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:20:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Shape = TypeVarTuple("Shape") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:23:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Array(Generic[*Shape]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:24:31: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Array: Invalid type annotation '' [invalid-annotation] + + def __init__(self, shape: tuple[*Shape]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:25:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __init__: Invalid type annotation 'tuple[*Shape,]' [invalid-annotation] + + self._shape: tuple[*Shape] = shape + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:27:28: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Array: Invalid type annotation '' [invalid-annotation] + + def get_shape(self) -> tuple[*Shape]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:36:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +v1: Array[Height, Width] = Array((Height(1), Width(2))) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:36:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Array[Height, Width]' [invalid-annotation] + +v1: Array[Height, Width] = Array((Height(1), Width(2))) # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:36:28: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] + +v1: Array[Height, Width] = Array((Height(1), Width(2))) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:37:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +v2: Array[Batch, Height, Width] = Array((Batch(1), Height(1), Width(1))) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:37:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Array[Batch, Height, Width]' [invalid-annotation] + +v2: Array[Batch, Height, Width] = Array((Batch(1), Height(1), Width(1))) # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:37:35: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] + +v2: Array[Batch, Height, Width] = Array((Batch(1), Height(1), Width(1))) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:38:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +v3: Array[Time, Batch, Height, Width] = Array( + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:38:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Array[Time, Batch, Height, Width]' [invalid-annotation] + +v3: Array[Time, Batch, Height, Width] = Array( +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:38:41: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] + +v3: Array[Time, Batch, Height, Width] = Array( + \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + (Time(1), Batch(1), Height(1), Width(1)) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +) # OK +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:42:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +v4: Array[Height, Width] = Array(Height(1)) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:42:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Array[Height, Width]' [invalid-annotation] + +v4: Array[Height, Width] = Array(Height(1)) # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:42:28: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] + +v4: Array[Height, Width] = Array(Height(1)) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:43:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +v5: Array[Batch, Height, Width] = Array((Batch(1), Width(1))) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:43:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Array[Batch, Height, Width]' [invalid-annotation] + +v5: Array[Batch, Height, Width] = Array((Batch(1), Width(1))) # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:43:35: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] + +v5: Array[Batch, Height, Width] = Array((Batch(1), Width(1))) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:44:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +v6: Array[Time, Batch, Height, Width] = Array( # E[v6] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:44:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Array[Time, Batch, Height, Width]' [invalid-annotation] + +v6: Array[Time, Batch, Height, Width] = Array( # E[v6] +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:44:41: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] + +v6: Array[Time, Batch, Height, Width] = Array( # E[v6] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + (Time(1), Batch(1), Width(1), Height(1)) # E[v6] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +) +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:52:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class ClassA(Generic[Shape]): # E: not unpacked + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:53:31: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Invalid type annotation '' [invalid-annotation] + + def __init__(self, shape: tuple[Shape]): # E: not unpacked + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:54:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __init__: Invalid type annotation 'tuple[*Shape,]' [invalid-annotation] + + self._shape: tuple[*Shape] = shape + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:56:28: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Invalid type annotation '' [invalid-annotation] + + def get_shape(self) -> tuple[Shape]: # E: not unpacked + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:59:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Invalid type annotation '' for args [invalid-annotation] + + def method1(*args: Shape) -> None: # E: not unpacked + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:65:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 3 [wrong-arg-count] + +Ts1 = TypeVarTuple("Ts1", covariant=True) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:66:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 4 [wrong-arg-count] + +Ts2 = TypeVarTuple("Ts2", int, float) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:67:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 3 [wrong-arg-count] + +Ts3 = TypeVarTuple("Ts3", bound=int) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:75:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func2(arg1: tuple[*Ts], arg2: tuple[*Ts]) -> tuple[*Ts]: + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:75:35: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func2(arg1: tuple[*Ts], arg2: tuple[*Ts]) -> tuple[*Ts]: + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:75:50: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func2(arg1: tuple[*Ts], arg2: tuple[*Ts]) -> tuple[*Ts]: + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:76:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 84, in current file -File "generics_typevartuple_basic.py", line 84, in : Tuple[Any] [assert-type] -File "generics_typevartuple_basic.py", line 90, in : Function func2 was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_basic.py", line 93, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_basic.py", line 94, in multiply: bad return type [bad-return-type] -File "generics_typevartuple_basic.py", line 97, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_basic.py", line 106, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_typevartuple_basic.py", line 106, in : Function list.extend was called with the wrong arguments [wrong-arg-types] +generics_typevartuple_basic.py:84:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Any] [assert-type] + +assert_type(func2((0,), (1,)), tuple[int]) # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:90:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function func2 was called with the wrong arguments [wrong-arg-types] + +func2((0, 0), (0,)) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:93:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def multiply(x: Array[*Shape], y: Array[*Shape]) -> Array[*Shape]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:93:35: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def multiply(x: Array[*Shape], y: Array[*Shape]) -> Array[*Shape]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:93:53: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def multiply(x: Array[*Shape], y: Array[*Shape]) -> Array[*Shape]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:94:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in multiply: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:97:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def func3(x: Array[Height], y: Array[Width], z: Array[Height, Width]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:97:32: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def func3(x: Array[Height], y: Array[Width], z: Array[Height, Width]): + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:97:49: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def func3(x: Array[Height], y: Array[Width], z: Array[Height, Width]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:106:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Array3(Generic[*Ts1, *Ts2]): # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:106:22: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types] + +class Array3(Generic[*Ts1, *Ts2]): # E + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 89: Expected 1 errors Line 99: Expected 1 errors Line 100: Expected 1 errors -Line 7: Unexpected errors ['File "generics_typevartuple_basic.py", line 7, in : typing.TypeVarTuple not supported yet [not-supported-yet]'] -Line 9: Unexpected errors ['File "generics_typevartuple_basic.py", line 9, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 12: Unexpected errors ['File "generics_typevartuple_basic.py", line 12, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 16: Unexpected errors ['File "generics_typevartuple_basic.py", line 16, in : No attribute \\'__iter__\\' on TypeVarTuple [attribute-error]', 'File "generics_typevartuple_basic.py", line 16, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 17: Unexpected errors ['File "generics_typevartuple_basic.py", line 17, in func1: bad return type [bad-return-type]'] -Line 20: Unexpected errors ['File "generics_typevartuple_basic.py", line 20, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 23: Unexpected errors ['File "generics_typevartuple_basic.py", line 23, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 24: Unexpected errors ['File "generics_typevartuple_basic.py", line 24, in Array: Invalid type annotation \\'\\' [invalid-annotation]'] -Line 25: Unexpected errors ['File "generics_typevartuple_basic.py", line 25, in __init__: Invalid type annotation \\'tuple[*Shape,]\\' [invalid-annotation]'] -Line 27: Unexpected errors ['File "generics_typevartuple_basic.py", line 27, in Array: Invalid type annotation \\'\\' [invalid-annotation]'] -Line 36: Unexpected errors ['File "generics_typevartuple_basic.py", line 36, in : class Array is not indexable [not-indexable]', 'File "generics_typevartuple_basic.py", line 36, in : Invalid type annotation \\'Array[Height, Width]\\' [invalid-annotation]', 'File "generics_typevartuple_basic.py", line 36, in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types]'] -Line 37: Unexpected errors ['File "generics_typevartuple_basic.py", line 37, in : class Array is not indexable [not-indexable]', 'File "generics_typevartuple_basic.py", line 37, in : Invalid type annotation \\'Array[Batch, Height, Width]\\' [invalid-annotation]', 'File "generics_typevartuple_basic.py", line 37, in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types]'] -Line 38: Unexpected errors ['File "generics_typevartuple_basic.py", line 38, in : class Array is not indexable [not-indexable]', 'File "generics_typevartuple_basic.py", line 38, in : Invalid type annotation \\'Array[Time, Batch, Height, Width]\\' [invalid-annotation]', 'File "generics_typevartuple_basic.py", line 38, in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types]'] -Line 54: Unexpected errors ['File "generics_typevartuple_basic.py", line 54, in __init__: Invalid type annotation \\'tuple[*Shape,]\\' [invalid-annotation]'] -Line 75: Unexpected errors ['File "generics_typevartuple_basic.py", line 75, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 76: Unexpected errors ['File "generics_typevartuple_basic.py", line 76, in func2: bad return type [bad-return-type]'] -Line 84: Unexpected errors ['File "generics_typevartuple_basic.py", line 84, in : Tuple[Any] [assert-type]'] -Line 93: Unexpected errors ['File "generics_typevartuple_basic.py", line 93, in : class Array is not indexable [not-indexable]'] -Line 94: Unexpected errors ['File "generics_typevartuple_basic.py", line 94, in multiply: bad return type [bad-return-type]'] -Line 97: Unexpected errors ['File "generics_typevartuple_basic.py", line 97, in : class Array is not indexable [not-indexable]'] +Line 7: Unexpected errors ['generics_typevartuple_basic.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] +Line 9: Unexpected errors ['generics_typevartuple_basic.py:9:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 12: Unexpected errors ["generics_typevartuple_basic.py:12:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 16: Unexpected errors ["generics_typevartuple_basic.py:16:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : No attribute '__iter__' on TypeVarTuple [attribute-error]", "generics_typevartuple_basic.py:16:26: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 17: Unexpected errors ['generics_typevartuple_basic.py:17:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: bad return type [bad-return-type]'] +Line 20: Unexpected errors ['generics_typevartuple_basic.py:20:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 23: Unexpected errors ["generics_typevartuple_basic.py:23:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 24: Unexpected errors ["generics_typevartuple_basic.py:24:31: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Array: Invalid type annotation '' [invalid-annotation]"] +Line 25: Unexpected errors ["generics_typevartuple_basic.py:25:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __init__: Invalid type annotation 'tuple[*Shape,]' [invalid-annotation]"] +Line 27: Unexpected errors ["generics_typevartuple_basic.py:27:28: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Array: Invalid type annotation '' [invalid-annotation]"] +Line 36: Unexpected errors ['generics_typevartuple_basic.py:36:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', "generics_typevartuple_basic.py:36:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Array[Height, Width]' [invalid-annotation]", 'generics_typevartuple_basic.py:36:28: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types]'] +Line 37: Unexpected errors ['generics_typevartuple_basic.py:37:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', "generics_typevartuple_basic.py:37:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Array[Batch, Height, Width]' [invalid-annotation]", 'generics_typevartuple_basic.py:37:35: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types]'] +Line 38: Unexpected errors ['generics_typevartuple_basic.py:38:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', "generics_typevartuple_basic.py:38:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Array[Time, Batch, Height, Width]' [invalid-annotation]", 'generics_typevartuple_basic.py:38:41: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types]'] +Line 54: Unexpected errors ["generics_typevartuple_basic.py:54:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __init__: Invalid type annotation 'tuple[*Shape,]' [invalid-annotation]"] +Line 75: Unexpected errors ["generics_typevartuple_basic.py:75:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_basic.py:75:35: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_basic.py:75:50: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 76: Unexpected errors ['generics_typevartuple_basic.py:76:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: bad return type [bad-return-type]'] +Line 84: Unexpected errors ['generics_typevartuple_basic.py:84:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Any] [assert-type]'] +Line 93: Unexpected errors ['generics_typevartuple_basic.py:93:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_basic.py:93:35: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_basic.py:93:53: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 94: Unexpected errors ['generics_typevartuple_basic.py:94:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in multiply: bad return type [bad-return-type]'] +Line 97: Unexpected errors ['generics_typevartuple_basic.py:97:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_basic.py:97:32: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_basic.py:97:49: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] """ diff --git a/conformance/results/pytype/generics_typevartuple_callable.toml b/conformance/results/pytype/generics_typevartuple_callable.toml index 1d934a260..6abb21790 100644 --- a/conformance/results/pytype/generics_typevartuple_callable.toml +++ b/conformance/results/pytype/generics_typevartuple_callable.toml @@ -3,44 +3,126 @@ notes = """ Does not support TypeVarTuple. """ output = """ -File "generics_typevartuple_callable.py", line 10, in : typing.TypeVarTuple not supported yet [not-supported-yet] -File "generics_typevartuple_callable.py", line 12, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_callable.py", line 17, in Process: Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_callable.py", line 17, in Process: Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_callable.py", line 25, in : Function Process.__init__ was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_callable.py", line 26, in : Function Process.__init__ was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_callable.py", line 29, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_callable.py", line 29, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_callable.py", line 29, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_callable.py", line 30, in func2: bad return type [bad-return-type] +generics_typevartuple_callable.py:10:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] + +from typing import Callable, TypeVar, TypeVarTuple, assert_type +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:12:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Ts = TypeVarTuple("Ts") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:17:61: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Process: Invalid type annotation '' [invalid-annotation] + + def __init__(self, target: Callable[[*Ts], None], args: tuple[*Ts]) -> None: + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:17:32: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Process: Invalid type annotation '' [invalid-annotation] + + def __init__(self, target: Callable[[*Ts], None], args: tuple[*Ts]) -> None: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:25:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Process.__init__ was called with the wrong arguments [wrong-arg-types] + +Process(target=func1, args=(0, "")) # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:26:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Process.__init__ was called with the wrong arguments [wrong-arg-types] + +Process(target=func1, args=("", 0)) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:29:57: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func2(f: Callable[[int, *Ts, T], tuple[T, *Ts]]) -> tuple[*Ts, T]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:29:38: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func2(f: Callable[[int, *Ts, T], tuple[T, *Ts]]) -> tuple[*Ts, T]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:29:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func2(f: Callable[[int, *Ts, T], tuple[T, *Ts]]) -> tuple[*Ts, T]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:30:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 42, in current file -File "generics_typevartuple_callable.py", line 34, in callback1: bad return type [bad-return-type] -File "generics_typevartuple_callable.py", line 38, in callback2: bad return type [bad-return-type] -File "generics_typevartuple_callable.py", line 41, in : Function func2 was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_callable.py", line 41, in : Any [assert-type] -File "generics_typevartuple_callable.py", line 42, in : Tuple[Any] [assert-type] -File "generics_typevartuple_callable.py", line 45, in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter] -File "generics_typevartuple_callable.py", line 45, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_callable.py", line 45, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_callable.py", line 46, in func3: bad return type [bad-return-type] +generics_typevartuple_callable.py:34:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in callback1: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:38:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in callback2: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:41:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function func2 was called with the wrong arguments [wrong-arg-types] + +assert_type(func2(callback1), tuple[str, int, complex]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:41:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(func2(callback1), tuple[str, int, complex]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:42:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Any] [assert-type] + +assert_type(func2(callback2), tuple[str]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:45:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter] + +def func3(*args: * tuple[int, *Ts, T]) -> tuple[T, *Ts]: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:45:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func3(*args: * tuple[int, *Ts, T]) -> tuple[T, *Ts]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:45:43: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func3(*args: * tuple[int, *Ts, T]) -> tuple[T, *Ts]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:46:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 49, in current file -File "generics_typevartuple_callable.py", line 49, in : Tuple[Any] [assert-type] +generics_typevartuple_callable.py:49:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Any] [assert-type] + +assert_type(func3(1, "", 3j, 3.4), tuple[float, str, complex]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 10: Unexpected errors ['File "generics_typevartuple_callable.py", line 10, in : typing.TypeVarTuple not supported yet [not-supported-yet]'] -Line 12: Unexpected errors ['File "generics_typevartuple_callable.py", line 12, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 17: Unexpected errors ['File "generics_typevartuple_callable.py", line 17, in Process: Invalid type annotation \\'\\' [invalid-annotation]', 'File "generics_typevartuple_callable.py", line 17, in Process: Invalid type annotation \\'\\' [invalid-annotation]'] -Line 25: Unexpected errors ['File "generics_typevartuple_callable.py", line 25, in : Function Process.__init__ was called with the wrong arguments [wrong-arg-types]'] -Line 29: Unexpected errors ['File "generics_typevartuple_callable.py", line 29, in : Invalid type annotation \\'\\' [invalid-annotation]', 'File "generics_typevartuple_callable.py", line 29, in : Invalid type annotation \\'\\' [invalid-annotation]', 'File "generics_typevartuple_callable.py", line 29, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 30: Unexpected errors ['File "generics_typevartuple_callable.py", line 30, in func2: bad return type [bad-return-type]'] -Line 34: Unexpected errors ['File "generics_typevartuple_callable.py", line 34, in callback1: bad return type [bad-return-type]'] -Line 38: Unexpected errors ['File "generics_typevartuple_callable.py", line 38, in callback2: bad return type [bad-return-type]'] -Line 41: Unexpected errors ['File "generics_typevartuple_callable.py", line 41, in : Function func2 was called with the wrong arguments [wrong-arg-types]', 'File "generics_typevartuple_callable.py", line 41, in : Any [assert-type]'] -Line 42: Unexpected errors ['File "generics_typevartuple_callable.py", line 42, in : Tuple[Any] [assert-type]'] -Line 45: Unexpected errors ['File "generics_typevartuple_callable.py", line 45, in : Missing parameter \\'self\\' in call to function tuple.__iter__ [missing-parameter]', 'File "generics_typevartuple_callable.py", line 45, in : Invalid type annotation \\'\\' [invalid-annotation]', 'File "generics_typevartuple_callable.py", line 45, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 46: Unexpected errors ['File "generics_typevartuple_callable.py", line 46, in func3: bad return type [bad-return-type]'] -Line 49: Unexpected errors ['File "generics_typevartuple_callable.py", line 49, in : Tuple[Any] [assert-type]'] +Line 10: Unexpected errors ['generics_typevartuple_callable.py:10:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] +Line 12: Unexpected errors ['generics_typevartuple_callable.py:12:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 17: Unexpected errors ["generics_typevartuple_callable.py:17:61: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Process: Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_callable.py:17:32: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Process: Invalid type annotation '' [invalid-annotation]"] +Line 25: Unexpected errors ['generics_typevartuple_callable.py:25:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function Process.__init__ was called with the wrong arguments [wrong-arg-types]'] +Line 29: Unexpected errors ["generics_typevartuple_callable.py:29:57: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_callable.py:29:38: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_callable.py:29:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 30: Unexpected errors ['generics_typevartuple_callable.py:30:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: bad return type [bad-return-type]'] +Line 34: Unexpected errors ['generics_typevartuple_callable.py:34:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in callback1: bad return type [bad-return-type]'] +Line 38: Unexpected errors ['generics_typevartuple_callable.py:38:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in callback2: bad return type [bad-return-type]'] +Line 41: Unexpected errors ['generics_typevartuple_callable.py:41:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function func2 was called with the wrong arguments [wrong-arg-types]', 'generics_typevartuple_callable.py:41:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] +Line 42: Unexpected errors ['generics_typevartuple_callable.py:42:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Any] [assert-type]'] +Line 45: Unexpected errors ["generics_typevartuple_callable.py:45:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter]", "generics_typevartuple_callable.py:45:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_callable.py:45:43: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 46: Unexpected errors ['generics_typevartuple_callable.py:46:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: bad return type [bad-return-type]'] +Line 49: Unexpected errors ['generics_typevartuple_callable.py:49:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Any] [assert-type]'] """ diff --git a/conformance/results/pytype/generics_typevartuple_concat.toml b/conformance/results/pytype/generics_typevartuple_concat.toml index 2ec72d803..38a84f716 100644 --- a/conformance/results/pytype/generics_typevartuple_concat.toml +++ b/conformance/results/pytype/generics_typevartuple_concat.toml @@ -3,48 +3,153 @@ notes = """ Does not support TypeVarTuple. """ output = """ -File "generics_typevartuple_concat.py", line 9, in : typing.TypeVarTuple not supported yet [not-supported-yet] -File "generics_typevartuple_concat.py", line 17, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_concat.py", line 18, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_concat.py", line 22, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_typevartuple_concat.py", line 26, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_concat.py", line 27, in add_batch_axis: bad return type [bad-return-type] -File "generics_typevartuple_concat.py", line 30, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_concat.py", line 31, in del_batch_axis: bad return type [bad-return-type] -File "generics_typevartuple_concat.py", line 34, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_concat.py", line 35, in add_batch_channels: bad return type [bad-return-type] -File "generics_typevartuple_concat.py", line 38, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_concat.py", line 40, in func1: class Array is not indexable [not-indexable] -File "generics_typevartuple_concat.py", line 42, in func1: class Array is not indexable [not-indexable] -File "generics_typevartuple_concat.py", line 44, in func1: class Array is not indexable [not-indexable] -File "generics_typevartuple_concat.py", line 47, in : Invalid type annotation 'T' [invalid-annotation] -File "generics_typevartuple_concat.py", line 47, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_concat.py", line 47, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_concat.py", line 48, in prefix_tuple: bad return type [bad-return-type] -File "generics_typevartuple_concat.py", line 51, in : Function prefix_tuple was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_concat.py", line 52, in : Any [assert-type] -File "generics_typevartuple_concat.py", line 55, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_concat.py", line 55, in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_concat.py:9:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] + +from typing import Generic, NewType, TypeVar, TypeVarTuple, assert_type +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:17:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Shape = TypeVarTuple("Shape") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:18:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Ts = TypeVarTuple("Ts") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:22:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Array(Generic[*Ts]): + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:26:23: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def add_batch_axis(x: Array[*Shape]) -> Array[Batch, *Shape]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:26:41: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def add_batch_axis(x: Array[*Shape]) -> Array[Batch, *Shape]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:27:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in add_batch_axis: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:30:23: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def del_batch_axis(x: Array[Batch, *Shape]) -> Array[*Shape]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:30:48: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def del_batch_axis(x: Array[Batch, *Shape]) -> Array[*Shape]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:31:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in del_batch_axis: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:34:27: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def add_batch_channels(x: Array[*Shape]) -> Array[Batch, *Shape, Channels]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:34:45: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def add_batch_channels(x: Array[*Shape]) -> Array[Batch, *Shape, Channels]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:35:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in add_batch_channels: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:38:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def func1(a: Array[Height, Width]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:40:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: class Array is not indexable [not-indexable] + + assert_type(b, Array[Batch, Height, Width]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:42:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: class Array is not indexable [not-indexable] + + assert_type(c, Array[Height, Width]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:44:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: class Array is not indexable [not-indexable] + + assert_type(d, Array[Batch, Height, Width, Channels]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:47:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T' [invalid-annotation] + +def prefix_tuple(x: T, y: tuple[*Ts]) -> tuple[T, *Ts]: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:47:27: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def prefix_tuple(x: T, y: tuple[*Ts]) -> tuple[T, *Ts]: + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:47:42: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def prefix_tuple(x: T, y: tuple[*Ts]) -> tuple[T, *Ts]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:48:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in prefix_tuple: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:51:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function prefix_tuple was called with the wrong arguments [wrong-arg-types] + +z = prefix_tuple(x=0, y=(True, "a")) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:52:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(z, tuple[int, bool, str]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:55:55: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def move_first_element_to_last(tup: tuple[T, *Ts]) -> tuple[*Ts, T]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:55:37: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def move_first_element_to_last(tup: tuple[T, *Ts]) -> tuple[*Ts, T]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 9: Unexpected errors ['File "generics_typevartuple_concat.py", line 9, in : typing.TypeVarTuple not supported yet [not-supported-yet]'] -Line 17: Unexpected errors ['File "generics_typevartuple_concat.py", line 17, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 18: Unexpected errors ['File "generics_typevartuple_concat.py", line 18, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 22: Unexpected errors ['File "generics_typevartuple_concat.py", line 22, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 26: Unexpected errors ['File "generics_typevartuple_concat.py", line 26, in : class Array is not indexable [not-indexable]'] -Line 27: Unexpected errors ['File "generics_typevartuple_concat.py", line 27, in add_batch_axis: bad return type [bad-return-type]'] -Line 30: Unexpected errors ['File "generics_typevartuple_concat.py", line 30, in : class Array is not indexable [not-indexable]'] -Line 31: Unexpected errors ['File "generics_typevartuple_concat.py", line 31, in del_batch_axis: bad return type [bad-return-type]'] -Line 34: Unexpected errors ['File "generics_typevartuple_concat.py", line 34, in : class Array is not indexable [not-indexable]'] -Line 35: Unexpected errors ['File "generics_typevartuple_concat.py", line 35, in add_batch_channels: bad return type [bad-return-type]'] -Line 38: Unexpected errors ['File "generics_typevartuple_concat.py", line 38, in : class Array is not indexable [not-indexable]'] -Line 40: Unexpected errors ['File "generics_typevartuple_concat.py", line 40, in func1: class Array is not indexable [not-indexable]'] -Line 42: Unexpected errors ['File "generics_typevartuple_concat.py", line 42, in func1: class Array is not indexable [not-indexable]'] -Line 44: Unexpected errors ['File "generics_typevartuple_concat.py", line 44, in func1: class Array is not indexable [not-indexable]'] -Line 47: Unexpected errors ['File "generics_typevartuple_concat.py", line 47, in : Invalid type annotation \\'T\\' [invalid-annotation]', 'File "generics_typevartuple_concat.py", line 47, in : Invalid type annotation \\'\\' [invalid-annotation]', 'File "generics_typevartuple_concat.py", line 47, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 48: Unexpected errors ['File "generics_typevartuple_concat.py", line 48, in prefix_tuple: bad return type [bad-return-type]'] -Line 51: Unexpected errors ['File "generics_typevartuple_concat.py", line 51, in : Function prefix_tuple was called with the wrong arguments [wrong-arg-types]'] -Line 52: Unexpected errors ['File "generics_typevartuple_concat.py", line 52, in : Any [assert-type]'] -Line 55: Unexpected errors ['File "generics_typevartuple_concat.py", line 55, in : Invalid type annotation \\'\\' [invalid-annotation]', 'File "generics_typevartuple_concat.py", line 55, in : Invalid type annotation \\'\\' [invalid-annotation]'] +Line 9: Unexpected errors ['generics_typevartuple_concat.py:9:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] +Line 17: Unexpected errors ['generics_typevartuple_concat.py:17:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 18: Unexpected errors ['generics_typevartuple_concat.py:18:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 22: Unexpected errors ["generics_typevartuple_concat.py:22:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 26: Unexpected errors ['generics_typevartuple_concat.py:26:23: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_concat.py:26:41: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 27: Unexpected errors ['generics_typevartuple_concat.py:27:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in add_batch_axis: bad return type [bad-return-type]'] +Line 30: Unexpected errors ['generics_typevartuple_concat.py:30:23: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_concat.py:30:48: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 31: Unexpected errors ['generics_typevartuple_concat.py:31:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in del_batch_axis: bad return type [bad-return-type]'] +Line 34: Unexpected errors ['generics_typevartuple_concat.py:34:27: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_concat.py:34:45: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 35: Unexpected errors ['generics_typevartuple_concat.py:35:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in add_batch_channels: bad return type [bad-return-type]'] +Line 38: Unexpected errors ['generics_typevartuple_concat.py:38:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 40: Unexpected errors ['generics_typevartuple_concat.py:40:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: class Array is not indexable [not-indexable]'] +Line 42: Unexpected errors ['generics_typevartuple_concat.py:42:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: class Array is not indexable [not-indexable]'] +Line 44: Unexpected errors ['generics_typevartuple_concat.py:44:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: class Array is not indexable [not-indexable]'] +Line 47: Unexpected errors ["generics_typevartuple_concat.py:47:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T' [invalid-annotation]", "generics_typevartuple_concat.py:47:27: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_concat.py:47:42: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 48: Unexpected errors ['generics_typevartuple_concat.py:48:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in prefix_tuple: bad return type [bad-return-type]'] +Line 51: Unexpected errors ['generics_typevartuple_concat.py:51:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function prefix_tuple was called with the wrong arguments [wrong-arg-types]'] +Line 52: Unexpected errors ['generics_typevartuple_concat.py:52:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] +Line 55: Unexpected errors ["generics_typevartuple_concat.py:55:55: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_concat.py:55:37: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/generics_typevartuple_overloads.toml b/conformance/results/pytype/generics_typevartuple_overloads.toml index 0dd84622f..6a56bcbe6 100644 --- a/conformance/results/pytype/generics_typevartuple_overloads.toml +++ b/conformance/results/pytype/generics_typevartuple_overloads.toml @@ -3,25 +3,70 @@ notes = """ Does not support TypeVarTuple. """ output = """ -File "generics_typevartuple_overloads.py", line 7, in : typing.TypeVarTuple not supported yet [not-supported-yet] -File "generics_typevartuple_overloads.py", line 10, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_overloads.py", line 16, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_typevartuple_overloads.py", line 18, in Array: class Array is not indexable [not-indexable] -File "generics_typevartuple_overloads.py", line 22, in Array: class Array is not indexable [not-indexable] -File "generics_typevartuple_overloads.py", line 26, in transpose: bad return type [bad-return-type] -File "generics_typevartuple_overloads.py", line 29, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_overloads.py", line 30, in func1: class Array is not indexable [not-indexable] -File "generics_typevartuple_overloads.py", line 31, in func1: class Array is not indexable [not-indexable] +generics_typevartuple_overloads.py:7:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] + +from typing import Any, Generic, TypeVar, TypeVarTuple, assert_type, overload +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_overloads.py:10:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Shape = TypeVarTuple("Shape") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_overloads.py:16:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Array(Generic[*Shape]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_overloads.py:18:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Array: class Array is not indexable [not-indexable] + + def transpose(self: "Array[Axis1, Axis2]") -> "Array[Axis2, Axis1]": + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_overloads.py:22:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Array: class Array is not indexable [not-indexable] + + def transpose(self: "Array[Axis1, Axis2, Axis3]") -> "Array[Axis3, Axis2, Axis1]": + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_overloads.py:26:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in transpose: bad return type [bad-return-type] + + pass + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +generics_typevartuple_overloads.py:29:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def func1(a: Array[Axis1, Axis2], b: Array[Axis1, Axis2, Axis3]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_overloads.py:29:38: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def func1(a: Array[Axis1, Axis2], b: Array[Axis1, Axis2, Axis3]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_overloads.py:30:32: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: class Array is not indexable [not-indexable] + + assert_type(a.transpose(), Array[Axis2, Axis1]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_overloads.py:31:32: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: class Array is not indexable [not-indexable] + + assert_type(b.transpose(), Array[Axis3, Axis2, Axis1]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 7: Unexpected errors ['File "generics_typevartuple_overloads.py", line 7, in : typing.TypeVarTuple not supported yet [not-supported-yet]'] -Line 10: Unexpected errors ['File "generics_typevartuple_overloads.py", line 10, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 16: Unexpected errors ['File "generics_typevartuple_overloads.py", line 16, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 18: Unexpected errors ['File "generics_typevartuple_overloads.py", line 18, in Array: class Array is not indexable [not-indexable]'] -Line 22: Unexpected errors ['File "generics_typevartuple_overloads.py", line 22, in Array: class Array is not indexable [not-indexable]'] -Line 26: Unexpected errors ['File "generics_typevartuple_overloads.py", line 26, in transpose: bad return type [bad-return-type]'] -Line 29: Unexpected errors ['File "generics_typevartuple_overloads.py", line 29, in : class Array is not indexable [not-indexable]'] -Line 30: Unexpected errors ['File "generics_typevartuple_overloads.py", line 30, in func1: class Array is not indexable [not-indexable]'] -Line 31: Unexpected errors ['File "generics_typevartuple_overloads.py", line 31, in func1: class Array is not indexable [not-indexable]'] +Line 7: Unexpected errors ['generics_typevartuple_overloads.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] +Line 10: Unexpected errors ['generics_typevartuple_overloads.py:10:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 16: Unexpected errors ["generics_typevartuple_overloads.py:16:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 18: Unexpected errors ['generics_typevartuple_overloads.py:18:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Array: class Array is not indexable [not-indexable]'] +Line 22: Unexpected errors ['generics_typevartuple_overloads.py:22:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Array: class Array is not indexable [not-indexable]'] +Line 26: Unexpected errors ['generics_typevartuple_overloads.py:26:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in transpose: bad return type [bad-return-type]'] +Line 29: Unexpected errors ['generics_typevartuple_overloads.py:29:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_overloads.py:29:38: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 30: Unexpected errors ['generics_typevartuple_overloads.py:30:32: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: class Array is not indexable [not-indexable]'] +Line 31: Unexpected errors ['generics_typevartuple_overloads.py:31:32: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: class Array is not indexable [not-indexable]'] """ diff --git a/conformance/results/pytype/generics_typevartuple_specialization.toml b/conformance/results/pytype/generics_typevartuple_specialization.toml index a9d75caa2..992d68c45 100644 --- a/conformance/results/pytype/generics_typevartuple_specialization.toml +++ b/conformance/results/pytype/generics_typevartuple_specialization.toml @@ -3,137 +3,452 @@ notes = """ Does not support TypeVarTuple. """ output = """ -File "generics_typevartuple_specialization.py", line 7, in : typing.TypeVarTuple not supported yet [not-supported-yet] -File "generics_typevartuple_specialization.py", line 10, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_specialization.py", line 16, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 24, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_specialization.py", line 28, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_specialization.py", line 33, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_specialization.py", line 41, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 42, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_specialization.py", line 45, in : Invalid type annotation 'Tuple[str, Array][Height]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 45, in : Invalid type annotation 'Tuple[Any][float, bool]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 46, in func3: Tuple[Any] [assert-type] -File "generics_typevartuple_specialization.py", line 47, in func3: class Array is not indexable [not-indexable] -File "generics_typevartuple_specialization.py", line 51, in func4: Tuple[Any] [assert-type] -File "generics_typevartuple_specialization.py", line 55, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_specialization.py", line 59, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 63, in : class Array2 is not indexable [not-indexable] -File "generics_typevartuple_specialization.py", line 64, in : class Array2 is not indexable [not-indexable] -File "generics_typevartuple_specialization.py", line 67, in : class Array2 is not indexable [not-indexable] -File "generics_typevartuple_specialization.py", line 68, in func5_0: class Array2 is not indexable [not-indexable] -File "generics_typevartuple_specialization.py", line 69, in func5_0: class Array2 is not indexable [not-indexable] -File "generics_typevartuple_specialization.py", line 76, in : class Array2 is not indexable [not-indexable] -File "generics_typevartuple_specialization.py", line 80, in : class Array2 is not indexable [not-indexable] -File "generics_typevartuple_specialization.py", line 89, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 92, in : Invalid type annotation 'Tuple[Any][str, int]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 92, in : Invalid type annotation 'Tuple[Any][float]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 93, in func6: Tuple[Any] [assert-type] -File "generics_typevartuple_specialization.py", line 94, in func6: Tuple[Any] [assert-type] -File "generics_typevartuple_specialization.py", line 95, in func6: Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 98, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_specialization.py", line 99, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_specialization.py", line 101, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 102, in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 103, in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 109, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 110, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 117, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 118, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 119, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 120, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 121, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 121, in : Function list.extend was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_specialization.py", line 122, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 122, in : Function list.extend was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_specialization.py", line 125, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 127, in : Invalid type annotation 'Tuple[Any][int]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 130, in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 130, in : Invalid type annotation 'T2' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 130, in : Invalid type annotation 'T1' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 130, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 131, in func7: bad return type [bad-return-type] -File "generics_typevartuple_specialization.py", line 134, in : Invalid type annotation 'Tuple[Any][str, bool]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 134, in : Invalid type annotation 'Tuple[Any][str, bool, float]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 134, in : Invalid type annotation 'Tuple[Any][str, bool, float, int]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 135, in func8: Tuple[Tuple[Any], Any, Any] [assert-type] -File "generics_typevartuple_specialization.py", line 136, in func8: Tuple[Tuple[Any], Any, Any] [assert-type] -File "generics_typevartuple_specialization.py", line 137, in func8: Tuple[Tuple[Any], Any, Any] [assert-type] -File "generics_typevartuple_specialization.py", line 140, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 143, in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 143, in : Invalid type annotation 'T3' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 143, in : Invalid type annotation 'T2' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 143, in : Invalid type annotation 'T1' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 143, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 144, in func9: bad return type [bad-return-type] -File "generics_typevartuple_specialization.py", line 147, in : Invalid type annotation 'Tuple[Any][str, bool, float]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 147, in : Invalid type annotation 'Tuple[Any][str, bool, float, int]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 148, in func10: Tuple[Tuple[Any], Any, Any, Any] [assert-type] -File "generics_typevartuple_specialization.py", line 149, in func10: Tuple[Tuple[Any], Any, Any, Any] [assert-type] -File "generics_typevartuple_specialization.py", line 152, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 153, in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 156, in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 157, in func11: Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 158, in func11: Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 159, in func11: Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 162, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 163, in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] +generics_typevartuple_specialization.py:7:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] + +from typing import Any, Generic, NewType, TypeVar, TypeVarTuple, assert_type +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:10:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Ts = TypeVarTuple("Ts") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:16:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Array(Generic[*Ts]): + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:24:27: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def takes_any_array2(arr: Array[*tuple[Any, ...]]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:28:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def func1(x: Array[Height, Width]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:33:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def func2(y: Array[Time, Height, Width]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:41:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +IntTuple = tuple[int, *Ts] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:42:25: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +NamedArray = tuple[str, Array[*Ts]] + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:45:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[str, Array][Height]' [invalid-annotation] + +def func3(a: IntTuple[float, bool], b: NamedArray[Height]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:45:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][float, bool]' [invalid-annotation] + +def func3(a: IntTuple[float, bool], b: NamedArray[Height]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:46:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Tuple[Any] [assert-type] + + assert_type(a, tuple[int, float, bool]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:47:31: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: class Array is not indexable [not-indexable] + + assert_type(b, tuple[str, Array[Height]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:51:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func4: Tuple[Any] [assert-type] + + assert_type(a, tuple[int]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:55:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Shape = TypeVarTuple("Shape") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:59:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Array2(Generic[DType, *Shape]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:63:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array2 is not indexable [not-indexable] + +FloatArray = Array2[float, *Shape] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:64:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array2 is not indexable [not-indexable] + +Array1D = Array2[DType, Any] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:67:28: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array2 is not indexable [not-indexable] + +def func5_0(a: Array1D, b: Array1D[int]): + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:68:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func5_0: class Array2 is not indexable [not-indexable] + + assert_type(a, Array2[Any, Any]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:69:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func5_0: class Array2 is not indexable [not-indexable] + + assert_type(b, Array2[int, Any]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:76:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array2 is not indexable [not-indexable] + +def func5_1(x: FloatArray[Height, Width]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:80:46: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array2 is not indexable [not-indexable] + +def takes_float_array_with_specific_shape(y: FloatArray[Height, Width]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:89:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +VariadicTuple = tuple[T, *Ts] + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:92:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][str, int]' [invalid-annotation] + +def func6(a: VariadicTuple[str, int], b: VariadicTuple[float], c: VariadicTuple): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:92:42: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][float]' [invalid-annotation] + +def func6(a: VariadicTuple[str, int], b: VariadicTuple[float], c: VariadicTuple): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:93:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func6: Tuple[Any] [assert-type] + + assert_type(a, tuple[str, int]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:94:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func6: Tuple[Any] [assert-type] + + assert_type(b, tuple[float]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:95:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func6: Invalid type annotation '' [invalid-annotation] + + assert_type(c, tuple[Any, *tuple[Any, ...]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:98:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Ts1 = TypeVarTuple("Ts1") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:99:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Ts2 = TypeVarTuple("Ts2") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:101:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +IntTupleVar = tuple[int, *Ts1] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:102:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] + +IntFloatTupleVar = IntTupleVar[float, *Ts2] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:103:21: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] + +IntFloatsTupleVar = IntTupleVar[*tuple[float, ...]] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:109:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +IntTupleGeneric[*Ts] # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:110:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +IntTupleGeneric[*tuple[float, ...]] # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:117:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +TA1 = tuple[*Ts, T1, T2] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:118:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +TA2 = tuple[T1, T2, *Ts] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:119:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +TA3 = tuple[T1, *Ts, T2, T3] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:120:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +TA4 = tuple[T1, T2, *tuple[int, ...]] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:121:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +TA5 = tuple[T1, *Ts, T2, *Ts] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:121:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types] + +TA5 = tuple[T1, *Ts, T2, *Ts] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:122:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +TA6 = tuple[T1, *Ts, T2, *tuple[int, ...]] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:122:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types] + +TA6 = tuple[T1, *Ts, T2, *tuple[int, ...]] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:125:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +TA7 = tuple[*Ts, T1, T2] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:127:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][int]' [invalid-annotation] + +v1: TA7[int] # E: requires at least two type arguments + \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:130:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] + +def func7(a: TA7[*Ts, T1, T2]) -> tuple[tuple[*Ts], T1, T2]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:130:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T2' [invalid-annotation] + +def func7(a: TA7[*Ts, T1, T2]) -> tuple[tuple[*Ts], T1, T2]: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:130:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T1' [invalid-annotation] + +def func7(a: TA7[*Ts, T1, T2]) -> tuple[tuple[*Ts], T1, T2]: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:130:41: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func7(a: TA7[*Ts, T1, T2]) -> tuple[tuple[*Ts], T1, T2]: + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:131:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func7: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:134:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][str, bool]' [invalid-annotation] + +def func8(a: TA7[str, bool], b: TA7[str, bool, float], c: TA7[str, bool, float, int]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:134:33: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float]' [invalid-annotation] + +def func8(a: TA7[str, bool], b: TA7[str, bool, float], c: TA7[str, bool, float, int]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:134:59: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float, int]' [invalid-annotation] + +def func8(a: TA7[str, bool], b: TA7[str, bool, float], c: TA7[str, bool, float, int]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:135:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: Tuple[Tuple[Any], Any, Any] [assert-type] + + assert_type(func7(a), tuple[tuple[()], str, bool]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:136:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: Tuple[Tuple[Any], Any, Any] [assert-type] + + assert_type(func7(b), tuple[tuple[str], bool, float]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:137:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: Tuple[Tuple[Any], Any, Any] [assert-type] + + assert_type(func7(c), tuple[tuple[str, bool], float, int]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:140:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +TA8 = tuple[T1, *Ts, T2, T3] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:143:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] + +def func9(a: TA8[T1, *Ts, T2, T3]) -> tuple[tuple[*Ts], T1, T2, T3]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:143:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T3' [invalid-annotation] + +def func9(a: TA8[T1, *Ts, T2, T3]) -> tuple[tuple[*Ts], T1, T2, T3]: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:143:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T2' [invalid-annotation] + +def func9(a: TA8[T1, *Ts, T2, T3]) -> tuple[tuple[*Ts], T1, T2, T3]: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:143:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T1' [invalid-annotation] + +def func9(a: TA8[T1, *Ts, T2, T3]) -> tuple[tuple[*Ts], T1, T2, T3]: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:143:45: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func9(a: TA8[T1, *Ts, T2, T3]) -> tuple[tuple[*Ts], T1, T2, T3]: + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:144:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:147:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float]' [invalid-annotation] + +def func10(a: TA8[str, bool, float], b: TA8[str, bool, float, int]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:147:41: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float, int]' [invalid-annotation] + +def func10(a: TA8[str, bool, float], b: TA8[str, bool, float, int]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:148:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func10: Tuple[Tuple[Any], Any, Any, Any] [assert-type] + + assert_type(func9(a), tuple[tuple[()], str, bool, float]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:149:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func10: Tuple[Tuple[Any], Any, Any, Any] [assert-type] + + assert_type(func9(b), tuple[tuple[bool], str, float, int]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:152:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +TA9 = tuple[*Ts, T1] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:153:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] + +TA10 = TA9[*tuple[int, ...]] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:156:24: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] + +def func11(a: TA10, b: TA9[*tuple[int, ...], str], c: TA9[*tuple[int, ...], str]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:156:55: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] + +def func11(a: TA10, b: TA9[*tuple[int, ...], str], c: TA9[*tuple[int, ...], str]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:157:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func11: Invalid type annotation '' [invalid-annotation] + + assert_type(a, tuple[*tuple[int, ...], int]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:158:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func11: Invalid type annotation '' [invalid-annotation] + + assert_type(b, tuple[*tuple[int, ...], str]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:159:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func11: Invalid type annotation '' [invalid-annotation] + + assert_type(c, tuple[*tuple[int, ...], str]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:162:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +TA11 = tuple[T, *Ts1] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:163:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] + +TA12 = TA11[*Ts2] # E + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 7: Unexpected errors ['File "generics_typevartuple_specialization.py", line 7, in : typing.TypeVarTuple not supported yet [not-supported-yet]'] -Line 10: Unexpected errors ['File "generics_typevartuple_specialization.py", line 10, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 16: Unexpected errors ['File "generics_typevartuple_specialization.py", line 16, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 24: Unexpected errors ['File "generics_typevartuple_specialization.py", line 24, in : class Array is not indexable [not-indexable]'] -Line 28: Unexpected errors ['File "generics_typevartuple_specialization.py", line 28, in : class Array is not indexable [not-indexable]'] -Line 33: Unexpected errors ['File "generics_typevartuple_specialization.py", line 33, in : class Array is not indexable [not-indexable]'] -Line 41: Unexpected errors ['File "generics_typevartuple_specialization.py", line 41, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 42: Unexpected errors ['File "generics_typevartuple_specialization.py", line 42, in : class Array is not indexable [not-indexable]'] -Line 45: Unexpected errors ['File "generics_typevartuple_specialization.py", line 45, in : Invalid type annotation \\'Tuple[str, Array][Height]\\' [invalid-annotation]', 'File "generics_typevartuple_specialization.py", line 45, in : Invalid type annotation \\'Tuple[Any][float, bool]\\' [invalid-annotation]'] -Line 46: Unexpected errors ['File "generics_typevartuple_specialization.py", line 46, in func3: Tuple[Any] [assert-type]'] -Line 47: Unexpected errors ['File "generics_typevartuple_specialization.py", line 47, in func3: class Array is not indexable [not-indexable]'] -Line 51: Unexpected errors ['File "generics_typevartuple_specialization.py", line 51, in func4: Tuple[Any] [assert-type]'] -Line 55: Unexpected errors ['File "generics_typevartuple_specialization.py", line 55, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 59: Unexpected errors ['File "generics_typevartuple_specialization.py", line 59, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 63: Unexpected errors ['File "generics_typevartuple_specialization.py", line 63, in : class Array2 is not indexable [not-indexable]'] -Line 64: Unexpected errors ['File "generics_typevartuple_specialization.py", line 64, in : class Array2 is not indexable [not-indexable]'] -Line 67: Unexpected errors ['File "generics_typevartuple_specialization.py", line 67, in : class Array2 is not indexable [not-indexable]'] -Line 68: Unexpected errors ['File "generics_typevartuple_specialization.py", line 68, in func5_0: class Array2 is not indexable [not-indexable]'] -Line 69: Unexpected errors ['File "generics_typevartuple_specialization.py", line 69, in func5_0: class Array2 is not indexable [not-indexable]'] -Line 76: Unexpected errors ['File "generics_typevartuple_specialization.py", line 76, in : class Array2 is not indexable [not-indexable]'] -Line 80: Unexpected errors ['File "generics_typevartuple_specialization.py", line 80, in : class Array2 is not indexable [not-indexable]'] -Line 89: Unexpected errors ['File "generics_typevartuple_specialization.py", line 89, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 92: Unexpected errors ['File "generics_typevartuple_specialization.py", line 92, in : Invalid type annotation \\'Tuple[Any][str, int]\\' [invalid-annotation]', 'File "generics_typevartuple_specialization.py", line 92, in : Invalid type annotation \\'Tuple[Any][float]\\' [invalid-annotation]'] -Line 93: Unexpected errors ['File "generics_typevartuple_specialization.py", line 93, in func6: Tuple[Any] [assert-type]'] -Line 94: Unexpected errors ['File "generics_typevartuple_specialization.py", line 94, in func6: Tuple[Any] [assert-type]'] -Line 95: Unexpected errors ['File "generics_typevartuple_specialization.py", line 95, in func6: Invalid type annotation \\'\\' [invalid-annotation]'] -Line 98: Unexpected errors ['File "generics_typevartuple_specialization.py", line 98, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 99: Unexpected errors ['File "generics_typevartuple_specialization.py", line 99, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 101: Unexpected errors ['File "generics_typevartuple_specialization.py", line 101, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 102: Unexpected errors ['File "generics_typevartuple_specialization.py", line 102, in : Invalid type annotation \\'Tuple[Any][]\\' [invalid-annotation]'] -Line 103: Unexpected errors ['File "generics_typevartuple_specialization.py", line 103, in : Invalid type annotation \\'Tuple[Any][]\\' [invalid-annotation]'] -Line 117: Unexpected errors ['File "generics_typevartuple_specialization.py", line 117, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 118: Unexpected errors ['File "generics_typevartuple_specialization.py", line 118, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 119: Unexpected errors ['File "generics_typevartuple_specialization.py", line 119, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 120: Unexpected errors ['File "generics_typevartuple_specialization.py", line 120, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 125: Unexpected errors ['File "generics_typevartuple_specialization.py", line 125, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 130: Unexpected errors ['File "generics_typevartuple_specialization.py", line 130, in : Invalid type annotation \\'Tuple[Any][]\\' [invalid-annotation]', 'File "generics_typevartuple_specialization.py", line 130, in : Invalid type annotation \\'T2\\' [invalid-annotation]', 'File "generics_typevartuple_specialization.py", line 130, in : Invalid type annotation \\'T1\\' [invalid-annotation]', 'File "generics_typevartuple_specialization.py", line 130, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 131: Unexpected errors ['File "generics_typevartuple_specialization.py", line 131, in func7: bad return type [bad-return-type]'] -Line 134: Unexpected errors ['File "generics_typevartuple_specialization.py", line 134, in : Invalid type annotation \\'Tuple[Any][str, bool]\\' [invalid-annotation]', 'File "generics_typevartuple_specialization.py", line 134, in : Invalid type annotation \\'Tuple[Any][str, bool, float]\\' [invalid-annotation]', 'File "generics_typevartuple_specialization.py", line 134, in : Invalid type annotation \\'Tuple[Any][str, bool, float, int]\\' [invalid-annotation]'] -Line 135: Unexpected errors ['File "generics_typevartuple_specialization.py", line 135, in func8: Tuple[Tuple[Any], Any, Any] [assert-type]'] -Line 136: Unexpected errors ['File "generics_typevartuple_specialization.py", line 136, in func8: Tuple[Tuple[Any], Any, Any] [assert-type]'] -Line 137: Unexpected errors ['File "generics_typevartuple_specialization.py", line 137, in func8: Tuple[Tuple[Any], Any, Any] [assert-type]'] -Line 140: Unexpected errors ['File "generics_typevartuple_specialization.py", line 140, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 143: Unexpected errors ['File "generics_typevartuple_specialization.py", line 143, in : Invalid type annotation \\'Tuple[Any][]\\' [invalid-annotation]', 'File "generics_typevartuple_specialization.py", line 143, in : Invalid type annotation \\'T3\\' [invalid-annotation]', 'File "generics_typevartuple_specialization.py", line 143, in : Invalid type annotation \\'T2\\' [invalid-annotation]', 'File "generics_typevartuple_specialization.py", line 143, in : Invalid type annotation \\'T1\\' [invalid-annotation]', 'File "generics_typevartuple_specialization.py", line 143, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 144: Unexpected errors ['File "generics_typevartuple_specialization.py", line 144, in func9: bad return type [bad-return-type]'] -Line 147: Unexpected errors ['File "generics_typevartuple_specialization.py", line 147, in : Invalid type annotation \\'Tuple[Any][str, bool, float]\\' [invalid-annotation]', 'File "generics_typevartuple_specialization.py", line 147, in : Invalid type annotation \\'Tuple[Any][str, bool, float, int]\\' [invalid-annotation]'] -Line 148: Unexpected errors ['File "generics_typevartuple_specialization.py", line 148, in func10: Tuple[Tuple[Any], Any, Any, Any] [assert-type]'] -Line 149: Unexpected errors ['File "generics_typevartuple_specialization.py", line 149, in func10: Tuple[Tuple[Any], Any, Any, Any] [assert-type]'] -Line 152: Unexpected errors ['File "generics_typevartuple_specialization.py", line 152, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 153: Unexpected errors ['File "generics_typevartuple_specialization.py", line 153, in : Invalid type annotation \\'Tuple[Any][]\\' [invalid-annotation]'] -Line 156: Unexpected errors ['File "generics_typevartuple_specialization.py", line 156, in : Invalid type annotation \\'Tuple[Any][]\\' [invalid-annotation]'] -Line 157: Unexpected errors ['File "generics_typevartuple_specialization.py", line 157, in func11: Invalid type annotation \\'\\' [invalid-annotation]'] -Line 158: Unexpected errors ['File "generics_typevartuple_specialization.py", line 158, in func11: Invalid type annotation \\'\\' [invalid-annotation]'] -Line 159: Unexpected errors ['File "generics_typevartuple_specialization.py", line 159, in func11: Invalid type annotation \\'\\' [invalid-annotation]'] -Line 162: Unexpected errors ['File "generics_typevartuple_specialization.py", line 162, in : Invalid type annotation \\'\\' [invalid-annotation]'] +Line 7: Unexpected errors ['generics_typevartuple_specialization.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] +Line 10: Unexpected errors ['generics_typevartuple_specialization.py:10:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 16: Unexpected errors ["generics_typevartuple_specialization.py:16:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 24: Unexpected errors ['generics_typevartuple_specialization.py:24:27: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 28: Unexpected errors ['generics_typevartuple_specialization.py:28:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 33: Unexpected errors ['generics_typevartuple_specialization.py:33:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 41: Unexpected errors ["generics_typevartuple_specialization.py:41:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 42: Unexpected errors ['generics_typevartuple_specialization.py:42:25: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 45: Unexpected errors ["generics_typevartuple_specialization.py:45:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[str, Array][Height]' [invalid-annotation]", "generics_typevartuple_specialization.py:45:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][float, bool]' [invalid-annotation]"] +Line 46: Unexpected errors ['generics_typevartuple_specialization.py:46:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: Tuple[Any] [assert-type]'] +Line 47: Unexpected errors ['generics_typevartuple_specialization.py:47:31: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: class Array is not indexable [not-indexable]'] +Line 51: Unexpected errors ['generics_typevartuple_specialization.py:51:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func4: Tuple[Any] [assert-type]'] +Line 55: Unexpected errors ['generics_typevartuple_specialization.py:55:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 59: Unexpected errors ["generics_typevartuple_specialization.py:59:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 63: Unexpected errors ['generics_typevartuple_specialization.py:63:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array2 is not indexable [not-indexable]'] +Line 64: Unexpected errors ['generics_typevartuple_specialization.py:64:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array2 is not indexable [not-indexable]'] +Line 67: Unexpected errors ['generics_typevartuple_specialization.py:67:28: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array2 is not indexable [not-indexable]'] +Line 68: Unexpected errors ['generics_typevartuple_specialization.py:68:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func5_0: class Array2 is not indexable [not-indexable]'] +Line 69: Unexpected errors ['generics_typevartuple_specialization.py:69:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func5_0: class Array2 is not indexable [not-indexable]'] +Line 76: Unexpected errors ['generics_typevartuple_specialization.py:76:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array2 is not indexable [not-indexable]'] +Line 80: Unexpected errors ['generics_typevartuple_specialization.py:80:46: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array2 is not indexable [not-indexable]'] +Line 89: Unexpected errors ["generics_typevartuple_specialization.py:89:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 92: Unexpected errors ["generics_typevartuple_specialization.py:92:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][str, int]' [invalid-annotation]", "generics_typevartuple_specialization.py:92:42: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][float]' [invalid-annotation]"] +Line 93: Unexpected errors ['generics_typevartuple_specialization.py:93:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Tuple[Any] [assert-type]'] +Line 94: Unexpected errors ['generics_typevartuple_specialization.py:94:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Tuple[Any] [assert-type]'] +Line 95: Unexpected errors ["generics_typevartuple_specialization.py:95:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Invalid type annotation '' [invalid-annotation]"] +Line 98: Unexpected errors ['generics_typevartuple_specialization.py:98:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 99: Unexpected errors ['generics_typevartuple_specialization.py:99:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 101: Unexpected errors ["generics_typevartuple_specialization.py:101:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 102: Unexpected errors ["generics_typevartuple_specialization.py:102:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation]"] +Line 103: Unexpected errors ["generics_typevartuple_specialization.py:103:21: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation]"] +Line 117: Unexpected errors ["generics_typevartuple_specialization.py:117:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 118: Unexpected errors ["generics_typevartuple_specialization.py:118:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 119: Unexpected errors ["generics_typevartuple_specialization.py:119:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 120: Unexpected errors ["generics_typevartuple_specialization.py:120:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 125: Unexpected errors ["generics_typevartuple_specialization.py:125:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 130: Unexpected errors ["generics_typevartuple_specialization.py:130:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation]", "generics_typevartuple_specialization.py:130:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T2' [invalid-annotation]", "generics_typevartuple_specialization.py:130:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T1' [invalid-annotation]", "generics_typevartuple_specialization.py:130:41: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 131: Unexpected errors ['generics_typevartuple_specialization.py:131:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: bad return type [bad-return-type]'] +Line 134: Unexpected errors ["generics_typevartuple_specialization.py:134:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][str, bool]' [invalid-annotation]", "generics_typevartuple_specialization.py:134:33: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float]' [invalid-annotation]", "generics_typevartuple_specialization.py:134:59: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float, int]' [invalid-annotation]"] +Line 135: Unexpected errors ['generics_typevartuple_specialization.py:135:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: Tuple[Tuple[Any], Any, Any] [assert-type]'] +Line 136: Unexpected errors ['generics_typevartuple_specialization.py:136:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: Tuple[Tuple[Any], Any, Any] [assert-type]'] +Line 137: Unexpected errors ['generics_typevartuple_specialization.py:137:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: Tuple[Tuple[Any], Any, Any] [assert-type]'] +Line 140: Unexpected errors ["generics_typevartuple_specialization.py:140:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 143: Unexpected errors ["generics_typevartuple_specialization.py:143:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation]", "generics_typevartuple_specialization.py:143:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T3' [invalid-annotation]", "generics_typevartuple_specialization.py:143:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T2' [invalid-annotation]", "generics_typevartuple_specialization.py:143:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T1' [invalid-annotation]", "generics_typevartuple_specialization.py:143:45: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 144: Unexpected errors ['generics_typevartuple_specialization.py:144:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: bad return type [bad-return-type]'] +Line 147: Unexpected errors ["generics_typevartuple_specialization.py:147:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float]' [invalid-annotation]", "generics_typevartuple_specialization.py:147:41: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float, int]' [invalid-annotation]"] +Line 148: Unexpected errors ['generics_typevartuple_specialization.py:148:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func10: Tuple[Tuple[Any], Any, Any, Any] [assert-type]'] +Line 149: Unexpected errors ['generics_typevartuple_specialization.py:149:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func10: Tuple[Tuple[Any], Any, Any, Any] [assert-type]'] +Line 152: Unexpected errors ["generics_typevartuple_specialization.py:152:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 153: Unexpected errors ["generics_typevartuple_specialization.py:153:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation]"] +Line 156: Unexpected errors ["generics_typevartuple_specialization.py:156:24: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation]", "generics_typevartuple_specialization.py:156:55: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation]"] +Line 157: Unexpected errors ["generics_typevartuple_specialization.py:157:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func11: Invalid type annotation '' [invalid-annotation]"] +Line 158: Unexpected errors ["generics_typevartuple_specialization.py:158:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func11: Invalid type annotation '' [invalid-annotation]"] +Line 159: Unexpected errors ["generics_typevartuple_specialization.py:159:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func11: Invalid type annotation '' [invalid-annotation]"] +Line 162: Unexpected errors ["generics_typevartuple_specialization.py:162:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/generics_typevartuple_unpack.toml b/conformance/results/pytype/generics_typevartuple_unpack.toml index 8a58f520b..b19a75825 100644 --- a/conformance/results/pytype/generics_typevartuple_unpack.toml +++ b/conformance/results/pytype/generics_typevartuple_unpack.toml @@ -3,26 +3,72 @@ notes = """ Does not support TypeVarTuple. """ output = """ -File "generics_typevartuple_unpack.py", line 7, in : typing.TypeVarTuple not supported yet [not-supported-yet] -File "generics_typevartuple_unpack.py", line 14, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_unpack.py", line 17, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_typevartuple_unpack.py", line 21, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_unpack.py", line 26, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_unpack.py", line 33, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_unpack.py", line 36, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_unpack.py", line 40, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_unpack.py", line 44, in : class Array is not indexable [not-indexable] +generics_typevartuple_unpack.py:7:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] + +from typing import Any, Generic, NewType, TypeVarTuple +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_unpack.py:14:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Ts = TypeVarTuple("Ts") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_unpack.py:17:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Array(Generic[*Ts]): + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_unpack.py:21:31: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def process_batch_channels(x: Array[Batch, *tuple[Any, ...], Channels]) -> None: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_unpack.py:26:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + + x: Array[Batch, Height, Width, Channels], y: Array[Batch, Channels], z: Array[Batch] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_unpack.py:26:50: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + + x: Array[Batch, Height, Width, Channels], y: Array[Batch, Channels], z: Array[Batch] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_unpack.py:26:77: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + + x: Array[Batch, Height, Width, Channels], y: Array[Batch, Channels], z: Array[Batch] + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_unpack.py:33:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Shape = TypeVarTuple("Shape") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_unpack.py:36:30: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def expect_variadic_array(x: Array[Batch, *Shape]) -> None: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_unpack.py:40:29: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def expect_precise_array(x: Array[Batch, Height, Width, Channels]) -> None: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_unpack.py:44:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def func4(y: Array[*tuple[Any, ...]]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 30: Expected 1 errors -Line 7: Unexpected errors ['File "generics_typevartuple_unpack.py", line 7, in : typing.TypeVarTuple not supported yet [not-supported-yet]'] -Line 14: Unexpected errors ['File "generics_typevartuple_unpack.py", line 14, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 17: Unexpected errors ['File "generics_typevartuple_unpack.py", line 17, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 21: Unexpected errors ['File "generics_typevartuple_unpack.py", line 21, in : class Array is not indexable [not-indexable]'] -Line 26: Unexpected errors ['File "generics_typevartuple_unpack.py", line 26, in : class Array is not indexable [not-indexable]'] -Line 33: Unexpected errors ['File "generics_typevartuple_unpack.py", line 33, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 36: Unexpected errors ['File "generics_typevartuple_unpack.py", line 36, in : class Array is not indexable [not-indexable]'] -Line 40: Unexpected errors ['File "generics_typevartuple_unpack.py", line 40, in : class Array is not indexable [not-indexable]'] -Line 44: Unexpected errors ['File "generics_typevartuple_unpack.py", line 44, in : class Array is not indexable [not-indexable]'] +Line 7: Unexpected errors ['generics_typevartuple_unpack.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] +Line 14: Unexpected errors ['generics_typevartuple_unpack.py:14:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 17: Unexpected errors ["generics_typevartuple_unpack.py:17:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 21: Unexpected errors ['generics_typevartuple_unpack.py:21:31: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 26: Unexpected errors ['generics_typevartuple_unpack.py:26:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_unpack.py:26:50: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_unpack.py:26:77: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 33: Unexpected errors ['generics_typevartuple_unpack.py:33:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 36: Unexpected errors ['generics_typevartuple_unpack.py:36:30: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 40: Unexpected errors ['generics_typevartuple_unpack.py:40:29: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 44: Unexpected errors ['generics_typevartuple_unpack.py:44:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] """ diff --git a/conformance/results/pytype/generics_upper_bound.toml b/conformance/results/pytype/generics_upper_bound.toml index a999a23b4..756776a8e 100644 --- a/conformance/results/pytype/generics_upper_bound.toml +++ b/conformance/results/pytype/generics_upper_bound.toml @@ -3,15 +3,39 @@ notes = """ Does not properly support assert_type. """ output = """ -File "generics_upper_bound.py", line 24, in Test: Invalid TypeVar: bound cannot contain TypeVars [invalid-typevar] -File "generics_upper_bound.py", line 37, in : list [assert-type] -File "generics_upper_bound.py", line 38, in : set [assert-type] -File "generics_upper_bound.py", line 43, in : Union[list, set] [assert-type] -File "generics_upper_bound.py", line 51, in : Function longer was called with the wrong arguments [wrong-arg-types] -File "generics_upper_bound.py", line 56, in : Invalid TypeVar: constraints and a bound are mutually exclusive [invalid-typevar] +generics_upper_bound.py:24:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Test: Invalid TypeVar: bound cannot contain TypeVars [invalid-typevar] + + T_Bad1 = TypeVar("T_Bad1", bound=list[T]) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_upper_bound.py:37:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : list [assert-type] + +assert_type(longer([1], [1, 2]), list[int]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_upper_bound.py:38:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : set [assert-type] + +assert_type(longer({1}, {1, 2}), set[int]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_upper_bound.py:43:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Union[list, set] [assert-type] + +assert_type(longer([1], {1, 2}), list[int] | set[int]) # E? +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_upper_bound.py:51:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function longer was called with the wrong arguments [wrong-arg-types] + +longer(3, 3) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_upper_bound.py:56:10: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid TypeVar: constraints and a bound are mutually exclusive [invalid-typevar] + +T_Bad2 = TypeVar("T_Bad2", str, int, bound="int") # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 37: Unexpected errors ['File "generics_upper_bound.py", line 37, in : list [assert-type]'] -Line 38: Unexpected errors ['File "generics_upper_bound.py", line 38, in : set [assert-type]'] +Line 37: Unexpected errors ['generics_upper_bound.py:37:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : list [assert-type]'] +Line 38: Unexpected errors ['generics_upper_bound.py:38:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : set [assert-type]'] """ diff --git a/conformance/results/pytype/generics_variance.toml b/conformance/results/pytype/generics_variance.toml index 92664946c..46ec8ed46 100644 --- a/conformance/results/pytype/generics_variance.toml +++ b/conformance/results/pytype/generics_variance.toml @@ -3,12 +3,36 @@ notes = """ Does not support covariant or contravariant TypeVars. """ output = """ -File "generics_variance.py", line 14, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] -File "generics_variance.py", line 14, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] -File "generics_variance.py", line 18, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] -File "generics_variance.py", line 19, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] -File "generics_variance.py", line 27, in __iter__: bad return type [bad-return-type] -File "generics_variance.py", line 52, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] +generics_variance.py:14:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +X1 = TypeVar("X1", covariant=True, contravariant=True) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_variance.py:14:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] + +X1 = TypeVar("X1", covariant=True, contravariant=True) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_variance.py:18:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +T_co = TypeVar("T_co", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_variance.py:19:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] + +T_contra = TypeVar("T_contra", contravariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_variance.py:27:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __iter__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_variance.py:52:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +B_co = TypeVar("B_co", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -24,8 +48,8 @@ Lines 125, 126: Expected error (tag 'CoContra_Child2') Lines 131, 132: Expected error (tag 'CoContra_Child3') Lines 141, 142: Expected error (tag 'CoContra_Child5') Lines 195, 196: Expected error (tag 'ContraToContraToContra_WithTA') -Line 18: Unexpected errors ['File "generics_variance.py", line 18, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 19: Unexpected errors ['File "generics_variance.py", line 19, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] -Line 27: Unexpected errors ['File "generics_variance.py", line 27, in __iter__: bad return type [bad-return-type]'] -Line 52: Unexpected errors ['File "generics_variance.py", line 52, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 18: Unexpected errors ['generics_variance.py:18:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 19: Unexpected errors ['generics_variance.py:19:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] +Line 27: Unexpected errors ['generics_variance.py:27:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __iter__: bad return type [bad-return-type]'] +Line 52: Unexpected errors ['generics_variance.py:52:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] """ diff --git a/conformance/results/pytype/historical_positional.toml b/conformance/results/pytype/historical_positional.toml index 2c02fbd84..563658c06 100644 --- a/conformance/results/pytype/historical_positional.toml +++ b/conformance/results/pytype/historical_positional.toml @@ -4,7 +4,11 @@ Does not apply rules for pre-3.8 positional-only parameters in some cases. Does not reject positional-only parameter after non-positional-only parameter. """ output = """ -File "historical_positional.py", line 43, in : Invalid keyword argument __x to function A.m1 [wrong-keyword-args] +historical_positional.py:43:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument __x to function A.m1 [wrong-keyword-args] + +a.m1(__x=3) # E +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pytype/literals_interactions.toml b/conformance/results/pytype/literals_interactions.toml index abe6af209..a9a4375b2 100644 --- a/conformance/results/pytype/literals_interactions.toml +++ b/conformance/results/pytype/literals_interactions.toml @@ -7,23 +7,67 @@ Does not narrow based on `x is Literal` type guard pattern. Does not narrow based on `x == Literal` type guard pattern. """ output = """ -File "literals_interactions.py", line 11, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_interactions.py", line 46, in open: bad return type [bad-return-type] +literals_interactions.py:11:76: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +def func1(v: tuple[int, str, list[bool]], a: Literal[0], b: Literal[5], c: Literal[-5]): + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_interactions.py:46:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in open: bad return type [bad-return-type] + + pass + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + Called from (traceback): line 51, in current file -File "literals_interactions.py", line 46, in open: bad return type [bad-return-type] +literals_interactions.py:46:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in open: bad return type [bad-return-type] + + pass + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + Called from (traceback): line 50, in current file -File "literals_interactions.py", line 46, in open: bad return type [bad-return-type] +literals_interactions.py:46:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in open: bad return type [bad-return-type] + + pass + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + Called from (traceback): line 49, in current file -File "literals_interactions.py", line 61, in __add__: bad return type [bad-return-type] -File "literals_interactions.py", line 64, in __matmul__: bad return type [bad-return-type] -File "literals_interactions.py", line 67, in transpose: bad return type [bad-return-type] -File "literals_interactions.py", line 72, in func2: Matrix[Any, int] [assert-type] -File "literals_interactions.py", line 93, in parse_status1: Union[Status, str] [assert-type] -File "literals_interactions.py", line 106, in parse_status2: Function expects_bad_status was called with the wrong arguments [wrong-arg-types] -File "literals_interactions.py", line 109, in parse_status2: Function expects_pending_status was called with the wrong arguments [wrong-arg-types] +literals_interactions.py:61:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __add__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +literals_interactions.py:64:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __matmul__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +literals_interactions.py:67:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in transpose: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +literals_interactions.py:72:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Matrix[Any, int] [assert-type] + + assert_type(c, Matrix[Literal[2], Literal[7]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_interactions.py:93:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in parse_status1: Union[Status, str] [assert-type] + + assert_type(s, str) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_interactions.py:106:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in parse_status2: Function expects_bad_status was called with the wrong arguments [wrong-arg-types] + + return expects_bad_status(status) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_interactions.py:109:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in parse_status2: Function expects_pending_status was called with the wrong arguments [wrong-arg-types] + + expects_pending_status(status) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -31,13 +75,13 @@ Line 15: Expected 1 errors Line 16: Expected 1 errors Line 17: Expected 1 errors Line 18: Expected 1 errors -Line 11: Unexpected errors ['File "literals_interactions.py", line 11, in : Invalid type annotation \\'Literal\\' [invalid-annotation]'] -Line 46: Unexpected errors ['File "literals_interactions.py", line 46, in open: bad return type [bad-return-type]', 'File "literals_interactions.py", line 46, in open: bad return type [bad-return-type]', 'File "literals_interactions.py", line 46, in open: bad return type [bad-return-type]'] -Line 61: Unexpected errors ['File "literals_interactions.py", line 61, in __add__: bad return type [bad-return-type]'] -Line 64: Unexpected errors ['File "literals_interactions.py", line 64, in __matmul__: bad return type [bad-return-type]'] -Line 67: Unexpected errors ['File "literals_interactions.py", line 67, in transpose: bad return type [bad-return-type]'] -Line 72: Unexpected errors ['File "literals_interactions.py", line 72, in func2: Matrix[Any, int] [assert-type]'] -Line 93: Unexpected errors ['File "literals_interactions.py", line 93, in parse_status1: Union[Status, str] [assert-type]'] -Line 106: Unexpected errors ['File "literals_interactions.py", line 106, in parse_status2: Function expects_bad_status was called with the wrong arguments [wrong-arg-types]'] -Line 109: Unexpected errors ['File "literals_interactions.py", line 109, in parse_status2: Function expects_pending_status was called with the wrong arguments [wrong-arg-types]'] +Line 11: Unexpected errors ["literals_interactions.py:11:76: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]"] +Line 46: Unexpected errors ['literals_interactions.py:46:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in open: bad return type [bad-return-type]', 'literals_interactions.py:46:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in open: bad return type [bad-return-type]', 'literals_interactions.py:46:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in open: bad return type [bad-return-type]'] +Line 61: Unexpected errors ['literals_interactions.py:61:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __add__: bad return type [bad-return-type]'] +Line 64: Unexpected errors ['literals_interactions.py:64:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __matmul__: bad return type [bad-return-type]'] +Line 67: Unexpected errors ['literals_interactions.py:67:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in transpose: bad return type [bad-return-type]'] +Line 72: Unexpected errors ['literals_interactions.py:72:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: Matrix[Any, int] [assert-type]'] +Line 93: Unexpected errors ['literals_interactions.py:93:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in parse_status1: Union[Status, str] [assert-type]'] +Line 106: Unexpected errors ['literals_interactions.py:106:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in parse_status2: Function expects_bad_status was called with the wrong arguments [wrong-arg-types]'] +Line 109: Unexpected errors ['literals_interactions.py:109:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in parse_status2: Function expects_pending_status was called with the wrong arguments [wrong-arg-types]'] """ diff --git a/conformance/results/pytype/literals_literalstring.toml b/conformance/results/pytype/literals_literalstring.toml index 32d16477f..1a86e0b8c 100644 --- a/conformance/results/pytype/literals_literalstring.toml +++ b/conformance/results/pytype/literals_literalstring.toml @@ -3,20 +3,78 @@ notes = """ Does not understand `LiteralString` special form. """ output = """ -File "literals_literalstring.py", line 8, in : typing.LiteralString not supported yet [not-supported-yet] -File "literals_literalstring.py", line 24, in my_function: bad return type [bad-return-type] -File "literals_literalstring.py", line 36, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_literalstring.py", line 37, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_literalstring.py", line 43, in func1: Type annotation for x2 does not match type of assignment [annotation-type-mismatch] -File "literals_literalstring.py", line 74, in func2: Type annotation for x3 does not match type of assignment [annotation-type-mismatch] -File "literals_literalstring.py", line 75, in func2: Type annotation for x4 does not match type of assignment [annotation-type-mismatch] -File "literals_literalstring.py", line 162, in func8: bad return type [bad-return-type] +literals_literalstring.py:8:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.LiteralString not supported yet [not-supported-yet] + +from typing import ( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + Any, +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + Generic, +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + Literal, +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + LiteralString, +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + Sequence, +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + TypeVar, +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + assert_type, +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + overload, +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m +) +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +literals_literalstring.py:24:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in my_function: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +literals_literalstring.py:36:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +bad_union: Literal["hello", LiteralString] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_literalstring.py:37:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +bad_nesting: Literal[LiteralString] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_literalstring.py:43:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for x2 does not match type of assignment [annotation-type-mismatch] + + x2: Literal[""] = b # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +literals_literalstring.py:74:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Type annotation for x3 does not match type of assignment [annotation-type-mismatch] + + x3: LiteralString = 3 # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +literals_literalstring.py:75:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Type annotation for x4 does not match type of assignment [annotation-type-mismatch] + + x4: LiteralString = b"test" # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +literals_literalstring.py:162:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 166, in current file -File "literals_literalstring.py", line 162, in func8: bad return type [bad-return-type] +literals_literalstring.py:162:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 165, in current file -File "literals_literalstring.py", line 167, in : B [assert-type] +literals_literalstring.py:167:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : B [assert-type] + +assert_type(func8(str(1)), A) # Third overload +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -24,8 +82,8 @@ Line 66: Expected 1 errors Line 120: Expected 1 errors Line 134: Expected 1 errors Line 171: Expected 1 errors -Line 8: Unexpected errors ['File "literals_literalstring.py", line 8, in : typing.LiteralString not supported yet [not-supported-yet]'] -Line 24: Unexpected errors ['File "literals_literalstring.py", line 24, in my_function: bad return type [bad-return-type]'] -Line 162: Unexpected errors ['File "literals_literalstring.py", line 162, in func8: bad return type [bad-return-type]', 'File "literals_literalstring.py", line 162, in func8: bad return type [bad-return-type]'] -Line 167: Unexpected errors ['File "literals_literalstring.py", line 167, in : B [assert-type]'] +Line 8: Unexpected errors ['literals_literalstring.py:8:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.LiteralString not supported yet [not-supported-yet]'] +Line 24: Unexpected errors ['literals_literalstring.py:24:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in my_function: bad return type [bad-return-type]'] +Line 162: Unexpected errors ['literals_literalstring.py:162:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: bad return type [bad-return-type]', 'literals_literalstring.py:162:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: bad return type [bad-return-type]'] +Line 167: Unexpected errors ['literals_literalstring.py:167:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : B [assert-type]'] """ diff --git a/conformance/results/pytype/literals_parameterizations.toml b/conformance/results/pytype/literals_parameterizations.toml index 1cc9d9b30..a1751be55 100644 --- a/conformance/results/pytype/literals_parameterizations.toml +++ b/conformance/results/pytype/literals_parameterizations.toml @@ -3,22 +3,91 @@ notes = """ Does not understand `Literal` type annotation. """ output = """ -File "literals_parameterizations.py", line 17, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 18, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 19, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 33, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 35, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 42, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 43, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 44, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 47, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 48, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 50, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 51, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 53, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 61, in : Invalid type annotation 'Literal[my_function]' [invalid-annotation] -File "literals_parameterizations.py", line 61, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 65, in func2: Type annotation for x1 does not match type of assignment [annotation-type-mismatch] +literals_parameterizations.py:17:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +good1: Literal[26] + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:18:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +good2: Literal[0x1A] + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:19:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +good3: Literal[-4] + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:33:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +AllModes = Literal[ReadOnlyMode, WriteAndTruncateMode, WriteNoTruncateMode, AppendMode] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:35:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +good11: Literal[Literal[Literal[1, 2, 3], "foo"], 5, None] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:35:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +good11: Literal[Literal[Literal[1, 2, 3], "foo"], 5, None] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:42:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +bad2: Literal["foo".replace("o", "b")] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:43:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +bad3: Literal[4 + 3j] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:44:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +bad4: Literal[~5] # E + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:47:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +bad7: Literal[{"a": "b", "c": "d"}] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:48:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +bad8: Literal[int] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:50:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +bad10: Literal[T] # E + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:51:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +bad11: Literal[3.14] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:53:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +bad13: Literal[...] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:61:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal[my_function]' [invalid-annotation] + +y: Literal[my_function] = my_function # E +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +literals_parameterizations.py:61:4: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +y: Literal[my_function] = my_function # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:65:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Type annotation for x1 does not match type of assignment [annotation-type-mismatch] + + x1: Literal["Color.RED"] = a # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -29,9 +98,9 @@ Line 49: Expected 1 errors Line 52: Expected 1 errors Line 56: Expected 1 errors Line 60: Expected 1 errors -Line 17: Unexpected errors ['File "literals_parameterizations.py", line 17, in : Invalid type annotation \\'Literal\\' [invalid-annotation]'] -Line 18: Unexpected errors ['File "literals_parameterizations.py", line 18, in : Invalid type annotation \\'Literal\\' [invalid-annotation]'] -Line 19: Unexpected errors ['File "literals_parameterizations.py", line 19, in : Invalid type annotation \\'Literal\\' [invalid-annotation]'] -Line 33: Unexpected errors ['File "literals_parameterizations.py", line 33, in : Invalid type annotation \\'Literal\\' [invalid-annotation]'] -Line 35: Unexpected errors ['File "literals_parameterizations.py", line 35, in : Invalid type annotation \\'Literal\\' [invalid-annotation]'] +Line 17: Unexpected errors ["literals_parameterizations.py:17:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]"] +Line 18: Unexpected errors ["literals_parameterizations.py:18:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]"] +Line 19: Unexpected errors ["literals_parameterizations.py:19:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]"] +Line 33: Unexpected errors ["literals_parameterizations.py:33:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]"] +Line 35: Unexpected errors ["literals_parameterizations.py:35:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]", "literals_parameterizations.py:35:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/literals_semantics.toml b/conformance/results/pytype/literals_semantics.toml index afe670975..e443c9509 100644 --- a/conformance/results/pytype/literals_semantics.toml +++ b/conformance/results/pytype/literals_semantics.toml @@ -3,22 +3,60 @@ notes = """ Does not understand `Literal` type annotation. """ output = """ -File "literals_semantics.py", line 10, in : Type annotation for v2 does not match type of assignment [annotation-type-mismatch] -File "literals_semantics.py", line 12, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_semantics.py", line 12, in : Invalid type annotation 'L[-3]' [invalid-annotation] -File "literals_semantics.py", line 16, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_semantics.py", line 17, in func1: Invalid type annotation 'Literal[20]' [invalid-annotation] -File "literals_semantics.py", line 18, in func1: Invalid type annotation 'Literal[20]' [invalid-annotation] -File "literals_semantics.py", line 19, in func1: Invalid type annotation 'Literal[20]' [invalid-annotation] +literals_semantics.py:10:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for v2 does not match type of assignment [annotation-type-mismatch] + +v2: Literal[3] = 4 # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +literals_semantics.py:12:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +v3: L[-3] = -3 + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +literals_semantics.py:12:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'L[-3]' [invalid-annotation] + +v3: L[-3] = -3 +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +literals_semantics.py:16:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +def func1(a: Literal[20], b: Literal[0x14], c: Literal[0b10100]): + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_semantics.py:16:30: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +def func1(a: Literal[20], b: Literal[0x14], c: Literal[0b10100]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_semantics.py:16:48: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +def func1(a: Literal[20], b: Literal[0x14], c: Literal[0b10100]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_semantics.py:17:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Invalid type annotation 'Literal[20]' [invalid-annotation] + + x1: Literal[0x14] = a + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +literals_semantics.py:18:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Invalid type annotation 'Literal[20]' [invalid-annotation] + + x2: Literal[0x14] = b + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +literals_semantics.py:19:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Invalid type annotation 'Literal[20]' [invalid-annotation] + + x3: Literal[0x14] = c + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 24: Expected 1 errors Line 25: Expected 1 errors Line 33: Expected 1 errors -Line 12: Unexpected errors ['File "literals_semantics.py", line 12, in : Invalid type annotation \\'Literal\\' [invalid-annotation]', 'File "literals_semantics.py", line 12, in : Invalid type annotation \\'L[-3]\\' [invalid-annotation]'] -Line 16: Unexpected errors ['File "literals_semantics.py", line 16, in : Invalid type annotation \\'Literal\\' [invalid-annotation]'] -Line 17: Unexpected errors ['File "literals_semantics.py", line 17, in func1: Invalid type annotation \\'Literal[20]\\' [invalid-annotation]'] -Line 18: Unexpected errors ['File "literals_semantics.py", line 18, in func1: Invalid type annotation \\'Literal[20]\\' [invalid-annotation]'] -Line 19: Unexpected errors ['File "literals_semantics.py", line 19, in func1: Invalid type annotation \\'Literal[20]\\' [invalid-annotation]'] +Line 12: Unexpected errors ["literals_semantics.py:12:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]", "literals_semantics.py:12:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'L[-3]' [invalid-annotation]"] +Line 16: Unexpected errors ["literals_semantics.py:16:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]", "literals_semantics.py:16:30: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]", "literals_semantics.py:16:48: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]"] +Line 17: Unexpected errors ["literals_semantics.py:17:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Invalid type annotation 'Literal[20]' [invalid-annotation]"] +Line 18: Unexpected errors ["literals_semantics.py:18:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Invalid type annotation 'Literal[20]' [invalid-annotation]"] +Line 19: Unexpected errors ["literals_semantics.py:19:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Invalid type annotation 'Literal[20]' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/namedtuples_define_class.toml b/conformance/results/pytype/namedtuples_define_class.toml index 354819a99..bad1600de 100644 --- a/conformance/results/pytype/namedtuples_define_class.toml +++ b/conformance/results/pytype/namedtuples_define_class.toml @@ -9,17 +9,61 @@ Does not reject incorrect argument type passed to specialized generic named tupl Does not reject attempt to use NamedTuple with multiple inheritance. """ output = """ -File "namedtuples_define_class.py", line 27, in : Union[int, str] [assert-type] -File "namedtuples_define_class.py", line 28, in : Union[int, str] [assert-type] -File "namedtuples_define_class.py", line 29, in : Tuple[Union[int, str], ...] [assert-type] -File "namedtuples_define_class.py", line 30, in : Tuple[Union[int, str], ...] [assert-type] -File "namedtuples_define_class.py", line 44, in : Missing parameter 'y' in call to function Point.__new__ [missing-parameter] -File "namedtuples_define_class.py", line 45, in : Missing parameter 'y' in call to function Point.__new__ [missing-parameter] -File "namedtuples_define_class.py", line 46, in : Function Point.__new__ was called with the wrong arguments [wrong-arg-types] -File "namedtuples_define_class.py", line 47, in : Function Point.__new__ was called with the wrong arguments [wrong-arg-types] -File "namedtuples_define_class.py", line 48, in : Function Point.__new__ expects 3 arg(s), got 5 [wrong-arg-count] -File "namedtuples_define_class.py", line 49, in : Invalid keyword argument other to function Point.__new__ [wrong-keyword-args] -File "namedtuples_define_class.py", line 95, in : Any [assert-type] +namedtuples_define_class.py:27:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Union[int, str] [assert-type] + +assert_type(p1[-2], int) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_class.py:28:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Union[int, str] [assert-type] + +assert_type(p1[-3], int) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_class.py:29:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Union[int, str], ...] [assert-type] + +assert_type(p1[0:2], tuple[int, int]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_class.py:30:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Union[int, str], ...] [assert-type] + +assert_type(p1[0:], tuple[int, int, str]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_class.py:44:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'y' in call to function Point.__new__ [missing-parameter] + +p5 = Point(1) # E + \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_class.py:45:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'y' in call to function Point.__new__ [missing-parameter] + +p6 = Point(x=1) # E + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_class.py:46:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Point.__new__ was called with the wrong arguments [wrong-arg-types] + +p7 = Point(1, "") # E + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_class.py:47:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Point.__new__ was called with the wrong arguments [wrong-arg-types] + +p8 = Point(1, 2, units=3) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_class.py:48:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Point.__new__ expects 3 arg(s), got 5 [wrong-arg-count] + +p9 = Point(1, 2, "", "") # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_class.py:49:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument other to function Point.__new__ [wrong-keyword-args] + +p10 = Point(1, 2, "", other="") # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_class.py:95:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(pr1[1], float) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -29,9 +73,9 @@ Line 59: Expected 1 errors Line 79: Expected 1 errors Line 98: Expected 1 errors Line 105: Expected 1 errors -Line 27: Unexpected errors ['File "namedtuples_define_class.py", line 27, in : Union[int, str] [assert-type]'] -Line 28: Unexpected errors ['File "namedtuples_define_class.py", line 28, in : Union[int, str] [assert-type]'] -Line 29: Unexpected errors ['File "namedtuples_define_class.py", line 29, in : Tuple[Union[int, str], ...] [assert-type]'] -Line 30: Unexpected errors ['File "namedtuples_define_class.py", line 30, in : Tuple[Union[int, str], ...] [assert-type]'] -Line 95: Unexpected errors ['File "namedtuples_define_class.py", line 95, in : Any [assert-type]'] +Line 27: Unexpected errors ['namedtuples_define_class.py:27:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Union[int, str] [assert-type]'] +Line 28: Unexpected errors ['namedtuples_define_class.py:28:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Union[int, str] [assert-type]'] +Line 29: Unexpected errors ['namedtuples_define_class.py:29:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Union[int, str], ...] [assert-type]'] +Line 30: Unexpected errors ['namedtuples_define_class.py:30:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Union[int, str], ...] [assert-type]'] +Line 95: Unexpected errors ['namedtuples_define_class.py:95:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] """ diff --git a/conformance/results/pytype/namedtuples_define_functional.toml b/conformance/results/pytype/namedtuples_define_functional.toml index ab1f06c02..f18a771b4 100644 --- a/conformance/results/pytype/namedtuples_define_functional.toml +++ b/conformance/results/pytype/namedtuples_define_functional.toml @@ -4,21 +4,69 @@ Does not handle illegal named tuple names the same as runtime. Does not support defaults in functional form. """ output = """ -File "namedtuples_define_functional.py", line 16, in : Missing parameter 'y' in call to function Point1.__new__ [missing-parameter] -File "namedtuples_define_functional.py", line 21, in : Missing parameter 'x' in call to function Point2.__new__ [missing-parameter] -File "namedtuples_define_functional.py", line 26, in : Function Point3.__new__ expects 3 arg(s), got 4 [wrong-arg-count] -File "namedtuples_define_functional.py", line 31, in : Invalid keyword argument z to function Point4.__new__ [wrong-keyword-args] -File "namedtuples_define_functional.py", line 36, in : Function Point5.__new__ was called with the wrong arguments [wrong-arg-types] -File "namedtuples_define_functional.py", line 37, in : Function Point5.__new__ expects 3 arg(s), got 4 [wrong-arg-count] -File "namedtuples_define_functional.py", line 42, in : Function Point6.__new__ was called with the wrong arguments [wrong-arg-types] -File "namedtuples_define_functional.py", line 43, in : Function Point6.__new__ was called with the wrong arguments [wrong-arg-types] -File "namedtuples_define_functional.py", line 52, in : collections.namedtuple argument 'a' is not a valid typename or field name. [invalid-namedtuple-arg] -File "namedtuples_define_functional.py", line 53, in : collections.namedtuple argument 'def' is not a valid typename or field name. [invalid-namedtuple-arg] -File "namedtuples_define_functional.py", line 54, in : collections.namedtuple argument 'def' is not a valid typename or field name. [invalid-namedtuple-arg] -File "namedtuples_define_functional.py", line 63, in : Function collections.namedtuple was called with the wrong arguments [wrong-arg-types] +namedtuples_define_functional.py:16:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'y' in call to function Point1.__new__ [missing-parameter] + +p1_3 = Point1(2.3) # E + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_functional.py:21:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'x' in call to function Point2.__new__ [missing-parameter] + +p2_3 = Point2() # E + \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_functional.py:26:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Point3.__new__ expects 3 arg(s), got 4 [wrong-arg-count] + +p3_3 = Point3(1, 2, 3) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_functional.py:31:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument z to function Point4.__new__ [wrong-keyword-args] + +p4_3 = Point4(1, z=3) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_functional.py:36:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Point5.__new__ was called with the wrong arguments [wrong-arg-types] + +p5_3 = Point5(2, "1") # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_functional.py:37:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Point5.__new__ expects 3 arg(s), got 4 [wrong-arg-count] + +p5_4 = Point5(1, 2, 3) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_functional.py:42:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Point6.__new__ was called with the wrong arguments [wrong-arg-types] + +p6_3 = Point6(2, "1") # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_functional.py:43:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Point6.__new__ was called with the wrong arguments [wrong-arg-types] + +p6_4 = Point6(x=1.1, y=2) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_functional.py:52:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : collections.namedtuple argument 'a' is not a valid typename or field name. [invalid-namedtuple-arg] + +NT1 = namedtuple("NT1", ["a", "a"]) # E?: duplicate field name + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_functional.py:53:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : collections.namedtuple argument 'def' is not a valid typename or field name. [invalid-namedtuple-arg] + +NT2 = namedtuple("NT2", ["abc", "def"]) # E?: illegal field name + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_functional.py:54:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : collections.namedtuple argument 'def' is not a valid typename or field name. [invalid-namedtuple-arg] + +NT3 = namedtuple("NT3", ["abc", "def"], rename=False) # E?: illegal field name + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_functional.py:63:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function collections.namedtuple was called with the wrong arguments [wrong-arg-types] + +NT5 = namedtuple("NT5", "a b c", defaults=(1, 2)) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 66: Expected 1 errors -Line 63: Unexpected errors ['File "namedtuples_define_functional.py", line 63, in : Function collections.namedtuple was called with the wrong arguments [wrong-arg-types]'] +Line 63: Unexpected errors ['namedtuples_define_functional.py:63:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function collections.namedtuple was called with the wrong arguments [wrong-arg-types]'] """ diff --git a/conformance/results/pytype/namedtuples_type_compat.toml b/conformance/results/pytype/namedtuples_type_compat.toml index 240a90347..a649efd7f 100644 --- a/conformance/results/pytype/namedtuples_type_compat.toml +++ b/conformance/results/pytype/namedtuples_type_compat.toml @@ -1,7 +1,15 @@ conformant = "Pass" output = """ -File "namedtuples_type_compat.py", line 22, in : Type annotation for v3 does not match type of assignment [annotation-type-mismatch] -File "namedtuples_type_compat.py", line 23, in : Type annotation for v4 does not match type of assignment [annotation-type-mismatch] +namedtuples_type_compat.py:22:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for v3 does not match type of assignment [annotation-type-mismatch] + +v3: tuple[int, int] = p # E: too few elements +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +namedtuples_type_compat.py:23:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for v4 does not match type of assignment [annotation-type-mismatch] + +v4: tuple[int, str, str] = p # E: incompatible element type +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pytype/namedtuples_usage.toml b/conformance/results/pytype/namedtuples_usage.toml index d1a376f6b..91aabf28c 100644 --- a/conformance/results/pytype/namedtuples_usage.toml +++ b/conformance/results/pytype/namedtuples_usage.toml @@ -6,12 +6,36 @@ Does not reject attempt to overwrite named tuple entry by name. Does not reject attempt to delete named tuple entry by name. """ output = """ -File "namedtuples_usage.py", line 31, in : Union[int, str] [assert-type] -File "namedtuples_usage.py", line 32, in : Union[int, str] [assert-type] -File "namedtuples_usage.py", line 41, in : unsupported operand type(s) for item assignment: Point [unsupported-operands] -File "namedtuples_usage.py", line 43, in : unsupported operand type(s) for item deletion: Point [unsupported-operands] -File "namedtuples_usage.py", line 52, in : Cannot unpack 3 values into 2 variables [bad-unpacking] -File "namedtuples_usage.py", line 53, in : Cannot unpack 3 values into 4 variables [bad-unpacking] +namedtuples_usage.py:31:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Union[int, str] [assert-type] + +assert_type(p[-2], int) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_usage.py:32:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Union[int, str] [assert-type] + +assert_type(p[-3], int) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_usage.py:41:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : unsupported operand type(s) for item assignment: Point [unsupported-operands] + +p[0] = 3 # E +\u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +namedtuples_usage.py:43:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : unsupported operand type(s) for item deletion: Point [unsupported-operands] + +del p[0] # E + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +namedtuples_usage.py:52:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Cannot unpack 3 values into 2 variables [bad-unpacking] + +x2, y2 = p # E: too few values to unpack +\u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +namedtuples_usage.py:53:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Cannot unpack 3 values into 4 variables [bad-unpacking] + +x3, y3, unit3, other = p # E: too many values to unpack +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -19,6 +43,6 @@ Line 34: Expected 1 errors Line 35: Expected 1 errors Line 40: Expected 1 errors Line 42: Expected 1 errors -Line 31: Unexpected errors ['File "namedtuples_usage.py", line 31, in : Union[int, str] [assert-type]'] -Line 32: Unexpected errors ['File "namedtuples_usage.py", line 32, in : Union[int, str] [assert-type]'] +Line 31: Unexpected errors ['namedtuples_usage.py:31:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Union[int, str] [assert-type]'] +Line 32: Unexpected errors ['namedtuples_usage.py:32:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Union[int, str] [assert-type]'] """ diff --git a/conformance/results/pytype/narrowing_typeguard.toml b/conformance/results/pytype/narrowing_typeguard.toml index a95dd8d5e..da2f78df4 100644 --- a/conformance/results/pytype/narrowing_typeguard.toml +++ b/conformance/results/pytype/narrowing_typeguard.toml @@ -3,8 +3,16 @@ notes = """ Does not reject TypeGuard method with too few parameters. """ output = """ -File "narrowing_typeguard.py", line 128, in : Function takes_callable_str was called with the wrong arguments [wrong-arg-types] -File "narrowing_typeguard.py", line 148, in : Function takes_callable_str_proto was called with the wrong arguments [wrong-arg-types] +narrowing_typeguard.py:128:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function takes_callable_str was called with the wrong arguments [wrong-arg-types] + +takes_callable_str(simple_typeguard) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +narrowing_typeguard.py:148:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function takes_callable_str_proto was called with the wrong arguments [wrong-arg-types] + +takes_callable_str_proto(simple_typeguard) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pytype/narrowing_typeis.toml b/conformance/results/pytype/narrowing_typeis.toml index 3af03cc86..e5f70078b 100644 --- a/conformance/results/pytype/narrowing_typeis.toml +++ b/conformance/results/pytype/narrowing_typeis.toml @@ -5,12 +5,38 @@ Does not reject covariant use of TypeIs. Does not reject TypeIs where return type is not consistent with input type due to variance. """ output = """ -File "narrowing_typeis.py", line 19, in func1: Tuple[str, ...] [assert-type] -File "narrowing_typeis.py", line 132, in : Function takes_callable_str was called with the wrong arguments [wrong-arg-types] -File "narrowing_typeis.py", line 152, in : Function takes_callable_str_proto was called with the wrong arguments [wrong-arg-types] -File "narrowing_typeis.py", line 169, in : Function takes_typeguard was called with the wrong arguments [wrong-arg-types] -File "narrowing_typeis.py", line 170, in : Function takes_typeis was called with the wrong arguments [wrong-arg-types] -File "narrowing_typeis.py", line 195, in : TypeIs[str] is not consistent with input type int [invalid-function-definition] +narrowing_typeis.py:19:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Tuple[str, ...] [assert-type] + + assert_type(names, tuple[str, str]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +narrowing_typeis.py:132:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function takes_callable_str was called with the wrong arguments [wrong-arg-types] + +takes_callable_str(simple_typeguard) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +narrowing_typeis.py:152:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function takes_callable_str_proto was called with the wrong arguments [wrong-arg-types] + +takes_callable_str_proto(simple_typeguard) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +narrowing_typeis.py:169:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function takes_typeguard was called with the wrong arguments [wrong-arg-types] + +takes_typeguard(is_int_typeis) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +narrowing_typeis.py:170:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function takes_typeis was called with the wrong arguments [wrong-arg-types] + +takes_typeis(is_int_typeguard) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +narrowing_typeis.py:195:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : TypeIs[str] is not consistent with input type int [invalid-function-definition] + +def bad_typeis(x: int) -> TypeIs[str]: # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + return isinstance(x, str) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -18,5 +44,5 @@ Line 105: Expected 1 errors Line 110: Expected 1 errors Line 191: Expected 1 errors Line 199: Expected 1 errors -Line 19: Unexpected errors ['File "narrowing_typeis.py", line 19, in func1: Tuple[str, ...] [assert-type]'] +Line 19: Unexpected errors ['narrowing_typeis.py:19:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Tuple[str, ...] [assert-type]'] """ diff --git a/conformance/results/pytype/overloads_basic.toml b/conformance/results/pytype/overloads_basic.toml index 8d90cba20..06e69b8cb 100644 --- a/conformance/results/pytype/overloads_basic.toml +++ b/conformance/results/pytype/overloads_basic.toml @@ -4,14 +4,26 @@ Does not reject a function with a single @overload signature. Does not reject a function with @overload signature but no implementation. """ output = """ -File "overloads_basic.py", line 31, in __getitem__: bad return type [bad-return-type] -File "overloads_basic.py", line 37, in : unsupported operand type(s) for item retrieval: Bytes and str [unsupported-operands] -File "overloads_basic.py", line 58, in map: bad return type [bad-return-type] +overloads_basic.py:31:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __getitem__: bad return type [bad-return-type] + + return b"" + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +overloads_basic.py:37:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : unsupported operand type(s) for item retrieval: Bytes and str [unsupported-operands] + +b[""] # E: no matching overload +\u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +overloads_basic.py:58:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in map: bad return type [bad-return-type] + + pass + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Lines 62, 63: Expected error (tag 'func1') Lines 74, 75: Expected error (tag 'func2') -Line 31: Unexpected errors ['File "overloads_basic.py", line 31, in __getitem__: bad return type [bad-return-type]'] -Line 58: Unexpected errors ['File "overloads_basic.py", line 58, in map: bad return type [bad-return-type]'] +Line 31: Unexpected errors ['overloads_basic.py:31:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __getitem__: bad return type [bad-return-type]'] +Line 58: Unexpected errors ['overloads_basic.py:58:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in map: bad return type [bad-return-type]'] """ diff --git a/conformance/results/pytype/protocols_class_objects.toml b/conformance/results/pytype/protocols_class_objects.toml index 47965b7e5..f294b7008 100644 --- a/conformance/results/pytype/protocols_class_objects.toml +++ b/conformance/results/pytype/protocols_class_objects.toml @@ -5,8 +5,18 @@ Incorrectly reports some class objects as incompatible with a protocol. Fails to report some class objects as incompatible with a protocol. """ output = """ -File "protocols_class_objects.py", line 50, in method1: bad return type [bad-return-type] -File "protocols_class_objects.py", line 100, in : Function CMeta.__init__ was called with the wrong arguments [wrong-arg-types] +protocols_class_objects.py:50:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method1: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +protocols_class_objects.py:100:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function CMeta.__init__ was called with the wrong arguments [wrong-arg-types] + +class ConcreteC3(metaclass=CMeta): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -18,6 +28,6 @@ Line 104: Expected 1 errors Line 106: Expected 1 errors Line 107: Expected 1 errors Line 108: Expected 1 errors -Line 50: Unexpected errors ['File "protocols_class_objects.py", line 50, in method1: bad return type [bad-return-type]'] -Line 100: Unexpected errors ['File "protocols_class_objects.py", line 100, in : Function CMeta.__init__ was called with the wrong arguments [wrong-arg-types]'] +Line 50: Unexpected errors ['protocols_class_objects.py:50:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method1: bad return type [bad-return-type]'] +Line 100: Unexpected errors ['protocols_class_objects.py:100:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function CMeta.__init__ was called with the wrong arguments [wrong-arg-types]'] """ diff --git a/conformance/results/pytype/protocols_definition.toml b/conformance/results/pytype/protocols_definition.toml index a50220bbd..0c6fb35eb 100644 --- a/conformance/results/pytype/protocols_definition.toml +++ b/conformance/results/pytype/protocols_definition.toml @@ -16,14 +16,46 @@ Does not reject immutable named tuple attribute in concrete class when protocol Does not reject immutable frozen dataclass attribute in concrete class when protocol attribute is mutable. """ output = """ -File "protocols_definition.py", line 30, in : Function close_all was called with the wrong arguments [wrong-arg-types] -File "protocols_definition.py", line 45, in third: bad return type [bad-return-type] -File "protocols_definition.py", line 114, in : Type annotation for v2_bad1 does not match type of assignment [annotation-type-mismatch] -File "protocols_definition.py", line 115, in : Type annotation for v2_bad2 does not match type of assignment [annotation-type-mismatch] -File "protocols_definition.py", line 156, in : Type annotation for v3_bad1 does not match type of assignment [annotation-type-mismatch] -File "protocols_definition.py", line 159, in : Type annotation for v3_bad4 does not match type of assignment [annotation-type-mismatch] -File "protocols_definition.py", line 218, in : Type annotation for v4_bad1 does not match type of assignment [annotation-type-mismatch] -File "protocols_definition.py", line 219, in : Type annotation for v4_bad2 does not match type of assignment [annotation-type-mismatch] +protocols_definition.py:30:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function close_all was called with the wrong arguments [wrong-arg-types] + +close_all([1]) # E: 'int' has no 'close' method +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_definition.py:45:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in third: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +protocols_definition.py:114:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for v2_bad1 does not match type of assignment [annotation-type-mismatch] + +v2_bad1: Template2 = Concrete2_Bad1() # E +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +protocols_definition.py:115:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for v2_bad2 does not match type of assignment [annotation-type-mismatch] + +v2_bad2: Template2 = Concrete2_Bad2() # E +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +protocols_definition.py:156:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for v3_bad1 does not match type of assignment [annotation-type-mismatch] + +v3_bad1: Template3 = Concrete3_Bad1() # E +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +protocols_definition.py:159:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for v3_bad4 does not match type of assignment [annotation-type-mismatch] + +v3_bad4: Template3 = Concrete3_Bad4() # E +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +protocols_definition.py:218:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for v4_bad1 does not match type of assignment [annotation-type-mismatch] + +v4_bad1: Template4 = Concrete4_Bad1() # E +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +protocols_definition.py:219:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for v4_bad2 does not match type of assignment [annotation-type-mismatch] + +v4_bad2: Template4 = Concrete4_Bad2() # E +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -41,5 +73,5 @@ Line 289: Expected 1 errors Line 339: Expected 1 errors Line 340: Expected 1 errors Line 341: Expected 1 errors -Line 45: Unexpected errors ['File "protocols_definition.py", line 45, in third: bad return type [bad-return-type]'] +Line 45: Unexpected errors ['protocols_definition.py:45:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in third: bad return type [bad-return-type]'] """ diff --git a/conformance/results/pytype/protocols_explicit.toml b/conformance/results/pytype/protocols_explicit.toml index 8432b87e8..5dbd6b44e 100644 --- a/conformance/results/pytype/protocols_explicit.toml +++ b/conformance/results/pytype/protocols_explicit.toml @@ -7,11 +7,23 @@ Does not reject instantiation of class that derives from protocol but doesn't im Does not report instantiation of class that derives from protocol but doesn't implement method. """ output = """ -File "protocols_explicit.py", line 14, in draw: bad return type [bad-return-type] +protocols_explicit.py:14:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in draw: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 27, in draw -File "protocols_explicit.py", line 60, in : Can't instantiate Point with abstract methods intensity [not-instantiable] -File "protocols_explicit.py", line 165, in : Can't instantiate Concrete7A with abstract methods method1 [not-instantiable] +protocols_explicit.py:60:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Can't instantiate Point with abstract methods intensity [not-instantiable] + +p = Point(0, 0, "") # E: Cannot instantiate abstract class + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_explicit.py:165:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Can't instantiate Concrete7A with abstract methods method1 [not-instantiable] + +c7a = Concrete7A() # E: cannot instantiate abstract class + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -20,5 +32,5 @@ Line 56: Expected 1 errors Line 90: Expected 1 errors Line 110: Expected 1 errors Line 135: Expected 1 errors -Line 14: Unexpected errors ['File "protocols_explicit.py", line 14, in draw: bad return type [bad-return-type]'] +Line 14: Unexpected errors ['protocols_explicit.py:14:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in draw: bad return type [bad-return-type]'] """ diff --git a/conformance/results/pytype/protocols_generic.toml b/conformance/results/pytype/protocols_generic.toml index c2d3728ac..2ab4a9378 100644 --- a/conformance/results/pytype/protocols_generic.toml +++ b/conformance/results/pytype/protocols_generic.toml @@ -5,21 +5,55 @@ Does not correctly enforce invariance in protocol type compatibility tests. Does not detect protocol mismatch when method-scoped TypeVar is used in protocol. """ output = """ -File "protocols_generic.py", line 12, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] -File "protocols_generic.py", line 13, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] -File "protocols_generic.py", line 40, in : Type annotation for p2 does not match type of assignment [annotation-type-mismatch] -File "protocols_generic.py", line 44, in : Invalid type annotation 'Proto2' [invalid-annotation] -File "protocols_generic.py", line 56, in func1: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] -File "protocols_generic.py", line 65, in func2: Type annotation for v1 does not match type of assignment [annotation-type-mismatch] -File "protocols_generic.py", line 75, in func3: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] -File "protocols_generic.py", line 146, in : Type annotation for hp3 does not match type of assignment [annotation-type-mismatch] +protocols_generic.py:12:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +T_co = TypeVar("T_co", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_generic.py:13:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] + +T_contra = TypeVar("T_contra", contravariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_generic.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for p2 does not match type of assignment [annotation-type-mismatch] + +p2: Proto1[int, str] = Concrete1() # E: incompatible type +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +protocols_generic.py:44:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Proto2' [invalid-annotation] + +class Proto2(Protocol[T_co], Generic[T_co]): # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +protocols_generic.py:56:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] + + v2: Box[int] = box_float # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +protocols_generic.py:65:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Type annotation for v1 does not match type of assignment [annotation-type-mismatch] + + v1: Sender[int] = sender_float # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +protocols_generic.py:75:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] + + v2: AttrProto[int] = attr_float # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +protocols_generic.py:146:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for hp3 does not match type of assignment [annotation-type-mismatch] + +hp3: HasPropertyProto = ConcreteHasProperty3() # E +\u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 66: Expected 1 errors Line 74: Expected 1 errors Line 147: Expected 1 errors -Line 12: Unexpected errors ['File "protocols_generic.py", line 12, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 13: Unexpected errors ['File "protocols_generic.py", line 13, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] -Line 65: Unexpected errors ['File "protocols_generic.py", line 65, in func2: Type annotation for v1 does not match type of assignment [annotation-type-mismatch]'] +Line 12: Unexpected errors ['protocols_generic.py:12:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 13: Unexpected errors ['protocols_generic.py:13:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] +Line 65: Unexpected errors ['protocols_generic.py:65:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: Type annotation for v1 does not match type of assignment [annotation-type-mismatch]'] """ diff --git a/conformance/results/pytype/protocols_merging.toml b/conformance/results/pytype/protocols_merging.toml index bf9e4eab4..a3102a965 100644 --- a/conformance/results/pytype/protocols_merging.toml +++ b/conformance/results/pytype/protocols_merging.toml @@ -4,11 +4,31 @@ Does not reject a protocol class that derives from a non-protocol class. Does not report attempt to instantiate abstract class downgraded from protocol class. """ output = """ -File "protocols_merging.py", line 52, in : Type annotation for s6 does not match type of assignment [annotation-type-mismatch] -File "protocols_merging.py", line 53, in : Type annotation for s7 does not match type of assignment [annotation-type-mismatch] -File "protocols_merging.py", line 54, in : Type annotation for s8 does not match type of assignment [annotation-type-mismatch] -File "protocols_merging.py", line 82, in : Can't instantiate SizedAndClosable4 with abstract methods close [not-instantiable] -File "protocols_merging.py", line 83, in : Type annotation for y does not match type of assignment [annotation-type-mismatch] +protocols_merging.py:52:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for s6 does not match type of assignment [annotation-type-mismatch] + +s6: SizedAndClosable1 = SCConcrete2() # E: doesn't implement close +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +protocols_merging.py:53:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for s7 does not match type of assignment [annotation-type-mismatch] + +s7: SizedAndClosable2 = SCConcrete2() # E: doesn't implement close +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +protocols_merging.py:54:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for s8 does not match type of assignment [annotation-type-mismatch] + +s8: SizedAndClosable3 = SCConcrete2() # E: SizedAndClosable3 is not a protocol +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +protocols_merging.py:82:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Can't instantiate SizedAndClosable4 with abstract methods close [not-instantiable] + +x = SizedAndClosable4() # E: cannot instantiate abstract class + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_merging.py:83:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for y does not match type of assignment [annotation-type-mismatch] + +y: SizedAndClosable4 = SCConcrete1() # E +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pytype/protocols_modules.toml b/conformance/results/pytype/protocols_modules.toml index 1c5af9060..77c9ae318 100644 --- a/conformance/results/pytype/protocols_modules.toml +++ b/conformance/results/pytype/protocols_modules.toml @@ -3,14 +3,22 @@ notes = """ Does not report incompatibilities for protocol methods. """ output = """ -File "protocols_modules.py", line 10, in : Can't find module '_protocols_modules1'. [import-error] -File "protocols_modules.py", line 11, in : Can't find module '_protocols_modules2'. [import-error] +protocols_modules.py:10:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Can't find module '_protocols_modules1'. [import-error] + +import _protocols_modules1 +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_modules.py:11:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Can't find module '_protocols_modules2'. [import-error] + +import _protocols_modules2 +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 26: Expected 1 errors Line 48: Expected 1 errors Line 49: Expected 1 errors -Line 10: Unexpected errors ['File "protocols_modules.py", line 10, in : Can\\'t find module \\'_protocols_modules1\\'. [import-error]'] -Line 11: Unexpected errors ['File "protocols_modules.py", line 11, in : Can\\'t find module \\'_protocols_modules2\\'. [import-error]'] +Line 10: Unexpected errors ["protocols_modules.py:10:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Can't find module '_protocols_modules1'. [import-error]"] +Line 11: Unexpected errors ["protocols_modules.py:11:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Can't find module '_protocols_modules2'. [import-error]"] """ diff --git a/conformance/results/pytype/protocols_recursive.toml b/conformance/results/pytype/protocols_recursive.toml index 05142931d..419fa160b 100644 --- a/conformance/results/pytype/protocols_recursive.toml +++ b/conformance/results/pytype/protocols_recursive.toml @@ -3,13 +3,25 @@ notes = """ Incorrectly reports type error for some recursive protocols. """ output = """ -File "protocols_recursive.py", line 11, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] -File "protocols_recursive.py", line 12, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] -File "protocols_recursive.py", line 81, in : Any [assert-type] +protocols_recursive.py:11:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +T_co = TypeVar("T_co", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_recursive.py:12:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] + +T_contra = TypeVar("T_contra", contravariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_recursive.py:81:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(v1, list[int]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 11: Unexpected errors ['File "protocols_recursive.py", line 11, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 12: Unexpected errors ['File "protocols_recursive.py", line 12, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] -Line 81: Unexpected errors ['File "protocols_recursive.py", line 81, in : Any [assert-type]'] +Line 11: Unexpected errors ['protocols_recursive.py:11:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 12: Unexpected errors ['protocols_recursive.py:12:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] +Line 81: Unexpected errors ['protocols_recursive.py:81:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] """ diff --git a/conformance/results/pytype/protocols_self.toml b/conformance/results/pytype/protocols_self.toml index ec7dd2b3e..a6a63cb46 100644 --- a/conformance/results/pytype/protocols_self.toml +++ b/conformance/results/pytype/protocols_self.toml @@ -3,15 +3,31 @@ notes = """ Does not properly handle Self type within a protocol. """ output = """ -File "protocols_self.py", line 36, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] -File "protocols_self.py", line 37, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] -File "protocols_self.py", line 72, in : Type annotation for a2 does not match type of assignment [annotation-type-mismatch] -File "protocols_self.py", line 73, in : Type annotation for b2 does not match type of assignment [annotation-type-mismatch] +protocols_self.py:36:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +T1_co = TypeVar("T1_co", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_self.py:37:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +T2_co = TypeVar("T2_co", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_self.py:72:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for a2 does not match type of assignment [annotation-type-mismatch] + +a2: P2Parent[str] = C2[str]() # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +protocols_self.py:73:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for b2 does not match type of assignment [annotation-type-mismatch] + +b2: P2Child[str] = C2[str]() # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 36: Unexpected errors ['File "protocols_self.py", line 36, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 37: Unexpected errors ['File "protocols_self.py", line 37, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 72: Unexpected errors ['File "protocols_self.py", line 72, in : Type annotation for a2 does not match type of assignment [annotation-type-mismatch]'] -Line 73: Unexpected errors ['File "protocols_self.py", line 73, in : Type annotation for b2 does not match type of assignment [annotation-type-mismatch]'] +Line 36: Unexpected errors ['protocols_self.py:36:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 37: Unexpected errors ['protocols_self.py:37:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 72: Unexpected errors ['protocols_self.py:72:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for a2 does not match type of assignment [annotation-type-mismatch]'] +Line 73: Unexpected errors ['protocols_self.py:73:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for b2 does not match type of assignment [annotation-type-mismatch]'] """ diff --git a/conformance/results/pytype/protocols_subtyping.toml b/conformance/results/pytype/protocols_subtyping.toml index c364fc59a..2908ac1b0 100644 --- a/conformance/results/pytype/protocols_subtyping.toml +++ b/conformance/results/pytype/protocols_subtyping.toml @@ -4,10 +4,26 @@ Does not reject attempt to instantiate protocol class. Does not report some protocol type compatibility violations involving contravariance. """ output = """ -File "protocols_subtyping.py", line 38, in func1: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] -File "protocols_subtyping.py", line 55, in func2: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] -File "protocols_subtyping.py", line 83, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] -File "protocols_subtyping.py", line 84, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] +protocols_subtyping.py:38:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] + + v2: Concrete2 = p2 # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +protocols_subtyping.py:55:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] + + v2: Proto3 = p2 # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +protocols_subtyping.py:83:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +S_co = TypeVar("S_co", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_subtyping.py:84:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] + +T_contra = TypeVar("T_contra", contravariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -16,6 +32,6 @@ Line 79: Expected 1 errors Line 80: Expected 1 errors Line 102: Expected 1 errors Line 103: Expected 1 errors -Line 83: Unexpected errors ['File "protocols_subtyping.py", line 83, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 84: Unexpected errors ['File "protocols_subtyping.py", line 84, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] +Line 83: Unexpected errors ['protocols_subtyping.py:83:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 84: Unexpected errors ['protocols_subtyping.py:84:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] """ diff --git a/conformance/results/pytype/protocols_variance.toml b/conformance/results/pytype/protocols_variance.toml index 9eb9e2845..a3089e61a 100644 --- a/conformance/results/pytype/protocols_variance.toml +++ b/conformance/results/pytype/protocols_variance.toml @@ -3,9 +3,21 @@ notes = """ Does not detect incorrect TypeVar variance within generic protocols. """ output = """ -File "protocols_variance.py", line 12, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] -File "protocols_variance.py", line 13, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] -File "protocols_variance.py", line 15, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] +protocols_variance.py:12:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +T1_co = TypeVar("T1_co", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_variance.py:13:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] + +T1_contra = TypeVar("T1_contra", contravariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_variance.py:15:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +R = TypeVar("R", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -16,7 +28,7 @@ Line 61: Expected 1 errors Line 66: Expected 1 errors Line 71: Expected 1 errors Line 104: Expected 1 errors -Line 12: Unexpected errors ['File "protocols_variance.py", line 12, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 13: Unexpected errors ['File "protocols_variance.py", line 13, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] -Line 15: Unexpected errors ['File "protocols_variance.py", line 15, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 12: Unexpected errors ['protocols_variance.py:12:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 13: Unexpected errors ['protocols_variance.py:13:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] +Line 15: Unexpected errors ['protocols_variance.py:15:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] """ diff --git a/conformance/results/pytype/qualifiers_annotated.toml b/conformance/results/pytype/qualifiers_annotated.toml index 9a0642022..4b5d16f83 100644 --- a/conformance/results/pytype/qualifiers_annotated.toml +++ b/conformance/results/pytype/qualifiers_annotated.toml @@ -6,17 +6,61 @@ Does not reject call of Annotated. Does not allow TypeVar to be used in type alias when wrapped with Annotated. """ output = """ -File "qualifiers_annotated.py", line 43, in : Invalid type annotation '[int, str]' for Bad1 [invalid-annotation] -File "qualifiers_annotated.py", line 44, in : Invalid type annotation '((int, str),)' for Bad2 [invalid-annotation] -File "qualifiers_annotated.py", line 45, in : Invalid type annotation '' for Bad3 [invalid-annotation] -File "qualifiers_annotated.py", line 46, in : Invalid type annotation "{'a': 'b'}" for Bad4 [invalid-annotation] -File "qualifiers_annotated.py", line 50, in : Name 'var1' is not defined [name-error] -File "qualifiers_annotated.py", line 51, in : Invalid type annotation 'True' for Bad9 [invalid-annotation] -File "qualifiers_annotated.py", line 52, in : Invalid type annotation '1' for Bad10 [invalid-annotation] -File "qualifiers_annotated.py", line 54, in : Invalid type annotation '' for Bad12 [invalid-annotation] -File "qualifiers_annotated.py", line 64, in : Invalid type annotation 'Annotated' [invalid-annotation] -File "qualifiers_annotated.py", line 91, in : 'Annotated' object is not callable [not-callable] -File "qualifiers_annotated.py", line 121, in : Invalid TypeVar: TypeVar('T') must be stored as 'T', not 'TA3' [invalid-typevar] +qualifiers_annotated.py:43:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[int, str]' for Bad1 [invalid-annotation] + +Bad1: Annotated[[int, str], ""] # E: invalid type expression +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_annotated.py:44:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '((int, str),)' for Bad2 [invalid-annotation] + +Bad2: Annotated[((int, str),), ""] # E: invalid type expression +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_annotated.py:45:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for Bad3 [invalid-annotation] + +Bad3: Annotated[[int for i in range(1)], ""] # E: invalid type expression +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_annotated.py:46:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation "{'a': 'b'}" for Bad4 [invalid-annotation] + +Bad4: Annotated[{"a": "b"}, ""] # E: invalid type expression +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_annotated.py:50:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Name 'var1' is not defined [name-error] + +Bad8: Annotated[var1, ""] # E: invalid type expression + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +qualifiers_annotated.py:51:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'True' for Bad9 [invalid-annotation] + +Bad9: Annotated[True, ""] # E: invalid type expression +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_annotated.py:52:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '1' for Bad10 [invalid-annotation] + +Bad10: Annotated[1, ""] # E: invalid type expression +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_annotated.py:54:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for Bad12 [invalid-annotation] + +Bad12: Annotated[f"{'int'}", ""] # E: invalid type expression +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_annotated.py:64:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Annotated' [invalid-annotation] + +Bad13: Annotated[int] # E: requires at least two arguments + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_annotated.py:91:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : 'Annotated' object is not callable [not-callable] + +Annotated() # E +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_annotated.py:121:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid TypeVar: TypeVar('T') must be stored as 'T', not 'TA3' [invalid-typevar] + +TA3 = Annotated[T, ""] +\u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -30,5 +74,5 @@ Line 84: Expected 1 errors Line 85: Expected 1 errors Line 92: Expected 1 errors Line 93: Expected 1 errors -Line 121: Unexpected errors ['File "qualifiers_annotated.py", line 121, in : Invalid TypeVar: TypeVar(\\'T\\') must be stored as \\'T\\', not \\'TA3\\' [invalid-typevar]'] +Line 121: Unexpected errors ["qualifiers_annotated.py:121:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid TypeVar: TypeVar('T') must be stored as 'T', not 'TA3' [invalid-typevar]"] """ diff --git a/conformance/results/pytype/qualifiers_final_annotation.toml b/conformance/results/pytype/qualifiers_final_annotation.toml index 9d3a3d450..59ff384d8 100644 --- a/conformance/results/pytype/qualifiers_final_annotation.toml +++ b/conformance/results/pytype/qualifiers_final_annotation.toml @@ -6,24 +6,109 @@ Does not reject modification of global variable declared Final. Does not reject modification of local variable declared Final. """ output = """ -File "qualifiers_final_annotation.py", line 18, in : Invalid type annotation 'Final[str, int]' [invalid-annotation] -File "qualifiers_final_annotation.py", line 18, in : Invalid type annotation 'Final' [invalid-annotation] -File "qualifiers_final_annotation.py", line 54, in __init__: Assigning to attribute ID5, which was annotated with Final [final-error] -File "qualifiers_final_annotation.py", line 65, in method1: Assigning to attribute ID7, which was annotated with Final [final-error] -File "qualifiers_final_annotation.py", line 67, in method1: Assigning to attribute ID7, which was annotated with Final [final-error] -File "qualifiers_final_annotation.py", line 71, in : Assigning to variable RATE, which was annotated with Final [final-error] -File "qualifiers_final_annotation.py", line 81, in : Assigning to attribute DEFAULT_ID, which was annotated with Final [final-error] -File "qualifiers_final_annotation.py", line 93, in : Class ClassCChild overrides final class attribute BORDER_WIDTH, defined in base class ClassC [final-error] -File "qualifiers_final_annotation.py", line 107, in ClassD: Type annotation for VALUE2 does not match type of assignment [annotation-type-mismatch] -File "qualifiers_final_annotation.py", line 107, in ClassD: Invalid use of typing.Final [final-error] -File "qualifiers_final_annotation.py", line 107, in ClassD: Invalid type annotation 'ClassVar[Final]' [invalid-annotation] -File "qualifiers_final_annotation.py", line 108, in ClassD: Type annotation for VALUE3 does not match type of assignment [annotation-type-mismatch] -File "qualifiers_final_annotation.py", line 118, in : Invalid use of typing.Final [final-error] -File "qualifiers_final_annotation.py", line 118, in : Invalid type annotation 'list[Final[int]]' [invalid-annotation] -File "qualifiers_final_annotation.py", line 121, in : Invalid use of typing.Final [final-error] -File "qualifiers_final_annotation.py", line 134, in : Invalid keyword argument a to function N.__new__ [wrong-keyword-args] -File "qualifiers_final_annotation.py", line 135, in : Function N.__new__ was called with the wrong arguments [wrong-arg-types] -File "qualifiers_final_annotation.py", line 145, in func2: Assigning to variable x, which was annotated with Final [final-error] +qualifiers_final_annotation.py:18:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Final[str, int]' [invalid-annotation] + +BAD2: Final[str, int] = "" # E: only one type argument allowed +\u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:18:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Final' [invalid-annotation] + +BAD2: Final[str, int] = "" # E: only one type argument allowed + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:54:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __init__: Assigning to attribute ID5, which was annotated with Final [final-error] + + self.ID5 = 0 # E: Already initialized + \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:65:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method1: Assigning to attribute ID7, which was annotated with Final [final-error] + + self.ID7 = 0 # E: cannot modify Final value + \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:67:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method1: Assigning to attribute ID7, which was annotated with Final [final-error] + + self.ID7 += 1 # E: cannot modify Final value + \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:71:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Assigning to variable RATE, which was annotated with Final [final-error] + +RATE = 300 # E: Cannot redefine Final value +\u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:81:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Assigning to attribute DEFAULT_ID, which was annotated with Final [final-error] + +ClassB.DEFAULT_ID = 0 # E: Cannot redefined value +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:93:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class ClassCChild overrides final class attribute BORDER_WIDTH, defined in base class ClassC [final-error] + +class ClassCChild(ClassC): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + BORDER_WIDTH = 2.5 # E: Cannot override Final value +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + __private = 0 # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:107:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassD: Type annotation for VALUE2 does not match type of assignment [annotation-type-mismatch] + + VALUE2: ClassVar[Final] = 1 # E: Final cannot be used with ClassVar + \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:107:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassD: Invalid use of typing.Final [final-error] + + VALUE2: ClassVar[Final] = 1 # E: Final cannot be used with ClassVar + \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:107:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassD: Invalid use of typing.Final [final-error] + + VALUE2: ClassVar[Final] = 1 # E: Final cannot be used with ClassVar + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:107:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassD: Invalid type annotation 'ClassVar[Final]' [invalid-annotation] + + VALUE2: ClassVar[Final] = 1 # E: Final cannot be used with ClassVar + \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:108:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassD: Type annotation for VALUE3 does not match type of assignment [annotation-type-mismatch] + + VALUE3: Final[ClassVar] = 1 # E: Final cannot be used with ClassVar + \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:118:4: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid use of typing.Final [final-error] + +x: list[Final[int]] = [] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:118:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[Final[int]]' [invalid-annotation] + +x: list[Final[int]] = [] # E +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:121:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid use of typing.Final [final-error] + +def func1(x: Final[list[int]]) -> None: # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:134:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument a to function N.__new__ [wrong-keyword-args] + +N(a=1) # E +\u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:135:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function N.__new__ was called with the wrong arguments [wrong-arg-types] + +N(x="", y="") # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:145:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Assigning to variable x, which was annotated with Final [final-error] + + x += 1 # E: cannot modify Final value + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -38,5 +123,5 @@ Line 147: Expected 1 errors Line 149: Expected 1 errors Line 152: Expected 1 errors Line 155: Expected 1 errors -Line 93: Unexpected errors ['File "qualifiers_final_annotation.py", line 93, in : Class ClassCChild overrides final class attribute BORDER_WIDTH, defined in base class ClassC [final-error]'] +Line 93: Unexpected errors ['qualifiers_final_annotation.py:93:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class ClassCChild overrides final class attribute BORDER_WIDTH, defined in base class ClassC [final-error]'] """ diff --git a/conformance/results/pytype/qualifiers_final_decorator.toml b/conformance/results/pytype/qualifiers_final_decorator.toml index ca2fa29cd..3910ac781 100644 --- a/conformance/results/pytype/qualifiers_final_decorator.toml +++ b/conformance/results/pytype/qualifiers_final_decorator.toml @@ -4,19 +4,247 @@ Does not report error for overloaded @final method defined in stub file. Does not report error for overload that is marked @final when implementation is not. """ output = """ -File "qualifiers_final_decorator.py", line 8, in : Couldn't import pyi for '_qualifiers_final_decorator' [pyi-error] -File "qualifiers_final_decorator.py", line 21, in : Cannot subclass final class: Base1 [final-error] -File "qualifiers_final_decorator.py", line 52, in method4: bad return type [bad-return-type] -File "qualifiers_final_decorator.py", line 55, in : Class Derived2 overrides final method method4, defined in base class Base2 [final-error] -File "qualifiers_final_decorator.py", line 55, in : Class Derived2 overrides final method method3, defined in base class Base2 [final-error] -File "qualifiers_final_decorator.py", line 55, in : Class Derived2 overrides final method method2, defined in base class Base2 [final-error] -File "qualifiers_final_decorator.py", line 55, in : Class Derived2 overrides final method method1, defined in base class Base2 [final-error] -File "qualifiers_final_decorator.py", line 76, in method4: bad return type [bad-return-type] -File "qualifiers_final_decorator.py", line 90, in method: bad return type [bad-return-type] -File "qualifiers_final_decorator.py", line 103, in method: bad return type [bad-return-type] -File "qualifiers_final_decorator.py", line 117, in : Class Derived5 overrides final method method, defined in base class Base5_2 [final-error] -File "qualifiers_final_decorator.py", line 118, in Derived5: Overriding method signature mismatch [signature-mismatch] -File "qualifiers_final_decorator.py", line 125, in : Cannot apply @final decorator to func1 [final-error] +qualifiers_final_decorator.py:8:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Couldn't import pyi for '_qualifiers_final_decorator' [pyi-error] + +from _qualifiers_final_decorator import Base3, Base4 +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_decorator.py:21:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Cannot subclass final class: Base1 [final-error] + +class Derived1(Base1): # E: Cannot inherit from final class "Base" +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_decorator.py:52:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method4: bad return type [bad-return-type] + + return 0 + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +qualifiers_final_decorator.py:55:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class Derived2 overrides final method method4, defined in base class Base2 [final-error] + +class Derived2(Base2): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method1(self) -> None: # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @classmethod # E[method2] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method2(cls) -> None: # E[method2] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @staticmethod # E[method3] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method3() -> None: # E[method3] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @overload # E[method4] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method4(self, x: int) -> int: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @overload +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method4(self, x: str) -> str: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + def method4(self, x: int | str) -> int | str: # E[method4] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + return 0 +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_decorator.py:55:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class Derived2 overrides final method method3, defined in base class Base2 [final-error] + +class Derived2(Base2): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method1(self) -> None: # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @classmethod # E[method2] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method2(cls) -> None: # E[method2] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @staticmethod # E[method3] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method3() -> None: # E[method3] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @overload # E[method4] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method4(self, x: int) -> int: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @overload +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method4(self, x: str) -> str: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + def method4(self, x: int | str) -> int | str: # E[method4] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + return 0 +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_decorator.py:55:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class Derived2 overrides final method method2, defined in base class Base2 [final-error] + +class Derived2(Base2): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method1(self) -> None: # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @classmethod # E[method2] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method2(cls) -> None: # E[method2] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @staticmethod # E[method3] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method3() -> None: # E[method3] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @overload # E[method4] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method4(self, x: int) -> int: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @overload +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method4(self, x: str) -> str: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + def method4(self, x: int | str) -> int | str: # E[method4] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + return 0 +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_decorator.py:55:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class Derived2 overrides final method method1, defined in base class Base2 [final-error] + +class Derived2(Base2): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method1(self) -> None: # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @classmethod # E[method2] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method2(cls) -> None: # E[method2] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @staticmethod # E[method3] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method3() -> None: # E[method3] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @overload # E[method4] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method4(self, x: int) -> int: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @overload +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method4(self, x: str) -> str: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + def method4(self, x: int | str) -> int | str: # E[method4] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + return 0 +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_decorator.py:76:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method4: bad return type [bad-return-type] + + return 0 + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +qualifiers_final_decorator.py:90:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method: bad return type [bad-return-type] + + return 0 + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +qualifiers_final_decorator.py:103:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method: bad return type [bad-return-type] + + return 0 + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +qualifiers_final_decorator.py:117:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class Derived5 overrides final method method, defined in base class Base5_2 [final-error] + +class Derived5(Base5_1, Base5_2): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method(self) -> None: # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_decorator.py:118:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Derived5: Overriding method signature mismatch [signature-mismatch] + + def method(self) -> None: # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_decorator.py:125:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Cannot apply @final decorator to func1 [final-error] + +@final # E[func]: not allowed on non-method function. + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -27,11 +255,11 @@ Lines 67, 75: Expected error (tag 'method4') Lines 80, 89: Expected error (tag 'Derived3') Lines 84, 85, 86: Expected error (tag 'Derived3-2') Lines 94, 102: Expected error (tag 'Derived4') -Line 8: Unexpected errors ['File "qualifiers_final_decorator.py", line 8, in : Couldn\\'t import pyi for \\'_qualifiers_final_decorator\\' [pyi-error]'] -Line 52: Unexpected errors ['File "qualifiers_final_decorator.py", line 52, in method4: bad return type [bad-return-type]'] -Line 55: Unexpected errors ['File "qualifiers_final_decorator.py", line 55, in : Class Derived2 overrides final method method4, defined in base class Base2 [final-error]', 'File "qualifiers_final_decorator.py", line 55, in : Class Derived2 overrides final method method3, defined in base class Base2 [final-error]', 'File "qualifiers_final_decorator.py", line 55, in : Class Derived2 overrides final method method2, defined in base class Base2 [final-error]', 'File "qualifiers_final_decorator.py", line 55, in : Class Derived2 overrides final method method1, defined in base class Base2 [final-error]'] -Line 76: Unexpected errors ['File "qualifiers_final_decorator.py", line 76, in method4: bad return type [bad-return-type]'] -Line 90: Unexpected errors ['File "qualifiers_final_decorator.py", line 90, in method: bad return type [bad-return-type]'] -Line 103: Unexpected errors ['File "qualifiers_final_decorator.py", line 103, in method: bad return type [bad-return-type]'] -Line 117: Unexpected errors ['File "qualifiers_final_decorator.py", line 117, in : Class Derived5 overrides final method method, defined in base class Base5_2 [final-error]'] +Line 8: Unexpected errors ["qualifiers_final_decorator.py:8:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Couldn't import pyi for '_qualifiers_final_decorator' [pyi-error]"] +Line 52: Unexpected errors ['qualifiers_final_decorator.py:52:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method4: bad return type [bad-return-type]'] +Line 55: Unexpected errors ['qualifiers_final_decorator.py:55:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class Derived2 overrides final method method4, defined in base class Base2 [final-error]', 'qualifiers_final_decorator.py:55:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class Derived2 overrides final method method3, defined in base class Base2 [final-error]', 'qualifiers_final_decorator.py:55:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class Derived2 overrides final method method2, defined in base class Base2 [final-error]', 'qualifiers_final_decorator.py:55:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class Derived2 overrides final method method1, defined in base class Base2 [final-error]'] +Line 76: Unexpected errors ['qualifiers_final_decorator.py:76:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method4: bad return type [bad-return-type]'] +Line 90: Unexpected errors ['qualifiers_final_decorator.py:90:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method: bad return type [bad-return-type]'] +Line 103: Unexpected errors ['qualifiers_final_decorator.py:103:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method: bad return type [bad-return-type]'] +Line 117: Unexpected errors ['qualifiers_final_decorator.py:117:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class Derived5 overrides final method method, defined in base class Base5_2 [final-error]'] """ diff --git a/conformance/results/pytype/specialtypes_never.toml b/conformance/results/pytype/specialtypes_never.toml index bb2352598..7a2318585 100644 --- a/conformance/results/pytype/specialtypes_never.toml +++ b/conformance/results/pytype/specialtypes_never.toml @@ -3,20 +3,45 @@ notes = """ Does not understand NoReturn or Never. """ output = """ -File "specialtypes_never.py", line 11, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] -File "specialtypes_never.py", line 21, in func1: bad return type [bad-return-type] -File "specialtypes_never.py", line 68, in func6: Type annotation for v1 does not match type of assignment [annotation-type-mismatch] -File "specialtypes_never.py", line 69, in func6: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] -File "specialtypes_never.py", line 70, in func6: Type annotation for v3 does not match type of assignment [annotation-type-mismatch] -File "specialtypes_never.py", line 86, in func8: Type annotation for v3 does not match type of assignment [annotation-type-mismatch] +specialtypes_never.py:11:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +T_co = TypeVar("T_co", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_never.py:21:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: bad return type [bad-return-type] + + sys.exit(1) \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + sys.exit(1) +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_never.py:68:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func6: Type annotation for v1 does not match type of assignment [annotation-type-mismatch] + + v1: int = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +specialtypes_never.py:69:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func6: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] + + v2: str = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +specialtypes_never.py:70:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func6: Type annotation for v3 does not match type of assignment [annotation-type-mismatch] + + v3: list[str] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +specialtypes_never.py:86:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: Type annotation for v3 does not match type of assignment [annotation-type-mismatch] + + v3: list[int] = c # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 19: Expected 1 errors Line 105: Expected 1 errors -Line 11: Unexpected errors ['File "specialtypes_never.py", line 11, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 21: Unexpected errors ['File "specialtypes_never.py", line 21, in func1: bad return type [bad-return-type]'] -Line 68: Unexpected errors ['File "specialtypes_never.py", line 68, in func6: Type annotation for v1 does not match type of assignment [annotation-type-mismatch]'] -Line 69: Unexpected errors ['File "specialtypes_never.py", line 69, in func6: Type annotation for v2 does not match type of assignment [annotation-type-mismatch]'] -Line 70: Unexpected errors ['File "specialtypes_never.py", line 70, in func6: Type annotation for v3 does not match type of assignment [annotation-type-mismatch]'] +Line 11: Unexpected errors ['specialtypes_never.py:11:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[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 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/specialtypes_none.toml b/conformance/results/pytype/specialtypes_none.toml index 1c1b30f21..03a38e99d 100644 --- a/conformance/results/pytype/specialtypes_none.toml +++ b/conformance/results/pytype/specialtypes_none.toml @@ -4,8 +4,16 @@ Does not detect type incompatibility between None and type[None]. Does not detect type incompatibility between None and incompatible protocol. """ output = """ -File "specialtypes_none.py", line 21, in : Function func1 was called with the wrong arguments [wrong-arg-types] -File "specialtypes_none.py", line 41, in : Function func2 was called with the wrong arguments [wrong-arg-types] +specialtypes_none.py:21:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function func1 was called with the wrong arguments [wrong-arg-types] + +func1(type(None)) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_none.py:41:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function func2 was called with the wrong arguments [wrong-arg-types] + +func2(None) # E: not compatible +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pytype/specialtypes_promotions.toml b/conformance/results/pytype/specialtypes_promotions.toml index dc20943f2..8380712e2 100644 --- a/conformance/results/pytype/specialtypes_promotions.toml +++ b/conformance/results/pytype/specialtypes_promotions.toml @@ -1,6 +1,10 @@ conformant = "Pass" output = """ -File "specialtypes_promotions.py", line 13, in func1: No attribute 'numerator' on float [attribute-error] +specialtypes_promotions.py:13:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: No attribute 'numerator' on float [attribute-error] + + f.numerator # E + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pytype/specialtypes_type.toml b/conformance/results/pytype/specialtypes_type.toml index 3a00c1aa9..c9ad20353 100644 --- a/conformance/results/pytype/specialtypes_type.toml +++ b/conformance/results/pytype/specialtypes_type.toml @@ -4,26 +4,80 @@ Does not reject Callable when passed to type[T]. Does not allow access to known attributes from object of type `type[Any]`. """ output = """ -File "specialtypes_type.py", line 56, in : Function func4 was called with the wrong arguments [wrong-arg-types] -File "specialtypes_type.py", line 64, in : Invalid type annotation 'T' [invalid-annotation] -File "specialtypes_type.py", line 76, in : Invalid type annotation 'type[int, str]' [invalid-annotation] -File "specialtypes_type.py", line 98, in func7: Any [assert-type] -File "specialtypes_type.py", line 102, in func7: Any [assert-type] -File "specialtypes_type.py", line 106, in func7: Any [assert-type] -File "specialtypes_type.py", line 110, in func7: Any [assert-type] -File "specialtypes_type.py", line 117, in func8: No attribute 'unknown' on Type[object] [attribute-error] -File "specialtypes_type.py", line 120, in func8: No attribute 'unknown' on Type[object] [attribute-error] -File "specialtypes_type.py", line 143, in : No attribute 'unknown' on Type[type] [attribute-error] -File "specialtypes_type.py", line 144, in : No attribute 'unknown' on Type[type] [attribute-error] -File "specialtypes_type.py", line 145, in : No attribute 'unknown' on Type[type] [attribute-error] -File "specialtypes_type.py", line 146, in : No attribute 'unknown' on Type[type] [attribute-error] +specialtypes_type.py:56:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function func4 was called with the wrong arguments [wrong-arg-types] + +func4(TeamUser) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_type.py:64:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T' [invalid-annotation] + +def func5(x: type[T]) -> None: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_type.py:76:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'type[int, str]' [invalid-annotation] + +bad_type1: type[int, str] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_type.py:98:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func7: Any [assert-type] + + assert_type(a.__mro__, tuple[type, ...]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_type.py:102:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func7: Any [assert-type] + + assert_type(b.__mro__, tuple[type, ...]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_type.py:106:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func7: Any [assert-type] + + assert_type(c.__mro__, tuple[type, ...]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_type.py:110:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func7: Any [assert-type] + + assert_type(d.__mro__, tuple[type, ...]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_type.py:117:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: No attribute 'unknown' on Type[object] [attribute-error] + + a.unknown # E + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_type.py:120:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: No attribute 'unknown' on Type[object] [attribute-error] + + b.unknown # E + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_type.py:143:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'unknown' on Type[type] [attribute-error] + +TA1.unknown # E +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_type.py:144:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'unknown' on Type[type] [attribute-error] + +TA2.unknown # E +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_type.py:145:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'unknown' on Type[type] [attribute-error] + +TA3.unknown # E +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_type.py:146:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'unknown' on Type[type] [attribute-error] + +TA4.unknown # E +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 70: Expected 1 errors -Line 64: Unexpected errors ['File "specialtypes_type.py", line 64, in : Invalid type annotation \\'T\\' [invalid-annotation]'] -Line 98: Unexpected errors ['File "specialtypes_type.py", line 98, in func7: Any [assert-type]'] -Line 102: Unexpected errors ['File "specialtypes_type.py", line 102, in func7: Any [assert-type]'] -Line 106: Unexpected errors ['File "specialtypes_type.py", line 106, in func7: Any [assert-type]'] -Line 110: Unexpected errors ['File "specialtypes_type.py", line 110, in func7: Any [assert-type]'] +Line 64: Unexpected errors ["specialtypes_type.py:64:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T' [invalid-annotation]"] +Line 98: Unexpected errors ['specialtypes_type.py:98:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: Any [assert-type]'] +Line 102: Unexpected errors ['specialtypes_type.py:102:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: Any [assert-type]'] +Line 106: Unexpected errors ['specialtypes_type.py:106:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: Any [assert-type]'] +Line 110: Unexpected errors ['specialtypes_type.py:110:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: Any [assert-type]'] """ diff --git a/conformance/results/pytype/tuples_type_compat.toml b/conformance/results/pytype/tuples_type_compat.toml index 638c5bf2e..c198de7ad 100644 --- a/conformance/results/pytype/tuples_type_compat.toml +++ b/conformance/results/pytype/tuples_type_compat.toml @@ -5,61 +5,281 @@ Does not report type violation when assigning `tuple[int, ...]` to `tuple[int]`. Does not support tuple narrowing based on `len()` type guard (optional). """ output = """ -File "tuples_type_compat.py", line 15, in func1: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 22, in : Invalid type annotation '' [invalid-annotation] -File "tuples_type_compat.py", line 27, in func2: Invalid type annotation 'tuple[int, *tuple[int, ...]]' [invalid-annotation] -File "tuples_type_compat.py", line 47, in func3: Invalid type annotation 'tuple[int, *tuple[str, ...]]' [invalid-annotation] -File "tuples_type_compat.py", line 71, in : Invalid type annotation '' [invalid-annotation] -File "tuples_type_compat.py", line 74, in func5: tuple [assert-type] -File "tuples_type_compat.py", line 78, in func5: tuple [assert-type] -File "tuples_type_compat.py", line 82, in func5: tuple [assert-type] -File "tuples_type_compat.py", line 91, in : Invalid type annotation '' [invalid-annotation] -File "tuples_type_compat.py", line 115, in func7: Tuple[Union[int, str], Union[int, str]] [assert-type] -File "tuples_type_compat.py", line 117, in func7: Tuple[Union[int, str], Union[int, str]] [assert-type] -File "tuples_type_compat.py", line 134, in : Invalid type annotation '' [invalid-annotation] -File "tuples_type_compat.py", line 139, in func8: Sequence [assert-type] -File "tuples_type_compat.py", line 140, in func8: Sequence [assert-type] -File "tuples_type_compat.py", line 143, in : Type annotation for t1 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 143, in : Invalid type annotation 'tuple[int, *tuple[str]]' [invalid-annotation] -File "tuples_type_compat.py", line 143, in : Invalid type annotation '' [invalid-annotation] -File "tuples_type_compat.py", line 144, in : Type annotation for t1 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 146, in : Invalid type annotation 'tuple[int, *tuple[str, ...]]' [invalid-annotation] -File "tuples_type_compat.py", line 146, in : Invalid type annotation '' [invalid-annotation] -File "tuples_type_compat.py", line 147, in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 148, in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 149, in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 150, in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 153, in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 153, in : Invalid type annotation 'tuple[int, *tuple[str, ...], int]' [invalid-annotation] -File "tuples_type_compat.py", line 153, in : Invalid type annotation '' [invalid-annotation] -File "tuples_type_compat.py", line 154, in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 155, in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 156, in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 157, in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 159, in : Invalid type annotation 'tuple[*tuple[str, ...], int]' [invalid-annotation] -File "tuples_type_compat.py", line 159, in : Invalid type annotation '' [invalid-annotation] -File "tuples_type_compat.py", line 160, in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 161, in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 162, in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 163, in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 167, in func9: Type annotation for t1 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 167, in func9: Invalid type annotation 'tuple[str, str, *tuple[int, ...]]' [invalid-annotation] -File "tuples_type_compat.py", line 168, in func9: Type annotation for t2 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 168, in func9: Invalid type annotation 'tuple[str, str, *tuple[int]]' [invalid-annotation] -File "tuples_type_compat.py", line 169, in func9: Type annotation for t3 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 169, in func9: Invalid type annotation 'tuple[str, *tuple[str, ...]]' [invalid-annotation] -File "tuples_type_compat.py", line 170, in func9: Type annotation for t4 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 170, in func9: Invalid type annotation 'tuple[str, str, *tuple[str, ...]]' [invalid-annotation] -File "tuples_type_compat.py", line 171, in func9: Type annotation for t5 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 171, in func9: Invalid type annotation 'tuple[str, str, str, *tuple[str, ...]]' [invalid-annotation] -File "tuples_type_compat.py", line 172, in func9: Type annotation for t6 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 172, in func9: Invalid type annotation 'tuple[str, *tuple[int, ...], str]' [invalid-annotation] -File "tuples_type_compat.py", line 173, in func9: Type annotation for t7 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 173, in func9: Invalid type annotation 'tuple[*tuple[str, ...], str]' [invalid-annotation] -File "tuples_type_compat.py", line 174, in func9: Type annotation for t8 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 174, in func9: Invalid type annotation 'tuple[*tuple[str, ...], str]' [invalid-annotation] -File "tuples_type_compat.py", line 175, in func9: Type annotation for t9 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 175, in func9: Invalid type annotation 'tuple[*tuple[str, ...], str, str, str]' [invalid-annotation] +tuples_type_compat.py:15:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] + + v2: tuple[int, int] = t1 # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:22:31: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func2(t1: tuple[int], t2: tuple[int, *tuple[int, ...]], t3: tuple[int, ...]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:27:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Invalid type annotation 'tuple[int, *tuple[int, ...]]' [invalid-annotation] + + v2: tuple[int, *tuple[int, ...]] + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:47:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Invalid type annotation 'tuple[int, *tuple[str, ...]]' [invalid-annotation] + + v6: tuple[int, *tuple[str, ...]] = t3 # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:71:47: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func5(val: tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:74:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func5: tuple [assert-type] + + assert_type(val, tuple[int]) # tuple[int] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:78:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func5: tuple [assert-type] + + assert_type(val, tuple[str, str] | tuple[int, int]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:82:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func5: tuple [assert-type] + + assert_type(val, tuple[int, str, int]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:91:47: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func6(val: tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:115:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func7: Tuple[Union[int, str], Union[int, str]] [assert-type] + + assert_type(subj, tuple[int | str, str]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:117:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func7: Tuple[Union[int, str], Union[int, str]] [assert-type] + + assert_type(subj, tuple[int | str, int]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:134:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + + t1: tuple[complex, list[int]], t2: tuple[int, *tuple[str, ...]], t3: tuple[()] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:139:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: Sequence [assert-type] + + assert_type(test_seq(t2), Sequence[int | str]) # Could be Sequence[object] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:140:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: Sequence [assert-type] + + assert_type(test_seq(t3), Sequence[Never]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:143:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t1 does not match type of assignment [annotation-type-mismatch] + +t1: tuple[int, *tuple[str]] = (1, "") # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:143:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[int, *tuple[str]]' [invalid-annotation] + +t1: tuple[int, *tuple[str]] = (1, "") # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:143:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +t1: tuple[int, *tuple[str]] = (1, "") # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:144:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t1 does not match type of assignment [annotation-type-mismatch] + +t1 = (1, "", "") # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:146:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[int, *tuple[str, ...]]' [invalid-annotation] + +t2: tuple[int, *tuple[str, ...]] = (1,) # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:146:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +t2: tuple[int, *tuple[str, ...]] = (1,) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:147:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] + +t2 = (1, "") # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:148:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] + +t2 = (1, "", "") # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:149:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] + +t2 = (1, 1, "") # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:150:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] + +t2 = (1, "", 1) # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:153:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] + +t3: tuple[int, *tuple[str, ...], int] = (1, 2) # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:153:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[int, *tuple[str, ...], int]' [invalid-annotation] + +t3: tuple[int, *tuple[str, ...], int] = (1, 2) # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:153:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +t3: tuple[int, *tuple[str, ...], int] = (1, 2) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:154:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] + +t3 = (1, "", 2) # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:155:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] + +t3 = (1, "", "", 2) # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:156:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] + +t3 = (1, "", "") # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:157:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] + +t3 = (1, "", "", 1.2) # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:159:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[*tuple[str, ...], int]' [invalid-annotation] + +t4: tuple[*tuple[str, ...], int] = (1,) # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:159:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +t4: tuple[*tuple[str, ...], int] = (1,) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:160:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch] + +t4 = ("", 1) # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:161:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch] + +t4 = ("", "", 1) # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:162:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch] + +t4 = (1, "", 1) # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:163:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch] + +t4 = ("", "", 1.2) # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:167:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t1 does not match type of assignment [annotation-type-mismatch] + + t1: tuple[str, str, *tuple[int, ...]] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:167:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[str, str, *tuple[int, ...]]' [invalid-annotation] + + t1: tuple[str, str, *tuple[int, ...]] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:168:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t2 does not match type of assignment [annotation-type-mismatch] + + t2: tuple[str, str, *tuple[int]] = a # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:168:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[str, str, *tuple[int]]' [invalid-annotation] + + t2: tuple[str, str, *tuple[int]] = a # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:169:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t3 does not match type of assignment [annotation-type-mismatch] + + t3: tuple[str, *tuple[str, ...]] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:169:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[str, *tuple[str, ...]]' [invalid-annotation] + + t3: tuple[str, *tuple[str, ...]] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:170:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t4 does not match type of assignment [annotation-type-mismatch] + + t4: tuple[str, str, *tuple[str, ...]] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:170:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[str, str, *tuple[str, ...]]' [invalid-annotation] + + t4: tuple[str, str, *tuple[str, ...]] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:171:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t5 does not match type of assignment [annotation-type-mismatch] + + t5: tuple[str, str, str, *tuple[str, ...]] = a # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:171:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[str, str, str, *tuple[str, ...]]' [invalid-annotation] + + t5: tuple[str, str, str, *tuple[str, ...]] = a # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:172:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t6 does not match type of assignment [annotation-type-mismatch] + + t6: tuple[str, *tuple[int, ...], str] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:172:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[str, *tuple[int, ...], str]' [invalid-annotation] + + t6: tuple[str, *tuple[int, ...], str] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:173:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t7 does not match type of assignment [annotation-type-mismatch] + + t7: tuple[*tuple[str, ...], str] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:173:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[*tuple[str, ...], str]' [invalid-annotation] + + t7: tuple[*tuple[str, ...], str] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:174:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t8 does not match type of assignment [annotation-type-mismatch] + + t8: tuple[*tuple[str, ...], str] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:174:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[*tuple[str, ...], str]' [invalid-annotation] + + t8: tuple[*tuple[str, ...], str] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:175:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t9 does not match type of assignment [annotation-type-mismatch] + + t9: tuple[*tuple[str, ...], str, str, str] = a # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:175:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[*tuple[str, ...], str, str, str]' [invalid-annotation] + + t9: tuple[*tuple[str, ...], str, str, str] = a # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -68,33 +288,33 @@ Line 32: Expected 1 errors Line 33: Expected 1 errors Line 43: Expected 1 errors Line 62: Expected 1 errors -Line 22: Unexpected errors ['File "tuples_type_compat.py", line 22, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 27: Unexpected errors ['File "tuples_type_compat.py", line 27, in func2: Invalid type annotation \\'tuple[int, *tuple[int, ...]]\\' [invalid-annotation]'] -Line 47: Unexpected errors ['File "tuples_type_compat.py", line 47, in func3: Invalid type annotation \\'tuple[int, *tuple[str, ...]]\\' [invalid-annotation]'] -Line 71: Unexpected errors ['File "tuples_type_compat.py", line 71, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 74: Unexpected errors ['File "tuples_type_compat.py", line 74, in func5: tuple [assert-type]'] -Line 78: Unexpected errors ['File "tuples_type_compat.py", line 78, in func5: tuple [assert-type]'] -Line 82: Unexpected errors ['File "tuples_type_compat.py", line 82, in func5: tuple [assert-type]'] -Line 91: Unexpected errors ['File "tuples_type_compat.py", line 91, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 115: Unexpected errors ['File "tuples_type_compat.py", line 115, in func7: Tuple[Union[int, str], Union[int, str]] [assert-type]'] -Line 117: Unexpected errors ['File "tuples_type_compat.py", line 117, in func7: Tuple[Union[int, str], Union[int, str]] [assert-type]'] -Line 134: Unexpected errors ['File "tuples_type_compat.py", line 134, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 139: Unexpected errors ['File "tuples_type_compat.py", line 139, in func8: Sequence [assert-type]'] -Line 140: Unexpected errors ['File "tuples_type_compat.py", line 140, in func8: Sequence [assert-type]'] -Line 143: Unexpected errors ['File "tuples_type_compat.py", line 143, in : Type annotation for t1 does not match type of assignment [annotation-type-mismatch]', 'File "tuples_type_compat.py", line 143, in : Invalid type annotation \\'tuple[int, *tuple[str]]\\' [invalid-annotation]', 'File "tuples_type_compat.py", line 143, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 146: Unexpected errors ['File "tuples_type_compat.py", line 146, in : Invalid type annotation \\'tuple[int, *tuple[str, ...]]\\' [invalid-annotation]', 'File "tuples_type_compat.py", line 146, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 147: Unexpected errors ['File "tuples_type_compat.py", line 147, in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch]'] -Line 148: Unexpected errors ['File "tuples_type_compat.py", line 148, in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch]'] -Line 153: Unexpected errors ['File "tuples_type_compat.py", line 153, in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch]', 'File "tuples_type_compat.py", line 153, in : Invalid type annotation \\'tuple[int, *tuple[str, ...], int]\\' [invalid-annotation]', 'File "tuples_type_compat.py", line 153, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 154: Unexpected errors ['File "tuples_type_compat.py", line 154, in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch]'] -Line 155: Unexpected errors ['File "tuples_type_compat.py", line 155, in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch]'] -Line 159: Unexpected errors ['File "tuples_type_compat.py", line 159, in : Invalid type annotation \\'tuple[*tuple[str, ...], int]\\' [invalid-annotation]', 'File "tuples_type_compat.py", line 159, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 160: Unexpected errors ['File "tuples_type_compat.py", line 160, in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch]'] -Line 161: Unexpected errors ['File "tuples_type_compat.py", line 161, in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch]'] -Line 167: Unexpected errors ['File "tuples_type_compat.py", line 167, in func9: Type annotation for t1 does not match type of assignment [annotation-type-mismatch]', 'File "tuples_type_compat.py", line 167, in func9: Invalid type annotation \\'tuple[str, str, *tuple[int, ...]]\\' [invalid-annotation]'] -Line 169: Unexpected errors ['File "tuples_type_compat.py", line 169, in func9: Type annotation for t3 does not match type of assignment [annotation-type-mismatch]', 'File "tuples_type_compat.py", line 169, in func9: Invalid type annotation \\'tuple[str, *tuple[str, ...]]\\' [invalid-annotation]'] -Line 170: Unexpected errors ['File "tuples_type_compat.py", line 170, in func9: Type annotation for t4 does not match type of assignment [annotation-type-mismatch]', 'File "tuples_type_compat.py", line 170, in func9: Invalid type annotation \\'tuple[str, str, *tuple[str, ...]]\\' [invalid-annotation]'] -Line 172: Unexpected errors ['File "tuples_type_compat.py", line 172, in func9: Type annotation for t6 does not match type of assignment [annotation-type-mismatch]', 'File "tuples_type_compat.py", line 172, in func9: Invalid type annotation \\'tuple[str, *tuple[int, ...], str]\\' [invalid-annotation]'] -Line 173: Unexpected errors ['File "tuples_type_compat.py", line 173, in func9: Type annotation for t7 does not match type of assignment [annotation-type-mismatch]', 'File "tuples_type_compat.py", line 173, in func9: Invalid type annotation \\'tuple[*tuple[str, ...], str]\\' [invalid-annotation]'] -Line 174: Unexpected errors ['File "tuples_type_compat.py", line 174, in func9: Type annotation for t8 does not match type of assignment [annotation-type-mismatch]', 'File "tuples_type_compat.py", line 174, in func9: Invalid type annotation \\'tuple[*tuple[str, ...], str]\\' [invalid-annotation]'] +Line 22: Unexpected errors ["tuples_type_compat.py:22:31: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 27: Unexpected errors ["tuples_type_compat.py:27:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: Invalid type annotation 'tuple[int, *tuple[int, ...]]' [invalid-annotation]"] +Line 47: Unexpected errors ["tuples_type_compat.py:47:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: Invalid type annotation 'tuple[int, *tuple[str, ...]]' [invalid-annotation]"] +Line 71: Unexpected errors ["tuples_type_compat.py:71:47: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 74: Unexpected errors ['tuples_type_compat.py:74:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func5: tuple [assert-type]'] +Line 78: Unexpected errors ['tuples_type_compat.py:78:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func5: tuple [assert-type]'] +Line 82: Unexpected errors ['tuples_type_compat.py:82:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func5: tuple [assert-type]'] +Line 91: Unexpected errors ["tuples_type_compat.py:91:47: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 115: Unexpected errors ['tuples_type_compat.py:115:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: Tuple[Union[int, str], Union[int, str]] [assert-type]'] +Line 117: Unexpected errors ['tuples_type_compat.py:117:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: Tuple[Union[int, str], Union[int, str]] [assert-type]'] +Line 134: Unexpected errors ["tuples_type_compat.py:134:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 139: Unexpected errors ['tuples_type_compat.py:139:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: Sequence [assert-type]'] +Line 140: Unexpected errors ['tuples_type_compat.py:140:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: Sequence [assert-type]'] +Line 143: Unexpected errors ['tuples_type_compat.py:143:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t1 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:143:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[int, *tuple[str]]' [invalid-annotation]", "tuples_type_compat.py:143:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 146: Unexpected errors ["tuples_type_compat.py:146:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[int, *tuple[str, ...]]' [invalid-annotation]", "tuples_type_compat.py:146:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 147: Unexpected errors ['tuples_type_compat.py:147:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch]'] +Line 148: Unexpected errors ['tuples_type_compat.py:148:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch]'] +Line 153: Unexpected errors ['tuples_type_compat.py:153:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:153:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[int, *tuple[str, ...], int]' [invalid-annotation]", "tuples_type_compat.py:153:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 154: Unexpected errors ['tuples_type_compat.py:154:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch]'] +Line 155: Unexpected errors ['tuples_type_compat.py:155:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch]'] +Line 159: Unexpected errors ["tuples_type_compat.py:159:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[*tuple[str, ...], int]' [invalid-annotation]", "tuples_type_compat.py:159:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 160: Unexpected errors ['tuples_type_compat.py:160:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch]'] +Line 161: Unexpected errors ['tuples_type_compat.py:161:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch]'] +Line 167: Unexpected errors ['tuples_type_compat.py:167:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Type annotation for t1 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:167:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Invalid type annotation 'tuple[str, str, *tuple[int, ...]]' [invalid-annotation]"] +Line 169: Unexpected errors ['tuples_type_compat.py:169:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Type annotation for t3 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:169:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Invalid type annotation 'tuple[str, *tuple[str, ...]]' [invalid-annotation]"] +Line 170: Unexpected errors ['tuples_type_compat.py:170:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Type annotation for t4 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:170:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Invalid type annotation 'tuple[str, str, *tuple[str, ...]]' [invalid-annotation]"] +Line 172: Unexpected errors ['tuples_type_compat.py:172:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Type annotation for t6 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:172:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Invalid type annotation 'tuple[str, *tuple[int, ...], str]' [invalid-annotation]"] +Line 173: Unexpected errors ['tuples_type_compat.py:173:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Type annotation for t7 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:173:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Invalid type annotation 'tuple[*tuple[str, ...], str]' [invalid-annotation]"] +Line 174: Unexpected errors ['tuples_type_compat.py:174:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Type annotation for t8 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:174:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Invalid type annotation 'tuple[*tuple[str, ...], str]' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/tuples_type_form.toml b/conformance/results/pytype/tuples_type_form.toml index f8bb94391..8ecf9d221 100644 --- a/conformance/results/pytype/tuples_type_form.toml +++ b/conformance/results/pytype/tuples_type_form.toml @@ -1,18 +1,70 @@ conformant = "Pass" output = """ -File "tuples_type_form.py", line 12, in : Type annotation for t1 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_form.py", line 14, in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_form.py", line 15, in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_form.py", line 25, in : Type annotation for t10 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_form.py", line 36, in : Type annotation for t20 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_form.py", line 40, in : Invalid type annotation 'tuple[int, int, Any]' [invalid-annotation] -File "tuples_type_form.py", line 41, in : Invalid type annotation 'Ellipsis' [invalid-annotation] -File "tuples_type_form.py", line 42, in : Invalid type annotation 'tuple[Any, int]' [invalid-annotation] -File "tuples_type_form.py", line 42, in : Invalid type annotation 'Ellipsis' [invalid-annotation] -File "tuples_type_form.py", line 43, in : Invalid type annotation 'tuple[int, Any, int]' [invalid-annotation] -File "tuples_type_form.py", line 43, in : Invalid type annotation 'Ellipsis' [invalid-annotation] -File "tuples_type_form.py", line 44, in : Invalid type annotation '' [invalid-annotation] -File "tuples_type_form.py", line 45, in : Invalid type annotation '' [invalid-annotation] +tuples_type_form.py:12:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t1 does not match type of assignment [annotation-type-mismatch] + +t1 = (1, 2) # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_form.py:14:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] + +t2 = (1,) # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_form.py:15:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] + +t2 = (1, "") # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_form.py:25:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t10 does not match type of assignment [annotation-type-mismatch] + +t10 = (1,) # E +\u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +tuples_type_form.py:36:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t20 does not match type of assignment [annotation-type-mismatch] + +t20 = (1, 2, 3, "") # E +\u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +tuples_type_form.py:40:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[int, int, Any]' [invalid-annotation] + +t31: tuple[int, int, ...] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_form.py:41:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Ellipsis' [invalid-annotation] + +t32: tuple[...] # E + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_form.py:42:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any, int]' [invalid-annotation] + +t33: tuple[..., int] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_form.py:42:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Ellipsis' [invalid-annotation] + +t33: tuple[..., int] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_form.py:43:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[int, Any, int]' [invalid-annotation] + +t34: tuple[int, ..., int] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_form.py:43:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Ellipsis' [invalid-annotation] + +t34: tuple[int, ..., int] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_form.py:44:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +t35: tuple[*tuple[str], ...] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_form.py:45:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +t36: tuple[*tuple[str, ...], ...] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pytype/tuples_unpacked.toml b/conformance/results/pytype/tuples_unpacked.toml index 78e943a83..9b4b5b55b 100644 --- a/conformance/results/pytype/tuples_unpacked.toml +++ b/conformance/results/pytype/tuples_unpacked.toml @@ -4,50 +4,164 @@ Does not support `typing.Unpack`. Does not support unpacked tuples within a tuple type form. """ output = """ -File "tuples_unpacked.py", line 13, in : typing.Unpack not supported yet [not-supported-yet] -File "tuples_unpacked.py", line 13, in : typing.TypeVarTuple not supported yet [not-supported-yet] -File "tuples_unpacked.py", line 16, in : Invalid type annotation '' [invalid-annotation] -File "tuples_unpacked.py", line 17, in func1: Tuple[Any] [assert-type] -File "tuples_unpacked.py", line 18, in func1: Invalid type annotation '' [invalid-annotation] -File "tuples_unpacked.py", line 19, in func1: Invalid type annotation '' [invalid-annotation] -File "tuples_unpacked.py", line 25, in : Invalid type annotation '' [invalid-annotation] -File "tuples_unpacked.py", line 26, in func2: Invalid type annotation '' [invalid-annotation] -File "tuples_unpacked.py", line 31, in : Type annotation for u1 does not match type of assignment [annotation-type-mismatch] -File "tuples_unpacked.py", line 31, in : Invalid type annotation 'tuple[*tuple[int], *tuple[int]]' [invalid-annotation] -File "tuples_unpacked.py", line 31, in : Invalid type annotation '' [invalid-annotation] -File "tuples_unpacked.py", line 31, in : Function list.extend was called with the wrong arguments [wrong-arg-types] -File "tuples_unpacked.py", line 32, in : Tuple[Any] [assert-type] -File "tuples_unpacked.py", line 33, in : Invalid type annotation '' [invalid-annotation] -File "tuples_unpacked.py", line 33, in : Function list.extend was called with the wrong arguments [wrong-arg-types] -File "tuples_unpacked.py", line 38, in : Invalid type annotation '' [invalid-annotation] -File "tuples_unpacked.py", line 38, in : Function list.extend was called with the wrong arguments [wrong-arg-types] -File "tuples_unpacked.py", line 39, in : Invalid type annotation '' [invalid-annotation] -File "tuples_unpacked.py", line 40, in : Invalid type annotation '' [invalid-annotation] -File "tuples_unpacked.py", line 40, in : Function list.extend was called with the wrong arguments [wrong-arg-types] -File "tuples_unpacked.py", line 41, in : Invalid type annotation '' [invalid-annotation] -File "tuples_unpacked.py", line 41, in : Function list.extend was called with the wrong arguments [wrong-arg-types] -File "tuples_unpacked.py", line 46, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "tuples_unpacked.py", line 49, in : Invalid type annotation '' [invalid-annotation] -File "tuples_unpacked.py", line 50, in func3: Invalid type annotation 'tuple[*tuple[str], *Ts]' [invalid-annotation] -File "tuples_unpacked.py", line 51, in func3: Invalid type annotation 'tuple[*tuple[str, ...], *Ts]' [invalid-annotation] +tuples_unpacked.py:13:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.Unpack not supported yet [not-supported-yet] + +from typing import TypeVarTuple, Unpack, assert_type +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:13:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] + +from typing import TypeVarTuple, Unpack, assert_type +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:16:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func1(x: tuple[int, *tuple[bool, bool], str]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:17:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Tuple[Any] [assert-type] + + assert_type(x, tuple[int, bool, bool, str]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:18:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Invalid type annotation '' [invalid-annotation] + + assert_type(x, tuple[*tuple[int, bool], bool, str]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:19:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Invalid type annotation '' [invalid-annotation] + + assert_type(x, tuple[int, bool, *tuple[bool, str]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:25:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func2(x: tuple[int, *tuple[bool, ...], str]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:26:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Invalid type annotation '' [invalid-annotation] + + assert_type(x, tuple[int, *tuple[bool, ...], str]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:31:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for u1 does not match type of assignment [annotation-type-mismatch] + +u1: tuple[*tuple[int], *tuple[int]] = (int(1), int(1)) # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_unpacked.py:31:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[*tuple[int], *tuple[int]]' [invalid-annotation] + +u1: tuple[*tuple[int], *tuple[int]] = (int(1), int(1)) # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_unpacked.py:31:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +u1: tuple[*tuple[int], *tuple[int]] = (int(1), int(1)) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:31:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types] + +u1: tuple[*tuple[int], *tuple[int]] = (int(1), int(1)) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:32:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Any] [assert-type] + +assert_type(u1, tuple[int, int]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:33:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +u2: tuple[*tuple[int, ...], *tuple[int]] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:33:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types] + +u2: tuple[*tuple[int, ...], *tuple[int]] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:38:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +t1: tuple[*tuple[str], *tuple[str]] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:38:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types] + +t1: tuple[*tuple[str], *tuple[str]] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:39:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +t2: tuple[*tuple[str, *tuple[str, ...]]] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:39:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +t2: tuple[*tuple[str, *tuple[str, ...]]] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:40:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +t3: tuple[*tuple[str, ...], *tuple[int, ...]] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:40:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types] + +t3: tuple[*tuple[str, ...], *tuple[int, ...]] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:41:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +t4: tuple[*tuple[str, *tuple[str, ...]], *tuple[int, ...]] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:41:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +t4: tuple[*tuple[str, *tuple[str, ...]], *tuple[int, ...]] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:41:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types] + +t4: tuple[*tuple[str, *tuple[str, ...]], *tuple[int, ...]] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:46:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Ts = TypeVarTuple("Ts") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:49:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func3(t: tuple[*Ts]): + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:50:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Invalid type annotation 'tuple[*tuple[str], *Ts]' [invalid-annotation] + + t5: tuple[*tuple[str], *Ts] # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_unpacked.py:51:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Invalid type annotation 'tuple[*tuple[str, ...], *Ts]' [invalid-annotation] + + t6: tuple[*tuple[str, ...], *Ts] # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 59: Expected 1 errors Lines 60, 61: Expected error (tag 't14') -Line 13: Unexpected errors ['File "tuples_unpacked.py", line 13, in : typing.Unpack not supported yet [not-supported-yet]', 'File "tuples_unpacked.py", line 13, in : typing.TypeVarTuple not supported yet [not-supported-yet]'] -Line 16: Unexpected errors ['File "tuples_unpacked.py", line 16, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 17: Unexpected errors ['File "tuples_unpacked.py", line 17, in func1: Tuple[Any] [assert-type]'] -Line 18: Unexpected errors ['File "tuples_unpacked.py", line 18, in func1: Invalid type annotation \\'\\' [invalid-annotation]'] -Line 19: Unexpected errors ['File "tuples_unpacked.py", line 19, in func1: Invalid type annotation \\'\\' [invalid-annotation]'] -Line 25: Unexpected errors ['File "tuples_unpacked.py", line 25, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 26: Unexpected errors ['File "tuples_unpacked.py", line 26, in func2: Invalid type annotation \\'\\' [invalid-annotation]'] -Line 31: Unexpected errors ['File "tuples_unpacked.py", line 31, in : Type annotation for u1 does not match type of assignment [annotation-type-mismatch]', 'File "tuples_unpacked.py", line 31, in : Invalid type annotation \\'tuple[*tuple[int], *tuple[int]]\\' [invalid-annotation]', 'File "tuples_unpacked.py", line 31, in : Invalid type annotation \\'\\' [invalid-annotation]', 'File "tuples_unpacked.py", line 31, in : Function list.extend was called with the wrong arguments [wrong-arg-types]'] -Line 32: Unexpected errors ['File "tuples_unpacked.py", line 32, in : Tuple[Any] [assert-type]'] -Line 33: Unexpected errors ['File "tuples_unpacked.py", line 33, in : Invalid type annotation \\'\\' [invalid-annotation]', 'File "tuples_unpacked.py", line 33, in : Function list.extend was called with the wrong arguments [wrong-arg-types]'] -Line 38: Unexpected errors ['File "tuples_unpacked.py", line 38, in : Invalid type annotation \\'\\' [invalid-annotation]', 'File "tuples_unpacked.py", line 38, in : Function list.extend was called with the wrong arguments [wrong-arg-types]'] -Line 39: Unexpected errors ['File "tuples_unpacked.py", line 39, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 46: Unexpected errors ['File "tuples_unpacked.py", line 46, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 49: Unexpected errors ['File "tuples_unpacked.py", line 49, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 50: Unexpected errors ['File "tuples_unpacked.py", line 50, in func3: Invalid type annotation \\'tuple[*tuple[str], *Ts]\\' [invalid-annotation]'] +Line 13: Unexpected errors ['tuples_unpacked.py:13:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.Unpack not supported yet [not-supported-yet]', 'tuples_unpacked.py:13:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] +Line 16: Unexpected errors ["tuples_unpacked.py:16:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 17: Unexpected errors ['tuples_unpacked.py:17:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Tuple[Any] [assert-type]'] +Line 18: Unexpected errors ["tuples_unpacked.py:18:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Invalid type annotation '' [invalid-annotation]"] +Line 19: Unexpected errors ["tuples_unpacked.py:19:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Invalid type annotation '' [invalid-annotation]"] +Line 25: Unexpected errors ["tuples_unpacked.py:25:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 26: Unexpected errors ["tuples_unpacked.py:26:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: Invalid type annotation '' [invalid-annotation]"] +Line 31: Unexpected errors ['tuples_unpacked.py:31:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for u1 does not match type of assignment [annotation-type-mismatch]', "tuples_unpacked.py:31:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[*tuple[int], *tuple[int]]' [invalid-annotation]", "tuples_unpacked.py:31:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", 'tuples_unpacked.py:31:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types]'] +Line 32: Unexpected errors ['tuples_unpacked.py:32:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Any] [assert-type]'] +Line 33: Unexpected errors ["tuples_unpacked.py:33:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", 'tuples_unpacked.py:33:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types]'] +Line 38: Unexpected errors ["tuples_unpacked.py:38:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", 'tuples_unpacked.py:38:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types]'] +Line 39: Unexpected errors ["tuples_unpacked.py:39:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "tuples_unpacked.py:39:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 46: Unexpected errors ['tuples_unpacked.py:46:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 49: Unexpected errors ["tuples_unpacked.py:49:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 50: Unexpected errors ["tuples_unpacked.py:50:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: Invalid type annotation 'tuple[*tuple[str], *Ts]' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/typeddicts_alt_syntax.toml b/conformance/results/pytype/typeddicts_alt_syntax.toml index cb4b223d3..62574fb06 100644 --- a/conformance/results/pytype/typeddicts_alt_syntax.toml +++ b/conformance/results/pytype/typeddicts_alt_syntax.toml @@ -5,8 +5,16 @@ Does not report when name of TypedDict doesn't match assigned identifier name. Does not support keyword-argument form of alternative syntax (deprecated in 3.11). """ output = """ -File "typeddicts_alt_syntax.py", line 27, in : Function typing.TypedDict was called with the wrong arguments [wrong-arg-types] -File "typeddicts_alt_syntax.py", line 41, in : Function typing.TypedDict expects 2 arg(s), got 3 [wrong-arg-count] +typeddicts_alt_syntax.py:27:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function typing.TypedDict was called with the wrong arguments [wrong-arg-types] + +BadTypedDict2 = TypedDict("BadTypedDict2", {1: str}) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_alt_syntax.py:41:10: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function typing.TypedDict expects 2 arg(s), got 3 [wrong-arg-count] + +Movie2 = TypedDict("Movie2", name=str, year=int) # E? + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pytype/typeddicts_class_syntax.toml b/conformance/results/pytype/typeddicts_class_syntax.toml index 8b43fddd6..c60ade248 100644 --- a/conformance/results/pytype/typeddicts_class_syntax.toml +++ b/conformance/results/pytype/typeddicts_class_syntax.toml @@ -5,7 +5,15 @@ Does not report when metaclass is provided. Does not report when other keyword argument is provided. """ output = """ -File "typeddicts_class_syntax.py", line 57, in : Invalid base class: Generic[T] [base-class-error] +typeddicts_class_syntax.py:57:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: Generic[T] [base-class-error] + +class GenericTypedDict(TypedDict, Generic[T]): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + name: str +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + value: T +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -14,5 +22,5 @@ Line 33: Expected 1 errors Line 38: Expected 1 errors Line 44: Expected 1 errors Line 49: Expected 1 errors -Line 57: Unexpected errors ['File "typeddicts_class_syntax.py", line 57, in : Invalid base class: Generic[T] [base-class-error]'] +Line 57: Unexpected errors ['typeddicts_class_syntax.py:57:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: Generic[T] [base-class-error]'] """ diff --git a/conformance/results/pytype/typeddicts_inheritance.toml b/conformance/results/pytype/typeddicts_inheritance.toml index 12f674766..ca9002699 100644 --- a/conformance/results/pytype/typeddicts_inheritance.toml +++ b/conformance/results/pytype/typeddicts_inheritance.toml @@ -1,8 +1,26 @@ conformant = "Pass" output = """ -File "typeddicts_inheritance.py", line 44, in : Invalid base class: NonTypedDict [base-class-error] -File "typeddicts_inheritance.py", line 54, in : Invalid base class: X1 [base-class-error] -File "typeddicts_inheritance.py", line 65, in : Invalid base class: Y2 [base-class-error] +typeddicts_inheritance.py:44:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: NonTypedDict [base-class-error] + +class BadTypedDict(TypedDict, NonTypedDict): # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_inheritance.py:54:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: X1 [base-class-error] + +class Y1(X1): # E[Y1] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + x: int # E[Y1]: cannot overwrite TypedDict field "x" +\u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_inheritance.py:65:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: Y2 [base-class-error] + +class XYZ2(X2, Y2): # E: cannot overwrite TypedDict field "x" while merging +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + xyz: bool +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pytype/typeddicts_operations.toml b/conformance/results/pytype/typeddicts_operations.toml index 8ed3fcdc5..a01d0edeb 100644 --- a/conformance/results/pytype/typeddicts_operations.toml +++ b/conformance/results/pytype/typeddicts_operations.toml @@ -6,11 +6,31 @@ Does not reject `clear` method on TypedDict with required keys. Does not reject delete operation for required key in TypedDict. """ output = """ -File "typeddicts_operations.py", line 28, in : Type annotation for movie does not match type of assignment [annotation-type-mismatch] -File "typeddicts_operations.py", line 29, in : Type annotation for movie does not match type of assignment [annotation-type-mismatch] -File "typeddicts_operations.py", line 32, in : Type annotation for movie does not match type of assignment [annotation-type-mismatch] -File "typeddicts_operations.py", line 37, in func1: Type annotation for movie does not match type of assignment [annotation-type-mismatch] -File "typeddicts_operations.py", line 60, in : str [assert-type] +typeddicts_operations.py:28:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for movie does not match type of assignment [annotation-type-mismatch] + +movie = {"name": "Blade Runner"} # E: year is missing +\u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +typeddicts_operations.py:29:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for movie does not match type of assignment [annotation-type-mismatch] + +movie = {"name": "Blade Runner", "year": 1982.1} # E: year is wrong type +\u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +typeddicts_operations.py:32:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for movie does not match type of assignment [annotation-type-mismatch] + +movie = {"name": "", "year": 1900, "other": 2} # E: extra key +\u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +typeddicts_operations.py:37:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for movie does not match type of assignment [annotation-type-mismatch] + + movie: Movie = {variable_key: "", "year": 1900} # E: variable key + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +typeddicts_operations.py:60:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : str [assert-type] + +assert_type(movie_optional.get("name"), str | None) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -21,5 +41,5 @@ Line 26: Expected 1 errors Line 47: Expected 1 errors Line 49: Expected 1 errors Line 62: Expected 1 errors -Line 60: Unexpected errors ['File "typeddicts_operations.py", line 60, in : str [assert-type]'] +Line 60: Unexpected errors ['typeddicts_operations.py:60:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : str [assert-type]'] """ diff --git a/conformance/results/pytype/typeddicts_readonly.toml b/conformance/results/pytype/typeddicts_readonly.toml index 6dc215d71..fdf00b964 100644 --- a/conformance/results/pytype/typeddicts_readonly.toml +++ b/conformance/results/pytype/typeddicts_readonly.toml @@ -1,6 +1,10 @@ conformant = "Unsupported" output = """ -File "typeddicts_readonly.py", line 8, in : typing_extensions.ReadOnly not supported yet [not-supported-yet] +typeddicts_readonly.py:8:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet] + +from typing_extensions import ReadOnly +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -10,5 +14,5 @@ Line 50: Expected 1 errors Line 51: Expected 1 errors Line 60: Expected 1 errors Line 61: Expected 1 errors -Line 8: Unexpected errors ['File "typeddicts_readonly.py", line 8, in : typing_extensions.ReadOnly not supported yet [not-supported-yet]'] +Line 8: Unexpected errors ['typeddicts_readonly.py:8:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet]'] """ diff --git a/conformance/results/pytype/typeddicts_readonly_consistency.toml b/conformance/results/pytype/typeddicts_readonly_consistency.toml index 6d3b171ff..466a0505e 100644 --- a/conformance/results/pytype/typeddicts_readonly_consistency.toml +++ b/conformance/results/pytype/typeddicts_readonly_consistency.toml @@ -1,9 +1,25 @@ conformant = "Unsupported" output = """ -File "typeddicts_readonly_consistency.py", line 8, in : typing_extensions.ReadOnly not supported yet [not-supported-yet] -File "typeddicts_readonly_consistency.py", line 34, in func1: Type annotation for v1 does not match type of assignment [annotation-type-mismatch] -File "typeddicts_readonly_consistency.py", line 35, in func1: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] -File "typeddicts_readonly_consistency.py", line 40, in func1: Type annotation for v5 does not match type of assignment [annotation-type-mismatch] +typeddicts_readonly_consistency.py:8:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet] + +from typing_extensions import ReadOnly +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_consistency.py:34:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for v1 does not match type of assignment [annotation-type-mismatch] + + v1: A1 = b # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +typeddicts_readonly_consistency.py:35:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] + + v2: A1 = c # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +typeddicts_readonly_consistency.py:40:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for v5 does not match type of assignment [annotation-type-mismatch] + + v5: C1 = a # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -13,7 +29,7 @@ Line 81: Expected 1 errors Line 82: Expected 1 errors Line 84: Expected 1 errors Line 85: Expected 1 errors -Line 8: Unexpected errors ['File "typeddicts_readonly_consistency.py", line 8, in : typing_extensions.ReadOnly not supported yet [not-supported-yet]'] -Line 34: Unexpected errors ['File "typeddicts_readonly_consistency.py", line 34, in func1: Type annotation for v1 does not match type of assignment [annotation-type-mismatch]'] -Line 35: Unexpected errors ['File "typeddicts_readonly_consistency.py", line 35, in func1: Type annotation for v2 does not match type of assignment [annotation-type-mismatch]'] +Line 8: Unexpected errors ['typeddicts_readonly_consistency.py:8:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet]'] +Line 34: Unexpected errors ['typeddicts_readonly_consistency.py:34:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Type annotation for v1 does not match type of assignment [annotation-type-mismatch]'] +Line 35: Unexpected errors ['typeddicts_readonly_consistency.py:35:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Type annotation for v2 does not match type of assignment [annotation-type-mismatch]'] """ diff --git a/conformance/results/pytype/typeddicts_readonly_inheritance.toml b/conformance/results/pytype/typeddicts_readonly_inheritance.toml index 83fb06ba8..c8e735abb 100644 --- a/conformance/results/pytype/typeddicts_readonly_inheritance.toml +++ b/conformance/results/pytype/typeddicts_readonly_inheritance.toml @@ -1,22 +1,118 @@ conformant = "Unsupported" output = """ -File "typeddicts_readonly_inheritance.py", line 8, in : typing_extensions.ReadOnly not supported yet [not-supported-yet] -File "typeddicts_readonly_inheritance.py", line 18, in : Invalid base class: NamedDict [base-class-error] -File "typeddicts_readonly_inheritance.py", line 47, in : Invalid base class: AlbumCollection [base-class-error] -File "typeddicts_readonly_inheritance.py", line 47, in : Invalid base class: AlbumCollection [base-class-error] -File "typeddicts_readonly_inheritance.py", line 61, in : Invalid base class: OptionalName [base-class-error] -File "typeddicts_readonly_inheritance.py", line 65, in : Type annotation for d does not match type of assignment [annotation-type-mismatch] -File "typeddicts_readonly_inheritance.py", line 75, in : Invalid base class: OptionalIdent [base-class-error] -File "typeddicts_readonly_inheritance.py", line 83, in : Type annotation for u does not match type of assignment [annotation-type-mismatch] -File "typeddicts_readonly_inheritance.py", line 84, in : Type annotation for u does not match type of assignment [annotation-type-mismatch] -File "typeddicts_readonly_inheritance.py", line 93, in : Invalid base class: F1 [base-class-error] -File "typeddicts_readonly_inheritance.py", line 97, in : Invalid base class: F1 [base-class-error] -File "typeddicts_readonly_inheritance.py", line 101, in : Invalid base class: F1 [base-class-error] -File "typeddicts_readonly_inheritance.py", line 105, in : Invalid base class: F1 [base-class-error] -File "typeddicts_readonly_inheritance.py", line 119, in : Invalid base class: TD_A2 [base-class-error] -File "typeddicts_readonly_inheritance.py", line 119, in : Invalid base class: TD_A2 [base-class-error] -File "typeddicts_readonly_inheritance.py", line 132, in : Invalid base class: TD_B2 [base-class-error] -File "typeddicts_readonly_inheritance.py", line 132, in : Invalid base class: TD_B2 [base-class-error] +typeddicts_readonly_inheritance.py:8:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet] + +from typing_extensions import ReadOnly +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:18:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: NamedDict [base-class-error] + +class Album1(NamedDict): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + name: str +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + year: int +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:47:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: AlbumCollection [base-class-error] + +class RecordShop(AlbumCollection): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + name: str +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + albums: ReadOnly[list[Album1]] # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + alt: ReadOnly[list[str]] # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:47:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: AlbumCollection [base-class-error] + +class RecordShop(AlbumCollection): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + name: str +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + albums: ReadOnly[list[Album1]] # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + alt: ReadOnly[list[str]] # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:61:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: OptionalName [base-class-error] + +class RequiredName(OptionalName): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + name: ReadOnly[Required[str]] # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:65:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for d does not match type of assignment [annotation-type-mismatch] + +d: RequiredName = {} # E +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:75:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: OptionalIdent [base-class-error] + +class User(OptionalIdent): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ident: str # Required, mutable, and not an int +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:83:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for u does not match type of assignment [annotation-type-mismatch] + +u = {"ident": 3} # E +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:84:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for u does not match type of assignment [annotation-type-mismatch] + +u = {} # E +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:93:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: F1 [base-class-error] + +class F3(F1): +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + a: ReadOnly[int] # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:97:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: F1 [base-class-error] + +class F4(F1): +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + a: NotRequired[int] # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:101:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: F1 [base-class-error] + +class F5(F1): +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + b: ReadOnly[Required[int]] # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:105:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: F1 [base-class-error] + +class F6(F1): +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + c: ReadOnly[NotRequired[int]] # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:119:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: TD_A2 [base-class-error] + +class TD_A(TD_A1, TD_A2): ... # E: x is incompatible +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:119:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: TD_A2 [base-class-error] + +class TD_A(TD_A1, TD_A2): ... # E: x is incompatible +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:132:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: TD_B2 [base-class-error] + +class TD_B(TD_B1, TD_B2): ... # E: x is incompatible +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:132:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: TD_B2 [base-class-error] + +class TD_B(TD_B1, TD_B2): ... # E: x is incompatible +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -26,13 +122,13 @@ Line 82: Expected 1 errors Line 94: Expected 1 errors Line 98: Expected 1 errors Line 106: Expected 1 errors -Line 8: Unexpected errors ['File "typeddicts_readonly_inheritance.py", line 8, in : typing_extensions.ReadOnly not supported yet [not-supported-yet]'] -Line 18: Unexpected errors ['File "typeddicts_readonly_inheritance.py", line 18, in : Invalid base class: NamedDict [base-class-error]'] -Line 47: Unexpected errors ['File "typeddicts_readonly_inheritance.py", line 47, in : Invalid base class: AlbumCollection [base-class-error]', 'File "typeddicts_readonly_inheritance.py", line 47, in : Invalid base class: AlbumCollection [base-class-error]'] -Line 61: Unexpected errors ['File "typeddicts_readonly_inheritance.py", line 61, in : Invalid base class: OptionalName [base-class-error]'] -Line 75: Unexpected errors ['File "typeddicts_readonly_inheritance.py", line 75, in : Invalid base class: OptionalIdent [base-class-error]'] -Line 93: Unexpected errors ['File "typeddicts_readonly_inheritance.py", line 93, in : Invalid base class: F1 [base-class-error]'] -Line 97: Unexpected errors ['File "typeddicts_readonly_inheritance.py", line 97, in : Invalid base class: F1 [base-class-error]'] -Line 101: Unexpected errors ['File "typeddicts_readonly_inheritance.py", line 101, in : Invalid base class: F1 [base-class-error]'] -Line 105: Unexpected errors ['File "typeddicts_readonly_inheritance.py", line 105, in : Invalid base class: F1 [base-class-error]'] +Line 8: Unexpected errors ['typeddicts_readonly_inheritance.py:8:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet]'] +Line 18: Unexpected errors ['typeddicts_readonly_inheritance.py:18:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: NamedDict [base-class-error]'] +Line 47: Unexpected errors ['typeddicts_readonly_inheritance.py:47:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: AlbumCollection [base-class-error]', 'typeddicts_readonly_inheritance.py:47:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: AlbumCollection [base-class-error]'] +Line 61: Unexpected errors ['typeddicts_readonly_inheritance.py:61:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: OptionalName [base-class-error]'] +Line 75: Unexpected errors ['typeddicts_readonly_inheritance.py:75:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: OptionalIdent [base-class-error]'] +Line 93: Unexpected errors ['typeddicts_readonly_inheritance.py:93:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: F1 [base-class-error]'] +Line 97: Unexpected errors ['typeddicts_readonly_inheritance.py:97:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: F1 [base-class-error]'] +Line 101: Unexpected errors ['typeddicts_readonly_inheritance.py:101:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: F1 [base-class-error]'] +Line 105: Unexpected errors ['typeddicts_readonly_inheritance.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: F1 [base-class-error]'] """ diff --git a/conformance/results/pytype/typeddicts_readonly_kwargs.toml b/conformance/results/pytype/typeddicts_readonly_kwargs.toml index 891f4fb7b..d9462a9c7 100644 --- a/conformance/results/pytype/typeddicts_readonly_kwargs.toml +++ b/conformance/results/pytype/typeddicts_readonly_kwargs.toml @@ -1,11 +1,23 @@ conformant = "Unsupported" output = """ -File "typeddicts_readonly_kwargs.py", line 8, in : typing.Unpack not supported yet [not-supported-yet] -File "typeddicts_readonly_kwargs.py", line 9, in : typing_extensions.ReadOnly not supported yet [not-supported-yet] -File "typeddicts_readonly_kwargs.py", line 33, in impl: New container type for kwargs does not match type annotation [container-type-mismatch] +typeddicts_readonly_kwargs.py:8:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.Unpack not supported yet [not-supported-yet] + +from typing import Protocol, TypedDict, Unpack +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_kwargs.py:9:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet] + +from typing_extensions import ReadOnly +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_kwargs.py:33:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in impl: New container type for kwargs does not match type annotation [container-type-mismatch] + + kwargs["key1"] = 3 # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 8: Unexpected errors ['File "typeddicts_readonly_kwargs.py", line 8, in : typing.Unpack not supported yet [not-supported-yet]'] -Line 9: Unexpected errors ['File "typeddicts_readonly_kwargs.py", line 9, in : typing_extensions.ReadOnly not supported yet [not-supported-yet]'] +Line 8: Unexpected errors ['typeddicts_readonly_kwargs.py:8:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.Unpack not supported yet [not-supported-yet]'] +Line 9: Unexpected errors ['typeddicts_readonly_kwargs.py:9:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet]'] """ diff --git a/conformance/results/pytype/typeddicts_readonly_update.toml b/conformance/results/pytype/typeddicts_readonly_update.toml index 0ffc04761..081375bd7 100644 --- a/conformance/results/pytype/typeddicts_readonly_update.toml +++ b/conformance/results/pytype/typeddicts_readonly_update.toml @@ -1,9 +1,13 @@ conformant = "Unsupported" output = """ -File "typeddicts_readonly_update.py", line 9, in : typing_extensions.ReadOnly not supported yet [not-supported-yet] +typeddicts_readonly_update.py:9:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet] + +from typing_extensions import ReadOnly +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 23: Expected 1 errors -Line 9: Unexpected errors ['File "typeddicts_readonly_update.py", line 9, in : typing_extensions.ReadOnly not supported yet [not-supported-yet]'] +Line 9: Unexpected errors ['typeddicts_readonly_update.py:9:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet]'] """ diff --git a/conformance/results/pytype/typeddicts_type_consistency.toml b/conformance/results/pytype/typeddicts_type_consistency.toml index 24d50b716..f5be59879 100644 --- a/conformance/results/pytype/typeddicts_type_consistency.toml +++ b/conformance/results/pytype/typeddicts_type_consistency.toml @@ -5,10 +5,26 @@ Incorrectly reports type violation in cases where there is none. Does not report type incompatibility between TypedDict and `dict[str, Any]`. """ output = """ -File "typeddicts_type_consistency.py", line 62, in : Type annotation for a3 does not match type of assignment [annotation-type-mismatch] -File "typeddicts_type_consistency.py", line 65, in : Type annotation for b3 does not match type of assignment [annotation-type-mismatch] -File "typeddicts_type_consistency.py", line 69, in : Type annotation for a3_1 does not match type of assignment [annotation-type-mismatch] -File "typeddicts_type_consistency.py", line 126, in : Type annotation for o2 does not match type of assignment [annotation-type-mismatch] +typeddicts_type_consistency.py:62:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for a3 does not match type of assignment [annotation-type-mismatch] + +a3: A3 = b3 +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +typeddicts_type_consistency.py:65:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for b3 does not match type of assignment [annotation-type-mismatch] + +b3 = a3 # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +typeddicts_type_consistency.py:69:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for a3_1 does not match type of assignment [annotation-type-mismatch] + +a3_1: A3 = {"x": 0, "y": 0} # E +\u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +typeddicts_type_consistency.py:126:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for o2 does not match type of assignment [annotation-type-mismatch] + +o2: Outer1 = {"outer_key": {"inner_key": {"inner_key": 1}}} # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -18,5 +34,5 @@ Line 76: Expected 1 errors Line 77: Expected 1 errors Line 78: Expected 1 errors Line 82: Expected 1 errors -Line 62: Unexpected errors ['File "typeddicts_type_consistency.py", line 62, in : Type annotation for a3 does not match type of assignment [annotation-type-mismatch]'] +Line 62: Unexpected errors ['typeddicts_type_consistency.py:62:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for a3 does not match type of assignment [annotation-type-mismatch]'] """ diff --git a/conformance/results/pytype/typeddicts_usage.toml b/conformance/results/pytype/typeddicts_usage.toml index 746ab3414..09e50f725 100644 --- a/conformance/results/pytype/typeddicts_usage.toml +++ b/conformance/results/pytype/typeddicts_usage.toml @@ -4,9 +4,21 @@ Does not report errant use of TypedDict in `isinstance` call. Does not reject use of TypedDict as TypeVar bound. """ output = """ -File "typeddicts_usage.py", line 23, in : TypedDict Movie does not contain key director [typed-dict-error] -File "typeddicts_usage.py", line 24, in : Type annotation for key year in TypedDict Movie does not match type of assignment [annotation-type-mismatch] -File "typeddicts_usage.py", line 28, in : Type annotation for movie2 does not match type of assignment [annotation-type-mismatch] +typeddicts_usage.py:23:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : TypedDict Movie does not contain key director [typed-dict-error] + +movie["director"] = "Ridley Scott" # E: invalid key 'director' +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_usage.py:24:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for key year in TypedDict Movie does not match type of assignment [annotation-type-mismatch] + +movie["year"] = "1982" # E: invalid value type ("int" expected) +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_usage.py:28:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for movie2 does not match type of assignment [annotation-type-mismatch] + +movie2: Movie = {"title": "Blade Runner", "year": 1982} # E +\u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index a03e3ca2e..19259c3aa 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ -version = "pytype 2024.04.11" -test_duration = 35.2 +version = "pytype 2024.09.13" +test_duration = 32.8 diff --git a/conformance/results/results.html b/conformance/results/results.html index f6bfa00cb..cffa1e37f 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -158,17 +158,17 @@

Python Type System Conformance Test Results

- - - - + @@ -608,7 +608,7 @@

Python Type System Conformance Test Results

- + @@ -647,7 +647,7 @@

Python Type System Conformance Test Results

- + diff --git a/conformance/src/type_checker.py b/conformance/src/type_checker.py index d4404d12d..c8955c0fa 100644 --- a/conformance/src/type_checker.py +++ b/conformance/src/type_checker.py @@ -74,10 +74,22 @@ def install(self) -> bool: pass try: + # Uninstall any existing version if present. run( - [sys.executable, "-m", "pip", "install", "mypy", "--upgrade"], + [sys.executable, "-m", "pip", "uninstall", "mypy", "-y"], check=True, ) + + # Install the latest version. + run( + [sys.executable, "-m", "pip", "install", "mypy"], + check=True, + ) + + # Run "mypy --version" to ensure that it's installed and to work + # around timing issues caused by malware scanners on some systems. + self.get_version() + return True except CalledProcessError: print("Unable to install mypy") @@ -142,9 +154,15 @@ def name(self) -> str: def install(self) -> bool: try: - # Install the Python wrapper if it's not installed. + # Uninstall any old version if present. + run( + [sys.executable, "-m", "pip", "uninstall", "pyright", "-y"], + check=True, + ) + + # Install the latest version. run( - [sys.executable, "-m", "pip", "install", "pyright", "--upgrade"], + [sys.executable, "-m", "pip", "install", "pyright"], check=True, ) @@ -214,8 +232,15 @@ def install(self) -> bool: pass try: + # Uninstall any existing version if present. run( - [sys.executable, "-m", "pip", "install", "pyre-check", "--upgrade"], + [sys.executable, "-m", "pip", "uninstall", "pyre-check", "-y"], + check=True, + ) + + # Install the latest version. + run( + [sys.executable, "-m", "pip", "install", "pyre-check"], check=True, ) @@ -270,10 +295,18 @@ def name(self) -> str: def install(self) -> bool: try: + # Uninstall any existing version if present. run( - [sys.executable, "-m", "pip", "install", "pytype", "--upgrade"], + [sys.executable, "-m", "pip", "uninstall", "pytype", "-y"], check=True, ) + + # Install the latest version. + run( + [sys.executable, "-m", "pip", "install", "pytype"], + check=True, + ) + return True except CalledProcessError: print("Unable to install pytype on this platform") @@ -331,7 +364,7 @@ def __init__(self, err: pytype_errors.Error) -> None: self._err = err def __lt__(self, other: "ErrorSorter", /) -> bool: - lineno_diff = self._err.lineno - other._err.lineno + lineno_diff = self._err.line - other._err.line if lineno_diff != 0: return lineno_diff < 0 return other._err.message < self._err.message @@ -339,7 +372,7 @@ def __lt__(self, other: "ErrorSorter", /) -> bool: def __eq__(self, other: object, /) -> bool: return ( isinstance(other, ErrorSorter) - and self._err.lineno == other._err.lineno + and self._err.line == other._err.line and other._err.message == self._err.message ) @@ -350,16 +383,13 @@ def __eq__(self, other: object, /) -> bool: return "\n".join(map(str, errors)) + "\n" def parse_errors(self, output: Sequence[str]) -> dict[int, list[str]]: - # File "narrowing_typeguard.py", line 128, in : Function takes_callable_str was called with the wrong arguments [wrong-arg-types] - # File "directives_type_ignore.py", line 11: Stray type comment: ignore - additional stuff [ignored-type-comment]' + # annotations_forward_refs.py:103:1: unexpected indent [python-compiler-error] line_to_errors: dict[int, list[str]] = {} for line in output: - if '.py", line ' not in line: - continue - match = re.search(r"^File \"[^\"]+?\", line (\d+)", line) - assert match is not None, f"Failed to parse line number from: {line!r}" - lineno = int(match.group(1)) - line_to_errors.setdefault(int(lineno), []).append(line) + match = re.search(r"^[a-zA-Z0-9_]+.py:(\d+):(\d+): ", line) + if match is not None: + lineno = int(match.group(1)) + line_to_errors.setdefault(int(lineno), []).append(line) return line_to_errors diff --git a/conformance/tests/generics_syntax_infer_variance.py b/conformance/tests/generics_syntax_infer_variance.py index f19b6a181..7df2e64e8 100644 --- a/conformance/tests/generics_syntax_infer_variance.py +++ b/conformance/tests/generics_syntax_infer_variance.py @@ -51,8 +51,15 @@ class ShouldBeCovariant4(Generic[T]): x: T -vo4_1: ShouldBeCovariant4[float] = ShouldBeCovariant4[int](1) # OK -vo4_4: ShouldBeCovariant4[int] = ShouldBeCovariant4[float](1.0) # E +# This test is problematic as of Python 3.13 because of the +# newly synthesized "__replace__" method, which causes the type +# variable to be inferred as invariant rather than covariant. +# See https://github.com/python/mypy/issues/17623#issuecomment-2266312738 +# for details. Until we sort this out, we'll leave this test commented +# out. + +# vo4_1: ShouldBeCovariant4[float] = ShouldBeCovariant4[int](1) # OK +# vo4_4: ShouldBeCovariant4[int] = ShouldBeCovariant4[float](1.0) # E class ShouldBeCovariant5(Generic[T]):
 
mypy 1.11.1
-
13.2sec
+
mypy 1.11.2
+
1.9sec
pyright 1.1.374
-
1.5sec
+
pyright 1.1.384
+
1.3sec
pyre 0.9.22
-
5.4sec
+
4.5sec
pytype 2024.04.11
-
35.2sec
+
pytype 2024.09.13
+
32.8sec
@@ -551,7 +551,7 @@

Python Type System Conformance Test Results

     protocols_generic
Partial

Fails protocol matching when method-scoped TypeVar is used in protocol.

Pass
Partial

Incorrectly generates type violation for protocol that uses method-scoped type variables.

Partial

Does not reject the use of Protocol and Generic together as base classes.

Does not detect protocol mismatch when method-scoped TypeVar is used in protocol.

Partial

Does not correctly enforce contravariance in protocol type compatibility tests.

Does not correctly enforce invariance in protocol type compatibility tests.

Does not detect protocol mismatch when method-scoped TypeVar is used in protocol.

     callables_kwargs PassPass
Partial

Incorrectly handles assert_type for unpacked TypedDict.

Unsupported

Does not understand Unpack in the context of **kwargs annotation.

Unsupported

Does not understand Unpack in the context of **kwargs annotation.

     constructors_call_type
Partial

Does not validate call to custom metaclass __call__ method through type[T].

Pass
Partial

Fails to report error when passing incorrect arguments for metaclass __call__ method.

Pass
Partial

Does not validate call to custom metaclass __call__ method through type[T].