Skip to content

Commit 5330f2c

Browse files
authored
Update ty results for v0.0.26 (#2228)
1 parent 755292c commit 5330f2c

20 files changed

+122
-160
lines changed

conformance/results/results.html

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ <h3>Python Type System Conformance Test Results</h3>
180180
</th>
181181
<th class='tc-header'><div class='tc-name'>pyrefly 0.56.0</div>
182182
</th>
183-
<th class='tc-header'><div class='tc-name'>ty 0.0.22</div>
183+
<th class='tc-header'><div class='tc-name'>ty 0.0.26</div>
184184
</th>
185185
</tr>
186186
<tr><th class="column" colspan="6">
@@ -205,7 +205,7 @@ <h3>Python Type System Conformance Test Results</h3>
205205
<th class="column col2 conformant">Pass</th>
206206
<th class="column col2 conformant">Pass</th>
207207
<th class="column col2 conformant">Pass</th>
208-
<th class="column col2 not-conformant">Unsupported</th>
208+
<th class="column col2 conformant">Pass</th>
209209
</tr>
210210
<tr><th class="column col1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;annotations_methods</th>
211211
<th class="column col2 conformant"><div class="hover-text">Pass*<span class="tooltip-text" id="bottom"><p>Type evaluation differs from other type checkers because of ambiguity in the spec related to method bindings.</p></span></div></th>
@@ -312,21 +312,21 @@ <h3>Python Type System Conformance Test Results</h3>
312312
<th class="column col2 conformant">Pass</th>
313313
<th class="column col2 conformant">Pass</th>
314314
<th class="column col2 conformant">Pass</th>
315-
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Does not reject using a bare `ParamSpec` as a type alias value.</p><p>Does not support `Concatenate`.</p></span></div></th>
315+
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Does not reject using a bare `ParamSpec` as a type alias value.</p></span></div></th>
316316
</tr>
317317
<tr><th class="column col1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;generics_paramspec_components</th>
318318
<th class="column col2 conformant">Pass</th>
319319
<th class="column col2 conformant">Pass</th>
320320
<th class="column col2 conformant">Pass</th>
321321
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Does not reject usage of args/kwargs for out-of-scope ParamSpec</p></span></div></th>
322-
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Incorrectly allows using `*args: P.args` and `**kwargs: P.kwargs` when `P` has not been put into scope by any other parameter annotation or enclosing scope.</p><p>Does not support `Concatenate`.</p></span></div></th>
322+
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Incorrectly allows using `*args: P.args` and `**kwargs: P.kwargs` when `P` has not been put into scope by any other parameter annotation or enclosing scope.</p></span></div></th>
323323
</tr>
324324
<tr><th class="column col1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;generics_paramspec_semantics</th>
325325
<th class="column col2 conformant">Pass</th>
326326
<th class="column col2 conformant"><div class="hover-text">Pass*<span class="tooltip-text" id="bottom"><p>Constraint solver doesn't find common type for two signatures captured by a single ParamSpec (allowed).</p></span></div></th>
327327
<th class="column col2 conformant">Pass</th>
328328
<th class="column col2 conformant">Pass</th>
329-
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Does not support `Concatenate`.</p></span></div></th>
329+
<th class="column col2 conformant">Pass</th>
330330
</tr>
331331
<tr><th class="column col1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;generics_paramspec_specialization</th>
332332
<th class="column col2 conformant">Pass</th>
@@ -375,7 +375,7 @@ <h3>Python Type System Conformance Test Results</h3>
375375
<th class="column col2 conformant">Pass</th>
376376
<th class="column col2 conformant">Pass</th>
377377
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Does not implement some restrictions on where Self can be used</p></span></div></th>
378-
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Does not reject `Self` used in a return annotation when `self` is annotated using another type variable.</p><p>Does not reject `Self` used in staticmethods or metaclasses.</p></span></div></th>
378+
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Does not reject `Self` used in a return annotation when `self` is annotated using another type variable.</p></span></div></th>
379379
</tr>
380380
<tr><th class="column col1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;generics_syntax_compatibility</th>
381381
<th class="column col2 conformant">Pass</th>
@@ -531,14 +531,14 @@ <h3>Python Type System Conformance Test Results</h3>
531531
<th class="column col2 conformant">Pass</th>
532532
<th class="column col2 conformant">Pass</th>
533533
<th class="column col2 conformant">Pass</th>
534-
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>`Concatenate` in type aliases is currently unsupported</p></span></div></th>
534+
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Does not emit a diagnostic on an invalid use of a variable as the right-hand side of a type alias.</p><p>Does not emit a diagnostic if a type alias to a union, in which every element of the union is implicitly specialized with `Unknown`, is invalidly specialized again.</p></span></div></th>
535535
</tr>
536536
<tr><th class="column col1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;aliases_implicit</th>
537537
<th class="column col2 conformant">Pass</th>
538538
<th class="column col2 conformant">Pass</th>
539539
<th class="column col2 conformant">Pass</th>
540540
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Does not reject invalid syntax in implicit type aliases.</p></span></div></th>
541-
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Does not reject variables with `Any` or `Unknown` types when used as implicit type aliases.</p><p>Does not support `Concatenate` in type aliases.</p></span></div></th>
541+
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Does not reject variables with `Any` or `Unknown` types when used as implicit type aliases.</p><p>Falls short on full syntactic validation of type aliases.</p></span></div></th>
542542
</tr>
543543
<tr><th class="column col1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;aliases_newtype</th>
544544
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>`NewType`s are incorrectly considered to be classes.</p></span></div></th>
@@ -694,7 +694,7 @@ <h3>Python Type System Conformance Test Results</h3>
694694
<th class="column col2 conformant">Pass</th>
695695
<th class="column col2 conformant">Pass</th>
696696
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Parameter names are lost when resolving ParamSpec</p></span></div></th>
697-
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Does not support `Concatenate`.</p><p>Infers a callback protocol as being a gradual type if the callback has signature `__call__[T](self, *args: T, **kwargs: T)` and `T` has been explicitly specialized to `Any`.</p><p>Does not infer a callback protocol as being a gradual type if the callback has signature `__call__(self, a: int, /, *args: Any, **kwargs: Any)`.</p></span></div></th>
697+
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Infers a callback protocol as being a gradual type if the callback has signature `__call__[T](self, *args: T, **kwargs: T)` and `T` has been explicitly specialized to `Any`.</p></span></div></th>
698698
</tr>
699699
<tr><th class="column col1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;callables_kwargs</th>
700700
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Allows callable without kwargs to be assigned to callable with unpacked kwargs</p></span></div></th>
@@ -895,7 +895,7 @@ <h3>Python Type System Conformance Test Results</h3>
895895
<th class="column col2 conformant">Pass</th>
896896
<th class="column col2 conformant">Pass</th>
897897
<th class="column col2 conformant">Pass</th>
898-
<th class="column col2 not-conformant">Unsupported</th>
898+
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Does not pass all assertions in the test file, due to limitations in ty's generics solver.</p><p></p><p>Incorrectly rejects a converter of `dict` combined with a default of `()`.</p><p>Incorrectly rejects passing a sequence of two-element string tuples to the `dict` constructor.</p></span></div></th>
899899
</tr>
900900
<tr><th class="column col1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dataclasses_transform_field</th>
901901
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Does not properly handle field constructor that has default value for `kw_only` or `init` parameter.</p></span></div></th>
@@ -1003,7 +1003,7 @@ <h3>Python Type System Conformance Test Results</h3>
10031003
<th class="column col2 conformant">Pass</th>
10041004
<th class="column col2 conformant">Pass</th>
10051005
<th class="column col2 conformant">Pass</th>
1006-
<th class="column col2 not-conformant">Unsupported</th>
1006+
<th class="column col2 conformant">Pass</th>
10071007
</tr>
10081008
<tr><th class="column col1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;typeddicts_required</th>
10091009
<th class="column col2 conformant">Pass</th>
@@ -1186,14 +1186,14 @@ <h3>Python Type System Conformance Test Results</h3>
11861186
<th class="column col2 conformant">Pass</th>
11871187
<th class="column col2 conformant">Pass</th>
11881188
<th class="column col2 conformant">Pass</th>
1189-
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Attempts to detect some errors even in blocks it determines to be unreachable, including in `if not TYPE_CHECKING` blocks.</p></span></div></th>
1189+
<th class="column col2 conformant">Pass</th>
11901190
</tr>
11911191
<tr><th class="column col1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;directives_type_ignore</th>
11921192
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Does not honor "# type: ignore" comment if comment includes additional text.</p></span></div></th>
11931193
<th class="column col2 conformant">Pass</th>
11941194
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Does not honor "# type: ignore" comment if comment includes additional text.</p></span></div></th>
11951195
<th class="column col2 conformant">Pass</th>
1196-
<th class="column col2 conformant">Pass</th>
1196+
<th class="column col2 partially-conformant"><div class="hover-text">Partial<span class="tooltip-text" id="bottom"><p>Treats `# type: ignore[error-code]` as only ignoring errors that match the error code `error-code`.</p></span></div></th>
11971197
</tr>
11981198
<tr><th class="column col1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;directives_type_ignore_file1</th>
11991199
<th class="column col2 conformant">Pass</th>

conformance/results/ty/aliases_explicit.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
conformance_automated = "Fail"
22
conformant = "Partial"
3-
notes = "`Concatenate` in type aliases is currently unsupported"
3+
notes = """
4+
Does not emit a diagnostic on an invalid use of a variable as the right-hand side of a type alias.
5+
Does not emit a diagnostic if a type alias to a union, in which every element of the union is implicitly specialized with `Unknown`, is invalidly specialized again.
6+
"""
47
errors_diff = """
58
Line 87: Expected 1 errors
69
Line 100: Expected 1 errors
7-
Line 57: Unexpected errors ['aliases_explicit.py:57:5: error[type-assertion-failure] Type `Unknown` does not match asserted type `(int, str, str, /) -> None`']
810
"""
911
output = """
10-
aliases_explicit.py:57:5: error[type-assertion-failure] Type `Unknown` does not match asserted type `(int, str, str, /) -> None`
1112
aliases_explicit.py:67:9: error[not-subscriptable] Cannot subscript non-generic type `<types.UnionType special-form 'int | None'>`
1213
aliases_explicit.py:68:9: error[not-subscriptable] Cannot subscript non-generic type `<class 'list[int | None]'>`
1314
aliases_explicit.py:69:29: error[invalid-type-arguments] Too many type arguments: expected 1, got 2

conformance/results/ty/aliases_implicit.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,16 @@ conformance_automated = "Fail"
22
conformant = "Partial"
33
notes = """
44
Does not reject variables with `Any` or `Unknown` types when used as implicit type aliases.
5-
Does not support `Concatenate` in type aliases.
5+
Falls short on full syntactic validation of type aliases.
66
"""
77
errors_diff = """
88
Line 106: Expected 1 errors
99
Line 111: Expected 1 errors
1010
Line 112: Expected 1 errors
1111
Line 113: Expected 1 errors
1212
Line 117: Expected 1 errors
13-
Line 68: Unexpected errors ['aliases_implicit.py:68:5: error[type-assertion-failure] Type `Unknown` does not match asserted type `(int, str, str, /) -> None`']
1413
"""
1514
output = """
16-
aliases_implicit.py:68:5: error[type-assertion-failure] Type `Unknown` does not match asserted type `(int, str, str, /) -> None`
1715
aliases_implicit.py:76:9: error[not-subscriptable] Cannot subscript non-generic type `<types.UnionType special-form 'int | None'>`
1816
aliases_implicit.py:77:9: error[not-subscriptable] Cannot subscript non-generic type `<class 'list[int | None]'>`
1917
aliases_implicit.py:78:29: error[invalid-type-arguments] Too many type arguments: expected 1, got 2
Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
conformance_automated = "Fail"
2-
conformant = "Unsupported"
1+
conformance_automated = "Pass"
32
errors_diff = """
4-
Line 51: Expected 1 errors
5-
Line 54: Expected 1 errors
6-
Line 57: Expected 1 errors
7-
Line 66: Expected 1 errors
8-
Line 75: Expected 1 errors
9-
Line 118: Expected 1 errors
10-
Line 119: Expected 1 errors
11-
Line 135: Expected 1 errors
123
"""
134
output = """
5+
annotations_generators.py:51:21: error[invalid-return-type] Function can implicitly return `None`, which is not assignable to return type `C`
6+
annotations_generators.py:54:16: error[invalid-return-type] Return type does not match returned value: expected `C`, found `Literal[False]`
7+
annotations_generators.py:57:15: error[invalid-yield] Yield type `Literal[3]` does not match annotated yield type `A`
8+
annotations_generators.py:66:15: error[invalid-yield] Yield type `Literal[3]` does not match annotated yield type `A`
9+
annotations_generators.py:75:11: error[invalid-yield] Yield type `B` does not match annotated yield type `A`
1410
annotations_generators.py:86:21: error[invalid-return-type] Return type does not match returned value: expected `int`, found `types.GeneratorType`
1511
annotations_generators.py:91:27: error[invalid-return-type] Return type does not match returned value: expected `int`, found `types.AsyncGeneratorType`
12+
annotations_generators.py:118:16: error[invalid-yield] Yield type `A` does not match annotated yield type `B`
13+
annotations_generators.py:119:16: error[invalid-yield] Yield type `int` does not match annotated yield type `B`
14+
annotations_generators.py:135:16: error[invalid-yield] Send type `int` does not match annotated send type `str`
1615
"""
Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
11
conformance_automated = "Fail"
22
conformant = "Partial"
33
notes = """
4-
Does not support `Concatenate`.
54
Infers a callback protocol as being a gradual type if the callback has signature `__call__[T](self, *args: T, **kwargs: T)` and `T` has been explicitly specialized to `Any`.
6-
Does not infer a callback protocol as being a gradual type if the callback has signature `__call__(self, a: int, /, *args: Any, **kwargs: Any)`.
75
"""
86
errors_diff = """
9-
Line 91: Expected 1 errors
10-
Line 93: Expected 1 errors
117
Line 159: Expected 1 errors
12-
Line 172: Expected 1 errors
13-
Line 187: Expected 1 errors
14-
Line 189: Expected 1 errors
15-
Line 157: Unexpected errors ['callables_annotation.py:157:20: error[invalid-assignment] Object of type `Proto7` is not assignable to `Proto6`']
168
"""
179
output = """
1810
callables_annotation.py:25:5: error[missing-argument] No argument provided for required parameter 2
@@ -29,5 +21,9 @@ callables_annotation.py:57:18: error[invalid-type-form] List literals are not al
2921
callables_annotation.py:58:5: error[invalid-type-form] Special form `typing.Callable` expected exactly two arguments (parameter types and return type)
3022
callables_annotation.py:58:14: error[invalid-type-form] The first argument to `Callable` must be either a list of types, ParamSpec, Concatenate, or `...`
3123
callables_annotation.py:59:14: error[invalid-type-form] `[...]` is not a valid parameter list for `Callable`: Did you mean `Callable[..., int]`?
32-
callables_annotation.py:157:20: error[invalid-assignment] Object of type `Proto7` is not assignable to `Proto6`
24+
callables_annotation.py:91:7: error[invalid-assignment] Object of type `def test_cb2() -> str` is not assignable to `(int, /, *args: Any, **kwargs: Any) -> str`
25+
callables_annotation.py:93:7: error[invalid-assignment] Object of type `def test_cb4(*, a: int) -> str` is not assignable to `(int, /, *args: Any, **kwargs: Any) -> str`
26+
callables_annotation.py:172:26: error[invalid-assignment] Object of type `() -> str` is not assignable to `(int, /, *args: Any, **kwargs: Any) -> str`
27+
callables_annotation.py:187:48: error[invalid-assignment] Object of type `(int, str, /) -> str` is not assignable to `(str, /, *args: Any, **kwargs: Any) -> str`
28+
callables_annotation.py:189:32: error[invalid-assignment] Object of type `(int, str, /) -> str` is not assignable to `(str, /, *args: Any, **kwargs: Any) -> str`
3329
"""

0 commit comments

Comments
 (0)