Skip to content
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
26 changes: 13 additions & 13 deletions conformance/results/results.html
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ <h3>Python Type System Conformance Test Results</h3>
</th>
<th class='tc-header'><div class='tc-name'>pyrefly 0.56.0</div>
</th>
<th class='tc-header'><div class='tc-name'>ty 0.0.22</div>
<th class='tc-header'><div class='tc-name'>ty 0.0.26</div>
</th>
</tr>
<tr><th class="column" colspan="6">
Expand All @@ -205,7 +205,7 @@ <h3>Python Type System Conformance Test Results</h3>
<th class="column col2 conformant">Pass</th>
<th class="column col2 conformant">Pass</th>
<th class="column col2 conformant">Pass</th>
<th class="column col2 not-conformant">Unsupported</th>
<th class="column col2 conformant">Pass</th>
</tr>
<tr><th class="column col1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;annotations_methods</th>
<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>
Expand Down Expand Up @@ -312,21 +312,21 @@ <h3>Python Type System Conformance Test Results</h3>
<th class="column col2 conformant">Pass</th>
<th class="column col2 conformant">Pass</th>
<th class="column col2 conformant">Pass</th>
<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>
<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>
</tr>
<tr><th class="column col1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;generics_paramspec_components</th>
<th class="column col2 conformant">Pass</th>
<th class="column col2 conformant">Pass</th>
<th class="column col2 conformant">Pass</th>
<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>
<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>
<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>
</tr>
<tr><th class="column col1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;generics_paramspec_semantics</th>
<th class="column col2 conformant">Pass</th>
<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>
<th class="column col2 conformant">Pass</th>
<th class="column col2 conformant">Pass</th>
<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>
<th class="column col2 conformant">Pass</th>
</tr>
<tr><th class="column col1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;generics_paramspec_specialization</th>
<th class="column col2 conformant">Pass</th>
Expand Down Expand Up @@ -375,7 +375,7 @@ <h3>Python Type System Conformance Test Results</h3>
<th class="column col2 conformant">Pass</th>
<th class="column col2 conformant">Pass</th>
<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>
<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>
<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>
</tr>
<tr><th class="column col1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;generics_syntax_compatibility</th>
<th class="column col2 conformant">Pass</th>
Expand Down Expand Up @@ -531,14 +531,14 @@ <h3>Python Type System Conformance Test Results</h3>
<th class="column col2 conformant">Pass</th>
<th class="column col2 conformant">Pass</th>
<th class="column col2 conformant">Pass</th>
<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>
<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>
</tr>
<tr><th class="column col1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;aliases_implicit</th>
<th class="column col2 conformant">Pass</th>
<th class="column col2 conformant">Pass</th>
<th class="column col2 conformant">Pass</th>
<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>
<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>
<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>
</tr>
<tr><th class="column col1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;aliases_newtype</th>
<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>
Expand Down Expand Up @@ -694,7 +694,7 @@ <h3>Python Type System Conformance Test Results</h3>
<th class="column col2 conformant">Pass</th>
<th class="column col2 conformant">Pass</th>
<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>
<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>
<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>
</tr>
<tr><th class="column col1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;callables_kwargs</th>
<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>
Expand Down Expand Up @@ -895,7 +895,7 @@ <h3>Python Type System Conformance Test Results</h3>
<th class="column col2 conformant">Pass</th>
<th class="column col2 conformant">Pass</th>
<th class="column col2 conformant">Pass</th>
<th class="column col2 not-conformant">Unsupported</th>
<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>
</tr>
<tr><th class="column col1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dataclasses_transform_field</th>
<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>
Expand Down Expand Up @@ -1003,7 +1003,7 @@ <h3>Python Type System Conformance Test Results</h3>
<th class="column col2 conformant">Pass</th>
<th class="column col2 conformant">Pass</th>
<th class="column col2 conformant">Pass</th>
<th class="column col2 not-conformant">Unsupported</th>
<th class="column col2 conformant">Pass</th>
</tr>
<tr><th class="column col1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;typeddicts_required</th>
<th class="column col2 conformant">Pass</th>
Expand Down Expand Up @@ -1186,14 +1186,14 @@ <h3>Python Type System Conformance Test Results</h3>
<th class="column col2 conformant">Pass</th>
<th class="column col2 conformant">Pass</th>
<th class="column col2 conformant">Pass</th>
<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>
<th class="column col2 conformant">Pass</th>
</tr>
<tr><th class="column col1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;directives_type_ignore</th>
<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>
<th class="column col2 conformant">Pass</th>
<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>
<th class="column col2 conformant">Pass</th>
<th class="column col2 conformant">Pass</th>
<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>
</tr>
<tr><th class="column col1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;directives_type_ignore_file1</th>
<th class="column col2 conformant">Pass</th>
Expand Down
7 changes: 4 additions & 3 deletions conformance/results/ty/aliases_explicit.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
conformance_automated = "Fail"
conformant = "Partial"
notes = "`Concatenate` in type aliases is currently unsupported"
notes = """
Does not emit a diagnostic on an invalid use of a variable as the right-hand side of a type alias.
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.
"""
errors_diff = """
Line 87: Expected 1 errors
Line 100: Expected 1 errors
Line 57: Unexpected errors ['aliases_explicit.py:57:5: error[type-assertion-failure] Type `Unknown` does not match asserted type `(int, str, str, /) -> None`']
"""
output = """
aliases_explicit.py:57:5: error[type-assertion-failure] Type `Unknown` does not match asserted type `(int, str, str, /) -> None`
aliases_explicit.py:67:9: error[not-subscriptable] Cannot subscript non-generic type `<types.UnionType special-form 'int | None'>`
aliases_explicit.py:68:9: error[not-subscriptable] Cannot subscript non-generic type `<class 'list[int | None]'>`
aliases_explicit.py:69:29: error[invalid-type-arguments] Too many type arguments: expected 1, got 2
Expand Down
4 changes: 1 addition & 3 deletions conformance/results/ty/aliases_implicit.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@ conformance_automated = "Fail"
conformant = "Partial"
notes = """
Does not reject variables with `Any` or `Unknown` types when used as implicit type aliases.
Does not support `Concatenate` in type aliases.
Falls short on full syntactic validation of type aliases.
"""
errors_diff = """
Line 106: Expected 1 errors
Line 111: Expected 1 errors
Line 112: Expected 1 errors
Line 113: Expected 1 errors
Line 117: Expected 1 errors
Line 68: Unexpected errors ['aliases_implicit.py:68:5: error[type-assertion-failure] Type `Unknown` does not match asserted type `(int, str, str, /) -> None`']
"""
output = """
aliases_implicit.py:68:5: error[type-assertion-failure] Type `Unknown` does not match asserted type `(int, str, str, /) -> None`
aliases_implicit.py:76:9: error[not-subscriptable] Cannot subscript non-generic type `<types.UnionType special-form 'int | None'>`
aliases_implicit.py:77:9: error[not-subscriptable] Cannot subscript non-generic type `<class 'list[int | None]'>`
aliases_implicit.py:78:29: error[invalid-type-arguments] Too many type arguments: expected 1, got 2
Expand Down
19 changes: 9 additions & 10 deletions conformance/results/ty/annotations_generators.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
conformance_automated = "Fail"
conformant = "Unsupported"
conformance_automated = "Pass"
errors_diff = """
Line 51: Expected 1 errors
Line 54: Expected 1 errors
Line 57: Expected 1 errors
Line 66: Expected 1 errors
Line 75: Expected 1 errors
Line 118: Expected 1 errors
Line 119: Expected 1 errors
Line 135: Expected 1 errors
"""
output = """
annotations_generators.py:51:21: error[invalid-return-type] Function can implicitly return `None`, which is not assignable to return type `C`
annotations_generators.py:54:16: error[invalid-return-type] Return type does not match returned value: expected `C`, found `Literal[False]`
annotations_generators.py:57:15: error[invalid-yield] Yield type `Literal[3]` does not match annotated yield type `A`
annotations_generators.py:66:15: error[invalid-yield] Yield type `Literal[3]` does not match annotated yield type `A`
annotations_generators.py:75:11: error[invalid-yield] Yield type `B` does not match annotated yield type `A`
annotations_generators.py:86:21: error[invalid-return-type] Return type does not match returned value: expected `int`, found `types.GeneratorType`
annotations_generators.py:91:27: error[invalid-return-type] Return type does not match returned value: expected `int`, found `types.AsyncGeneratorType`
annotations_generators.py:118:16: error[invalid-yield] Yield type `A` does not match annotated yield type `B`
annotations_generators.py:119:16: error[invalid-yield] Yield type `int` does not match annotated yield type `B`
annotations_generators.py:135:16: error[invalid-yield] Send type `int` does not match annotated send type `str`
"""
14 changes: 5 additions & 9 deletions conformance/results/ty/callables_annotation.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
conformance_automated = "Fail"
conformant = "Partial"
notes = """
Does not support `Concatenate`.
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`.
Does not infer a callback protocol as being a gradual type if the callback has signature `__call__(self, a: int, /, *args: Any, **kwargs: Any)`.
"""
errors_diff = """
Line 91: Expected 1 errors
Line 93: Expected 1 errors
Line 159: Expected 1 errors
Line 172: Expected 1 errors
Line 187: Expected 1 errors
Line 189: Expected 1 errors
Line 157: Unexpected errors ['callables_annotation.py:157:20: error[invalid-assignment] Object of type `Proto7` is not assignable to `Proto6`']
"""
output = """
callables_annotation.py:25:5: error[missing-argument] No argument provided for required parameter 2
Expand All @@ -29,5 +21,9 @@ callables_annotation.py:57:18: error[invalid-type-form] List literals are not al
callables_annotation.py:58:5: error[invalid-type-form] Special form `typing.Callable` expected exactly two arguments (parameter types and return type)
callables_annotation.py:58:14: error[invalid-type-form] The first argument to `Callable` must be either a list of types, ParamSpec, Concatenate, or `...`
callables_annotation.py:59:14: error[invalid-type-form] `[...]` is not a valid parameter list for `Callable`: Did you mean `Callable[..., int]`?
callables_annotation.py:157:20: error[invalid-assignment] Object of type `Proto7` is not assignable to `Proto6`
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`
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`
callables_annotation.py:172:26: error[invalid-assignment] Object of type `() -> str` is not assignable to `(int, /, *args: Any, **kwargs: Any) -> str`
callables_annotation.py:187:48: error[invalid-assignment] Object of type `(int, str, /) -> str` is not assignable to `(str, /, *args: Any, **kwargs: Any) -> str`
callables_annotation.py:189:32: error[invalid-assignment] Object of type `(int, str, /) -> str` is not assignable to `(str, /, *args: Any, **kwargs: Any) -> str`
"""
Loading