Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing return type to generic_syntax_infer_variance.py #1871

Merged
merged 2 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions conformance/results/mypy/generics_syntax_infer_variance.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ generics_syntax_infer_variance.py:86: error: The type "type[ShouldBeCovariant6]"
generics_syntax_infer_variance.py:89: error: Free type variable expected in Generic[...] [misc]
generics_syntax_infer_variance.py:90: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]
generics_syntax_infer_variance.py:90: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
generics_syntax_infer_variance.py:94: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]
generics_syntax_infer_variance.py:94: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
generics_syntax_infer_variance.py:98: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]
generics_syntax_infer_variance.py:98: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
generics_syntax_infer_variance.py:102: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg]
Expand Down Expand Up @@ -121,6 +123,7 @@ Line 81: Unexpected errors ['generics_syntax_infer_variance.py:81: error: Variab
Line 85: Unexpected errors ['generics_syntax_infer_variance.py:85: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:85: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc]']
Line 89: Unexpected errors ['generics_syntax_infer_variance.py:89: error: Free type variable expected in Generic[...] [misc]']
Line 90: Unexpected errors ['generics_syntax_infer_variance.py:90: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]']
Line 94: Unexpected errors ['generics_syntax_infer_variance.py:94: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]']
Line 98: Unexpected errors ['generics_syntax_infer_variance.py:98: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]']
Line 106: Unexpected errors ['generics_syntax_infer_variance.py:106: error: Free type variable expected in Generic[...] [misc]']
Line 107: Unexpected errors ['generics_syntax_infer_variance.py:107: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]']
Expand Down
2 changes: 1 addition & 1 deletion conformance/results/mypy/version.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = "mypy 1.13.0"
test_duration = 1.5
test_duration = 2.6
2 changes: 1 addition & 1 deletion conformance/results/pyre/version.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = "pyre 0.9.22"
test_duration = 4.4
test_duration = 6.5
2 changes: 1 addition & 1 deletion conformance/results/pyright/version.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = "pyright 1.1.386"
test_duration = 1.2
test_duration = 1.9
7 changes: 3 additions & 4 deletions conformance/results/pytype/specialtypes_never.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ specialtypes_never.py:11:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in <mod
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]
specialtypes_never.py:21:5: \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
\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]

Expand Down Expand Up @@ -40,7 +39,7 @@ errors_diff = """
Line 19: Expected 1 errors
Line 105: Expected 1 errors
Line 11: Unexpected errors ['specialtypes_never.py:11:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in <module>: argument "covariant" to TypeVar not supported yet [not-supported-yet]']
Line 21: Unexpected errors ['specialtypes_never.py:21:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: bad return type [bad-return-type]']
Line 21: Unexpected errors ['specialtypes_never.py:21:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: bad return type [bad-return-type]']
Line 68: Unexpected errors ['specialtypes_never.py:68:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Type annotation for v1 does not match type of assignment [annotation-type-mismatch]']
Line 69: Unexpected errors ['specialtypes_never.py:69:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Type annotation for v2 does not match type of assignment [annotation-type-mismatch]']
Line 70: Unexpected errors ['specialtypes_never.py:70:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Type annotation for v3 does not match type of assignment [annotation-type-mismatch]']
Expand Down
2 changes: 1 addition & 1 deletion conformance/results/pytype/version.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = "pytype 2024.10.11"
test_duration = 33.1
test_duration = 50.2
8 changes: 4 additions & 4 deletions conformance/results/results.html
Original file line number Diff line number Diff line change
Expand Up @@ -159,16 +159,16 @@ <h3>Python Type System Conformance Test Results</h3>
<div class="table_container"><table><tbody>
<tr><th class="col1">&nbsp;</th>
<th class='tc-header'><div class='tc-name'>mypy 1.13.0</div>
<div class='tc-time'>1.5sec</div>
<div class='tc-time'>2.6sec</div>
</th>
<th class='tc-header'><div class='tc-name'>pyright 1.1.386</div>
<div class='tc-time'>1.2sec</div>
<div class='tc-time'>1.9sec</div>
</th>
<th class='tc-header'><div class='tc-name'>pyre 0.9.22</div>
<div class='tc-time'>4.4sec</div>
<div class='tc-time'>6.5sec</div>
</th>
<th class='tc-header'><div class='tc-name'>pytype 2024.10.11</div>
<div class='tc-time'>33.1sec</div>
<div class='tc-time'>50.2sec</div>
</th>
</tr>
<tr><th class="column" colspan="5">
Expand Down
2 changes: 1 addition & 1 deletion conformance/tests/generics_syntax_infer_variance.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def __init__(self, value: T) -> None:
self._value = value

@property
def value(self):
def value(self) -> T:
return self._value

@value.setter
Expand Down