[ty] Uniformly use "not supported" in diagnostics#21916
Merged
AlexWaygood merged 1 commit intoastral-sh:mainfrom Dec 11, 2025
Merged
[ty] Uniformly use "not supported" in diagnostics#21916AlexWaygood merged 1 commit intoastral-sh:mainfrom
AlexWaygood merged 1 commit intoastral-sh:mainfrom
Conversation
Some (most?) diagnostic messages already use the form "Operator <op> not supported", but others use "Operator <op> unsupported": https://play.ty.dev/ae13cd3d-531b-4ed3-adea-eba9b0cafb6c ```py 0 + "" 0 < "" ``` > Operator `+` is unsupported between objects of type `Literal[0]` and `Literal[""]` (unsupported-operator) [Ln 1, Col 1] > Operator `<` is not supported between objects of type `Literal[0]` and `Literal[""]` (unsupported-operator) [Ln 2, Col 1] This commit uniforms the diagnostic messages, favoring "not supported". While it is two characters longer, this matches pyright/pyrefly's messages, is slightly less redundant given that "unsupported" already appears in the diagnostic's type (e.g., unsupported-operator), and makes the "not" stand out. (This commit does not remove all occurrences of "unsupported" in diagnostic messages: there are still some that e.g. start with "Unsupported <X>". I think those are acceptable as they are.)
Diagnostic diff on typing conformance testsChanges were detected when running ty on typing conformance tests--- old-output.txt 2025-12-11 14:04:47.563232536 +0000
+++ new-output.txt 2025-12-11 14:04:51.515246565 +0000
@@ -425,7 +425,7 @@
generics_base_class.py:45:5: error[type-assertion-failure] Type `Iterator[int]` does not match asserted type `Unknown`
generics_base_class.py:49:38: error[invalid-type-arguments] Too many type arguments to class `LinkedList`: expected 1, got 2
generics_base_class.py:61:30: error[invalid-type-arguments] Too many type arguments to class `MyDict`: expected 1, got 2
-generics_basic.py:34:12: error[unsupported-operator] Operator `+` is unsupported between objects of type `AnyStr@concat` and `AnyStr@concat`
+generics_basic.py:34:12: error[unsupported-operator] Operator `+` is not supported between objects of type `AnyStr@concat` and `AnyStr@concat`
generics_basic.py:49:44: error[invalid-legacy-type-variable] A `TypeVar` cannot have exactly one constraint
generics_basic.py:139:5: error[type-assertion-failure] Type `int` does not match asserted type `Unknown`
generics_basic.py:140:5: error[type-assertion-failure] Type `int` does not match asserted type `Unknown`
|
|
Contributor
Author
|
Some checks failed because GitHub's reliability is quite poor recently... |
dcreager
added a commit
that referenced
this pull request
Dec 11, 2025
* origin/main: (29 commits) Document range suppressions, reorganize suppression docs (#21884) Ignore ruff:isort like ruff:noqa in new suppressions (#21922) [ty] Handle `Definition`s in `SemanticModel::scope` (#21919) [ty] Attach salsa db when running ide tests for easier debugging (#21917) [ty] Don't show hover for expressions with no inferred type (#21924) [ty] avoid unions of generic aliases of the same class in fixpoint (#21909) [ty] Squash false positive logs for failing to find `builtins` as a real module [ty] Uniformly use "not supported" in diagnostics (#21916) [ty] Reduce size of ty-ide snapshots (#21915) [ty] Adjust scope completions to use all reachable symbols [ty] Rename `all_members_of_scope` to `all_end_of_scope_members` [ty] Remove `all_` prefix from some routines on UseDefMap Enable `--document-private-items` for `ruff_python_formatter` (#21903) Remove `BackwardsTokenizer` based `parenthesized_range` references in `ruff_linter` (#21836) [ty] Revert "Do not infer types for invalid binary expressions in annotations" (#21914) Skip over trivia tokens after re-lexing (#21895) [ty] Avoid inferring types for invalid binary expressions in string annotations (#21911) [ty] Improve overload call resolution tracing (#21913) [ty] fix missing heap_size on Salsa query (#21912) [ty] Support implicit type of `cls` in signatures (#21771) ...
dcreager
added a commit
that referenced
this pull request
Dec 11, 2025
* origin/main: (36 commits) [ty] Defer all parameter and return type annotations (#21906) [ty] Fix workspace symbols to return members too (#21926) Document range suppressions, reorganize suppression docs (#21884) Ignore ruff:isort like ruff:noqa in new suppressions (#21922) [ty] Handle `Definition`s in `SemanticModel::scope` (#21919) [ty] Attach salsa db when running ide tests for easier debugging (#21917) [ty] Don't show hover for expressions with no inferred type (#21924) [ty] avoid unions of generic aliases of the same class in fixpoint (#21909) [ty] Squash false positive logs for failing to find `builtins` as a real module [ty] Uniformly use "not supported" in diagnostics (#21916) [ty] Reduce size of ty-ide snapshots (#21915) [ty] Adjust scope completions to use all reachable symbols [ty] Rename `all_members_of_scope` to `all_end_of_scope_members` [ty] Remove `all_` prefix from some routines on UseDefMap Enable `--document-private-items` for `ruff_python_formatter` (#21903) Remove `BackwardsTokenizer` based `parenthesized_range` references in `ruff_linter` (#21836) [ty] Revert "Do not infer types for invalid binary expressions in annotations" (#21914) Skip over trivia tokens after re-lexing (#21895) [ty] Avoid inferring types for invalid binary expressions in string annotations (#21911) [ty] Improve overload call resolution tracing (#21913) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Some (most?) diagnostic messages already use the form "Operator not supported", but others use "Operator unsupported":
https://play.ty.dev/ae13cd3d-531b-4ed3-adea-eba9b0cafb6c
This commit uniforms the diagnostic messages, favoring "not supported". While it is two characters longer, this:
(This commit does not remove all occurrences of "unsupported" in diagnostic messages: there are still some that e.g. start with "Unsupported X". I think those are acceptable as they are.)
Test Plan
Updated existing tests, and checked the new diagnostics messages with those produced by pyright/pyrefly.