Skip to content

[ty] Use infer_type_expression for parsing parameter annotations and return-type annotations#24353

Merged
AlexWaygood merged 3 commits intomainfrom
alex/return-param-type-expr
Apr 2, 2026
Merged

[ty] Use infer_type_expression for parsing parameter annotations and return-type annotations#24353
AlexWaygood merged 3 commits intomainfrom
alex/return-param-type-expr

Conversation

@AlexWaygood
Copy link
Copy Markdown
Member

Summary

Currently we call infer_annotation_expression on return annotations and parameter annotations, and then after that we do some ad-hoc checks to make sure that the TypeAndQualifiers returned doesn't actually have any qualifiers in it. A simpler way of checking that an annotation expression doesn't contain type qualifiers is by simply calling infer_type_expression rather than infer_annotation_expression, since type qualifiers are always banned in type expressions -- they're only valid in annotation expressions.

A naive way of doing this would regress our error messages -- rather than saying "Type qualifiers are not valid in parameter annotations", we would end up with the vaguer and more jargon-y "Type qualifiers are not valid in type expressions" error message. That's easily fixed, however, by plumbing some more context through our existing InferenceFlags bitflag. Doing this allows us to improve many of our existing error messages as well.

Test Plan

mdtests updated

@AlexWaygood AlexWaygood added the ty Multi-file analysis & type inference label Apr 1, 2026
@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot bot commented Apr 1, 2026

Typing conformance results

The percentage of diagnostics emitted that were expected errors held steady at 86.76%. The percentage of expected errors that received a diagnostic held steady at 81.53%. The number of fully passing files held steady at 70/132.

Summary

How are test cases classified?

Each test case represents one expected error annotation or a group of annotations sharing a tag. Counts are per test case, not per diagnostic — multiple diagnostics on the same line count as one. Required annotations (E) are true positives when ty flags the expected location and false negatives when it does not. Optional annotations (E?) are true positives when flagged but true negatives (not false negatives) when not. Tagged annotations (E[tag]) require ty to flag exactly one of the tagged lines; tagged multi-annotations (E[tag+]) allow any number up to the tag count. Flagging unexpected locations counts as a false positive.

Metric Old New Diff Outcome
True Positives 865 865 +0
False Positives 132 132 +0
False Negatives 196 196 +0
Total Diagnostics 1050 1050 +0
Precision 86.76% 86.76% +0.00%
Recall 81.53% 81.53% +0.00%
Passing Files 70/132 70/132 +0

True positives changed (63)

63 diagnostics
Test case Diff

aliases_implicit.py:107

-error[invalid-type-form] Variable of type `list[<class 'int'> | <class 'str'>]` is not allowed in a type expression
+error[invalid-type-form] Variable of type `list[<class 'int'> | <class 'str'>]` is not allowed in a parameter annotation

aliases_implicit.py:108

-error[invalid-type-form] Variable of type `tuple[tuple[<class 'int'>, <class 'str'>]]` is not allowed in a type expression
+error[invalid-type-form] Variable of type `tuple[tuple[<class 'int'>, <class 'str'>]]` is not allowed in a parameter annotation

aliases_implicit.py:109

-error[invalid-type-form] Variable of type `list[<class 'int'>]` is not allowed in a type expression
+error[invalid-type-form] Variable of type `list[<class 'int'>]` is not allowed in a parameter annotation

aliases_implicit.py:110

-error[invalid-type-form] Variable of type `dict[str, str]` is not allowed in a type expression
+error[invalid-type-form] Variable of type `dict[str, str]` is not allowed in a parameter annotation

aliases_implicit.py:114

-error[invalid-type-form] Variable of type `Literal[3]` is not allowed in a type expression
+error[invalid-type-form] Variable of type `Literal[3]` is not allowed in a parameter annotation

aliases_implicit.py:115

-error[invalid-type-form] Variable of type `Literal[True]` is not allowed in a type expression
+error[invalid-type-form] Variable of type `Literal[True]` is not allowed in a parameter annotation

aliases_implicit.py:116

-error[invalid-type-form] Variable of type `Literal[1]` is not allowed in a type expression
+error[invalid-type-form] Variable of type `Literal[1]` is not allowed in a parameter annotation

aliases_implicit.py:118

-error[invalid-type-form] Variable of type `Literal["int"]` is not allowed in a type expression
+error[invalid-type-form] Variable of type `Literal["int"]` is not allowed in a parameter annotation

aliases_implicit.py:119

-error[invalid-type-form] Variable of type `Literal["int | str"]` is not allowed in a type expression
+error[invalid-type-form] Variable of type `Literal["int | str"]` is not allowed in a parameter annotation

aliases_type_statement.py:37

-error[invalid-type-form] Function calls are not allowed in type expressions
+error[invalid-type-form] Function calls are not allowed in type alias values

aliases_type_statement.py:38

-error[invalid-type-form] List literals are not allowed in this context in a type expression
+error[invalid-type-form] List literals are not allowed in this context in a type alias value

aliases_type_statement.py:39

-error[invalid-type-form] Tuple literals are not allowed in this context in a type expression
+error[invalid-type-form] Tuple literals are not allowed in this context in a type alias value

aliases_type_statement.py:40

-error[invalid-type-form] List comprehensions are not allowed in type expressions
+error[invalid-type-form] List comprehensions are not allowed in type alias values

aliases_type_statement.py:41

-error[invalid-type-form] Dict literals are not allowed in type expressions
+error[invalid-type-form] Dict literals are not allowed in type alias values

aliases_type_statement.py:42

-error[invalid-type-form] Function calls are not allowed in type expressions
+error[invalid-type-form] Function calls are not allowed in type alias values

aliases_type_statement.py:43

-error[invalid-type-form] Only simple names and dotted names can be subscripted in type expressions
+error[invalid-type-form] Only simple names and dotted names can be subscripted in type alias values

aliases_type_statement.py:44

-error[invalid-type-form] `if` expressions are not allowed in type expressions
+error[invalid-type-form] `if` expressions are not allowed in type alias values

aliases_type_statement.py:45

-error[invalid-type-form] Variable of type `Literal[1]` is not allowed in a type expression
+error[invalid-type-form] Variable of type `Literal[1]` is not allowed in a type alias value

aliases_type_statement.py:46

-error[invalid-type-form] Boolean literals are not allowed in this context in a type expression: Did you mean `typing.Literal[True]`?
+error[invalid-type-form] Boolean literals are not allowed in this context in a type alias value: Did you mean `typing.Literal[True]`?

aliases_type_statement.py:47

-error[invalid-type-form] Int literals are not allowed in this context in a type expression: Did you mean `typing.Literal[1]`?
+error[invalid-type-form] Int literals are not allowed in this context in a type alias value: Did you mean `typing.Literal[1]`?

aliases_type_statement.py:48

-error[invalid-type-form] Boolean operations are not allowed in type expressions
+error[invalid-type-form] Boolean operations are not allowed in type alias values

aliases_type_statement.py:49

-error[invalid-type-form] F-strings are not allowed in type expressions
+error[invalid-type-form] F-strings are not allowed in type alias values

annotations_forward_refs.py:41

-error[invalid-type-form] Function calls are not allowed in type expressions
+error[invalid-type-form] Function calls are not allowed in parameter annotations

annotations_forward_refs.py:42

-error[invalid-type-form] List literals are not allowed in this context in a type expression
+error[invalid-type-form] List literals are not allowed in this context in a parameter annotation

annotations_forward_refs.py:43

-error[invalid-type-form] Tuple literals are not allowed in this context in a type expression: Did you mean `tuple[int, str]`?
+error[invalid-type-form] Tuple literals are not allowed in this context in a parameter annotation: Did you mean `tuple[int, str]`?

annotations_forward_refs.py:44

-error[invalid-type-form] List comprehensions are not allowed in type expressions
+error[invalid-type-form] List comprehensions are not allowed in parameter annotations

annotations_forward_refs.py:45

-error[invalid-type-form] Dict literals are not allowed in type expressions
+error[invalid-type-form] Dict literals are not allowed in parameter annotations

annotations_forward_refs.py:46

-error[invalid-type-form] Function calls are not allowed in type expressions
+error[invalid-type-form] Function calls are not allowed in parameter annotations

annotations_forward_refs.py:47

-error[invalid-type-form] Only simple names and dotted names can be subscripted in type expressions
+error[invalid-type-form] Only simple names and dotted names can be subscripted in parameter annotations

annotations_forward_refs.py:48

-error[invalid-type-form] `if` expressions are not allowed in type expressions
+error[invalid-type-form] `if` expressions are not allowed in parameter annotations

annotations_forward_refs.py:49

-error[invalid-type-form] Variable of type `Literal[1]` is not allowed in a type expression
+error[invalid-type-form] Variable of type `Literal[1]` is not allowed in a parameter annotation

annotations_forward_refs.py:50

-error[invalid-type-form] Boolean literals are not allowed in this context in a type expression: Did you mean `typing.Literal[True]`?
+error[invalid-type-form] Boolean literals are not allowed in this context in a parameter annotation: Did you mean `typing.Literal[True]`?

annotations_forward_refs.py:51

-error[invalid-type-form] Int literals are not allowed in this context in a type expression: Did you mean `typing.Literal[1]`?
+error[invalid-type-form] Int literals are not allowed in this context in a parameter annotation: Did you mean `typing.Literal[1]`?

annotations_forward_refs.py:52

-error[invalid-type-form] Unary operations are not allowed in type expressions
+error[invalid-type-form] Unary operations are not allowed in parameter annotations

annotations_forward_refs.py:53

-error[invalid-type-form] Boolean operations are not allowed in type expressions
+error[invalid-type-form] Boolean operations are not allowed in parameter annotations

annotations_forward_refs.py:54

-error[invalid-type-form] F-strings are not allowed in type expressions
+error[invalid-type-form] F-strings are not allowed in parameter annotations

annotations_forward_refs.py:55

-error[invalid-type-form] Module `types` is not valid in a type expression
+error[invalid-type-form] Module `types` is not valid in a parameter annotation

annotations_typeexpr.py:100

-error[invalid-type-form] Boolean operations are not allowed in type expressions
+error[invalid-type-form] Boolean operations are not allowed in parameter annotations

annotations_typeexpr.py:101

-error[invalid-type-form] F-strings are not allowed in type expressions
+error[invalid-type-form] F-strings are not allowed in parameter annotations

annotations_typeexpr.py:102

-error[invalid-type-form] Module `types` is not valid in a type expression
+error[invalid-type-form] Module `types` is not valid in a parameter annotation

annotations_typeexpr.py:88

-error[invalid-type-form] Function calls are not allowed in type expressions
+error[invalid-type-form] Function calls are not allowed in parameter annotations

annotations_typeexpr.py:89

-error[invalid-type-form] List literals are not allowed in this context in a type expression
+error[invalid-type-form] List literals are not allowed in this context in a parameter annotation

annotations_typeexpr.py:90

-error[invalid-type-form] Tuple literals are not allowed in this context in a type expression: Did you mean `tuple[int, str]`?
+error[invalid-type-form] Tuple literals are not allowed in this context in a parameter annotation: Did you mean `tuple[int, str]`?

annotations_typeexpr.py:91

-error[invalid-type-form] List comprehensions are not allowed in type expressions
+error[invalid-type-form] List comprehensions are not allowed in parameter annotations

annotations_typeexpr.py:92

-error[invalid-type-form] Dict literals are not allowed in type expressions
+error[invalid-type-form] Dict literals are not allowed in parameter annotations

annotations_typeexpr.py:93

-error[invalid-type-form] Function calls are not allowed in type expressions
+error[invalid-type-form] Function calls are not allowed in parameter annotations

annotations_typeexpr.py:94

-error[invalid-type-form] Only simple names and dotted names can be subscripted in type expressions
+error[invalid-type-form] Only simple names and dotted names can be subscripted in parameter annotations

annotations_typeexpr.py:95

-error[invalid-type-form] `if` expressions are not allowed in type expressions
+error[invalid-type-form] `if` expressions are not allowed in parameter annotations

annotations_typeexpr.py:96

-error[invalid-type-form] Variable of type `Literal[3]` is not allowed in a type expression
+error[invalid-type-form] Variable of type `Literal[3]` is not allowed in a parameter annotation

annotations_typeexpr.py:97

-error[invalid-type-form] Boolean literals are not allowed in this context in a type expression: Did you mean `typing.Literal[True]`?
+error[invalid-type-form] Boolean literals are not allowed in this context in a parameter annotation: Did you mean `typing.Literal[True]`?

annotations_typeexpr.py:98

-error[invalid-type-form] Int literals are not allowed in this context in a type expression: Did you mean `typing.Literal[1]`?
+error[invalid-type-form] Int literals are not allowed in this context in a parameter annotation: Did you mean `typing.Literal[1]`?

annotations_typeexpr.py:99

-error[invalid-type-form] Unary operations are not allowed in type expressions
+error[invalid-type-form] Unary operations are not allowed in parameter annotations

classes_classvar.py:69

-error[invalid-type-form] `ClassVar` is not allowed in function parameter annotations
+error[invalid-type-form] Type qualifier `typing.ClassVar` is not allowed in parameter annotations

classes_classvar.py:73

-error[invalid-type-form] `ClassVar` is not allowed in function return type annotations
+error[invalid-type-form] Type qualifier `typing.ClassVar` is not allowed in return type annotations

generics_base_class.py:29

-error[invalid-type-form] `typing.Generic` is not allowed in type expressions
+error[invalid-type-form] `typing.Generic` is not allowed in parameter annotations

generics_paramspec_basic.py:27

-error[invalid-type-form] `typing.Concatenate` is not allowed in this context in a type expression
+error[invalid-type-form] `typing.Concatenate` is not allowed in this context in a parameter annotation

generics_self_usage.py:73

-error[invalid-type-form] Variable of type `<special-form 'typing.Self'>` is not allowed in a type expression
-error[invalid-type-form] Variable of type `<special-form 'typing.Self'>` is not allowed in a type expression
+error[invalid-type-form] Variable of type `<special-form 'typing.Self'>` is not allowed in a parameter annotation
+error[invalid-type-form] Variable of type `<special-form 'typing.Self'>` is not allowed in a return type annotation

qualifiers_final_annotation.py:121

-error[invalid-type-form] `Final` is not allowed in function parameter annotations
+error[invalid-type-form] Type qualifier `typing.Final` is not allowed in parameter annotations

typeddicts_required.py:16

-error[invalid-type-form] `NotRequired` is not allowed in function parameter annotations
+error[invalid-type-form] Type qualifier `typing.NotRequired` is not allowed in parameter annotations

typeforms_typeform.py:108

-error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in type expression
+error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in a type expression

typeforms_typeform.py:23

-error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in type expression
+error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in a type expression

typeforms_typeform.py:24

-error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in type expression
+error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in a type expression

typeforms_typeform.py:98

-error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in type expression
+error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in a type expression

False positives changed (22)

22 diagnostics
Test case Diff

aliases_type_statement.py:10

-error[invalid-type-arguments] Too many type arguments: expected 2, got 3
-error[invalid-type-form] `...` is not allowed in this context in a type expression
+error[invalid-type-arguments] Too many type arguments: expected 2, got 3
+error[invalid-type-form] `...` is not allowed in this context in a type alias value

typeforms_typeform.py:107

-error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in type expression
+error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in a type expression

typeforms_typeform.py:15

-error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in type expression
+error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in a type expression

typeforms_typeform.py:16

-error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in type expression
+error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in a type expression

typeforms_typeform.py:17

-error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in type expression
+error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in a type expression

typeforms_typeform.py:18

-error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in type expression
+error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in a type expression

typeforms_typeform.py:19

-error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in type expression
+error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in a type expression

typeforms_typeform.py:20

-error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in type expression
+error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in a type expression

typeforms_typeform.py:21

-error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in type expression
+error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in a type expression

typeforms_typeform.py:29

-error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in type expression
+error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in a type expression

typeforms_typeform.py:30

-error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in type expression
+error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in a type expression

typeforms_typeform.py:31

-error[type-assertion-failure] Type `<types.UnionType special-form 'int | str'>` does not match asserted type `Unknown`
-error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in type expression
+error[type-assertion-failure] Type `<types.UnionType special-form 'int | str'>` does not match asserted type `Unknown`
+error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in a type expression

typeforms_typeform.py:32

-error[type-assertion-failure] Type `<class 'str'>` does not match asserted type `Unknown`
-error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in type expression
+error[type-assertion-failure] Type `<class 'str'>` does not match asserted type `Unknown`
+error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in a type expression

typeforms_typeform.py:40

-error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation

typeforms_typeform.py:41

-error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in type expression
+error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in a type expression

typeforms_typeform.py:47

-error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in type expression
+error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in a type expression

typeforms_typeform.py:52

-error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in type expression
+error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in a type expression

typeforms_typeform.py:53

-error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in type expression
+error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in a type expression

typeforms_typeform.py:81

-error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in type expression
+error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in a type expression

typeforms_typeform.py:84

-error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in type expression
+error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in a type expression

typeforms_typeform.py:93

-error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in type expression
+error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in a return type annotation

typeforms_typeform.py:97

-error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in type expression
+error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in a type expression

@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot bot commented Apr 1, 2026

Memory usage report

Summary

Project Old New Diff Outcome
flake8 47.99MB 47.99MB -0.00% (2.21kB) ⬇️
trio 117.75MB 117.73MB -0.02% (28.06kB) ⬇️
sphinx 264.69MB 264.61MB -0.03% (76.99kB) ⬇️
prefect 717.05MB 716.71MB -0.05% (347.72kB) ⬇️

Significant changes

Click to expand detailed breakdown

flake8

Name Old New Diff Outcome
infer_deferred_types 695.78kB 693.57kB -0.32% (2.21kB) ⬇️

trio

Name Old New Diff Outcome
infer_deferred_types 2.38MB 2.35MB -1.15% (28.10kB) ⬇️
check_file_impl 1.82MB 1.82MB +0.00% (44.00B) ⬇️

sphinx

Name Old New Diff Outcome
infer_deferred_types 5.61MB 5.54MB -1.34% (77.00kB) ⬇️
check_file_impl 4.92MB 4.92MB +0.00% (10.00B) ⬇️

prefect

Name Old New Diff Outcome
infer_deferred_types 14.73MB 14.39MB -2.31% (347.86kB) ⬇️
check_file_impl 17.97MB 17.97MB +0.00% (141.00B) ⬇️

@astral-sh-bot
Copy link
Copy Markdown

astral-sh-bot bot commented Apr 1, 2026

ecosystem-analyzer results

Lint rule Added Removed Changed
invalid-type-form 0 2 802
escape-character-in-forward-annotation 0 0 5
Total 0 2 807

Showing a random sample of 211 of 809 changes. See the HTML report for the full diff.

Raw diff sample (211 of 809 changes)
Expression (https://github.com/cognitedata/Expression)
- tests/test_tagged_union.py:336:32 error[invalid-type-form] Function `Face` is not valid in a type expression
+ tests/test_tagged_union.py:336:32 error[invalid-type-form] Function `Face` is not valid in a parameter annotation

Tanjun (https://github.com/FasterSpeeding/Tanjun)
- tanjun/abc.py:1087:62 error[invalid-type-form] Function `float` is not valid in a type expression
+ tanjun/abc.py:1087:62 error[invalid-type-form] Function `float` is not valid in a return type annotation

archinstall (https://github.com/archlinux/archinstall)
- archinstall/lib/boot.py:117:65 error[invalid-type-form] Function `SysCommandWorker` is not valid in a type expression
+ archinstall/lib/boot.py:117:65 error[invalid-type-form] Function `SysCommandWorker` is not valid in a return type annotation

beartype (https://github.com/beartype/beartype)
- beartype/_check/checkmake.py:137:11 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_check/checkmake.py:137:11 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_check/convert/_convcoerce.py:73:6 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_check/convert/_convcoerce.py:73:6 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a return type annotation
- beartype/_check/convert/_convcoerce.py:279:27 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_check/convert/_convcoerce.py:279:27 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_check/convert/_convcoerce.py:279:36 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_check/convert/_convcoerce.py:279:36 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a return type annotation
- beartype/_check/convert/_reduce/_nonpep/api/redapinumpy.py:41:37 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_check/convert/_reduce/_nonpep/api/redapinumpy.py:41:37 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_check/convert/_reduce/_pep/pep484/redpep484core.py:150:34 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_check/convert/_reduce/_pep/pep484/redpep484core.py:150:34 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_check/convert/_reduce/_pep/pep484585/redpep484585generic.py:158:50 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_check/convert/_reduce/_pep/pep484585/redpep484585generic.py:158:50 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_check/convert/_reduce/_pep/pep484585/redpep484585itemsview.py:34:52 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_check/convert/_reduce/_pep/pep484585/redpep484585itemsview.py:34:52 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a return type annotation
- beartype/_check/convert/_reduce/_pep/redpep544.py:118:11 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_check/convert/_reduce/_pep/redpep544.py:118:11 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_check/convert/_reduce/_pep/redpep557.py:21:47 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_check/convert/_reduce/_pep/redpep557.py:21:47 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a return type annotation
- beartype/_check/convert/_reduce/_pep/redpep589.py:22:39 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_check/convert/_reduce/_pep/redpep589.py:22:39 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a return type annotation
- beartype/_check/convert/_reduce/_pep/redpep591.py:25:30 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_check/convert/_reduce/_pep/redpep591.py:25:30 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_check/convert/_reduce/_pep/redpep646.py:96:36 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_check/convert/_reduce/_pep/redpep646.py:96:36 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_check/convert/_reduce/_pep/redpep646.py:96:45 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_check/convert/_reduce/_pep/redpep646.py:96:45 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a return type annotation
- beartype/_check/convert/_reduce/_pep/redpep673.py:24:11 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_check/convert/_reduce/_pep/redpep673.py:24:11 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_check/convert/_reduce/_pep/redpep695.py:188:11 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_check/convert/_reduce/_pep/redpep695.py:188:11 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_check/convert/_reduce/_redrecurse.py:126:22 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_check/convert/_reduce/_redrecurse.py:126:22 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_check/convert/_reduce/redmain.py:472:29 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_check/convert/_reduce/redmain.py:472:29 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_check/convert/_reduce/redmain.py:663:11 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_check/convert/_reduce/redmain.py:663:11 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_check/error/errcause.py:625:34 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_check/error/errcause.py:625:34 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_check/forward/fwdresolve.py:53:6 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_check/forward/fwdresolve.py:53:6 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a return type annotation
- beartype/_check/forward/fwdresolve.py:129:6 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_check/forward/fwdresolve.py:129:6 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a return type annotation
- beartype/_check/forward/reference/_fwdrefmeta.py:440:68 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_check/forward/reference/_fwdrefmeta.py:440:68 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a return type annotation
- beartype/_check/forward/reference/_fwdrefmeta.py:767:44 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_check/forward/reference/_fwdrefmeta.py:767:44 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_check/forward/scope/fwdscopecls.py:255:46 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_check/forward/scope/fwdscopecls.py:255:46 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a return type annotation
- beartype/_check/metadata/call/callmetadecormin.py:149:10 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_check/metadata/call/callmetadecormin.py:149:10 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a return type annotation
- beartype/_check/metadata/hint/hintsmeta.py:648:28 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_check/metadata/hint/hintsmeta.py:648:28 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_check/pep/checkpep484typevar.py:80:11 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_check/pep/checkpep484typevar.py:80:11 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_util/hint/pep/proposal/pep484/pep484604union.py:206:62 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_util/hint/pep/proposal/pep484/pep484604union.py:206:62 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a return type annotation
- beartype/_util/hint/pep/proposal/pep484/pep484union.py:26:50 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_util/hint/pep/proposal/pep484/pep484union.py:26:50 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a return type annotation
- beartype/_util/hint/pep/proposal/pep484585/generic/pep484585genget.py:1002:11 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_util/hint/pep/proposal/pep484585/generic/pep484585genget.py:1002:11 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_util/hint/pep/proposal/pep484585/generic/pep484585genget.py:1245:11 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_util/hint/pep/proposal/pep484585/generic/pep484585genget.py:1245:11 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_util/hint/pep/proposal/pep484585/generic/pep484585genget.py:1597:51 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_util/hint/pep/proposal/pep484585/generic/pep484585genget.py:1597:51 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_util/hint/pep/proposal/pep484585/generic/pep484585gentest.py:34:11 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_util/hint/pep/proposal/pep484585/generic/pep484585gentest.py:34:11 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_util/hint/pep/proposal/pep484585/generic/pep484585gentest.py:281:46 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_util/hint/pep/proposal/pep484585/generic/pep484585gentest.py:281:46 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_util/hint/pep/proposal/pep484585/pep484585args.py:23:34 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_util/hint/pep/proposal/pep484585/pep484585args.py:23:34 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_util/hint/pep/proposal/pep484585/pep484585callable.py:321:11 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_util/hint/pep/proposal/pep484585/pep484585callable.py:321:11 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_util/hint/pep/proposal/pep544.py:52:37 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_util/hint/pep/proposal/pep544.py:52:37 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_util/hint/pep/proposal/pep544.py:108:35 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_util/hint/pep/proposal/pep544.py:108:35 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_util/hint/pep/proposal/pep557.py:22:11 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_util/hint/pep/proposal/pep557.py:22:11 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_util/hint/pep/proposal/pep557.py:27:6 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_util/hint/pep/proposal/pep557.py:27:6 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a return type annotation
- beartype/_util/hint/pep/proposal/pep585.py:40:11 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_util/hint/pep/proposal/pep585.py:40:11 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_util/hint/pep/proposal/pep585.py:79:41 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_util/hint/pep/proposal/pep585.py:79:41 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_util/hint/pep/proposal/pep593.py:26:11 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_util/hint/pep/proposal/pep593.py:26:11 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_util/hint/pep/proposal/pep593.py:92:35 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_util/hint/pep/proposal/pep593.py:92:35 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_util/hint/pep/proposal/pep593.py:194:73 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_util/hint/pep/proposal/pep593.py:194:73 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a return type annotation
- beartype/_util/hint/pep/proposal/pep646/pep484612646typevar.py:136:11 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_util/hint/pep/proposal/pep646/pep484612646typevar.py:136:11 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_util/hint/pep/proposal/pep646/pep646692unpack.py:585:42 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_util/hint/pep/proposal/pep646/pep646692unpack.py:585:42 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a return type annotation
- beartype/_util/hint/pep/proposal/pep695.py:185:33 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_util/hint/pep/proposal/pep695.py:185:33 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_util/hint/pep/proposal/pep749/pep649749annotate.py:235:21 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_util/hint/pep/proposal/pep749/pep649749annotate.py:235:21 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_util/hint/pep/utilpepget.py:192:11 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_util/hint/pep/utilpepget.py:192:11 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_util/hint/pep/utilpepget.py:299:42 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_util/hint/pep/utilpepget.py:299:42 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_util/hint/pep/utilpepget.py:621:11 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_util/hint/pep/utilpepget.py:621:11 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_util/hint/pep/utilpepget.py:679:39 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_util/hint/pep/utilpepget.py:679:39 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_util/hint/pep/utilpepget.py:997:11 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_util/hint/pep/utilpepget.py:997:11 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/_util/hint/pep/utilpeptest.py:471:30 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/_util/hint/pep/utilpeptest.py:471:30 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- beartype/door/_cls/doormeta.py:70:51 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ beartype/door/_cls/doormeta.py:70:51 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation

bokeh (https://github.com/bokeh/bokeh)
- src/bokeh/plotting/_geo_feature.pyi:109:49 error[invalid-type-form] Function `array` is not valid in a type expression
+ src/bokeh/plotting/_geo_feature.pyi:109:49 error[invalid-type-form] Function `array` is not valid in a return type annotation

core (https://github.com/home-assistant/core)
- homeassistant/components/assist_pipeline/vad.py:61:24 error[invalid-type-form] Function `bytes` is not valid in a type expression
+ homeassistant/components/assist_pipeline/vad.py:61:24 error[invalid-type-form] Function `bytes` is not valid in a return type annotation
- homeassistant/components/matrix/__init__.py:324:33 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ homeassistant/components/matrix/__init__.py:324:33 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- homeassistant/components/matrix/__init__.py:480:38 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ homeassistant/components/matrix/__init__.py:480:38 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- homeassistant/core.py:1261:32 error[invalid-type-form] Variable of type `under_cached_property[Unknown]` is not allowed in a type expression
+ homeassistant/core.py:1261:32 error[invalid-type-form] Variable of type `under_cached_property[Unknown]` is not allowed in a return type annotation

cwltool (https://github.com/common-workflow-language/cwltool)
- tests/test_singularity.py:374:16 error[invalid-type-form] Function calls are not allowed in type expressions
+ tests/test_singularity.py:374:16 error[invalid-type-form] Function calls are not allowed in return type annotations

django-stubs (https://github.com/typeddjango/django-stubs)
- django-stubs/contrib/gis/gdal/envelope.pyi:30:24 error[invalid-type-form] Invalid subscript of object of type `property` in type expression
+ django-stubs/contrib/gis/gdal/envelope.pyi:30:24 error[invalid-type-form] Invalid subscript of object of type `property` in a return type annotation
- django-stubs/contrib/gis/gdal/geometries.pyi:115:47 error[invalid-type-form] Invalid subscript of object of type `property` in type expression
+ django-stubs/contrib/gis/gdal/geometries.pyi:115:47 error[invalid-type-form] Invalid subscript of object of type `property` in a return type annotation
- django-stubs/contrib/gis/gdal/geometries.pyi:163:25 error[invalid-type-form] Invalid subscript of object of type `property` in type expression
+ django-stubs/contrib/gis/gdal/geometries.pyi:163:25 error[invalid-type-form] Invalid subscript of object of type `property` in a return type annotation
- django-stubs/contrib/gis/geos/collections.pyi:13:24 error[invalid-type-form] Invalid subscript of object of type `property` in type expression
+ django-stubs/contrib/gis/geos/collections.pyi:13:24 error[invalid-type-form] Invalid subscript of object of type `property` in a return type annotation
- django-stubs/contrib/gis/geos/point.pyi:30:24 error[invalid-type-form] Invalid subscript of object of type `property` in type expression
+ django-stubs/contrib/gis/geos/point.pyi:30:24 error[invalid-type-form] Invalid subscript of object of type `property` in a return type annotation
- django-stubs/contrib/gis/geos/point.pyi:30:37 error[invalid-type-form] `...` is not allowed in this context in a type expression
- django-stubs/contrib/gis/geos/polygon.pyi:20:24 error[invalid-type-form] Invalid subscript of object of type `property` in type expression
+ django-stubs/contrib/gis/geos/polygon.pyi:20:24 error[invalid-type-form] Invalid subscript of object of type `property` in a return type annotation
- django-stubs/contrib/staticfiles/finders.pyi:15:59 error[invalid-type-form] Invalid subscript of object of type `def list(self, ignore_patterns: Iterable[str] | None) -> Iterable[Any]` in type expression
+ django-stubs/contrib/staticfiles/finders.pyi:15:59 error[invalid-type-form] Invalid subscript of object of type `def list(self, ignore_patterns: Iterable[str] | None) -> Iterable[Any]` in a return type annotation
- django-stubs/contrib/staticfiles/finders.pyi:19:16 error[invalid-type-form] Invalid subscript of object of type `def list(self, ignore_patterns: Iterable[str] | None) -> Iterable[Any]` in type expression
+ django-stubs/contrib/staticfiles/finders.pyi:19:16 error[invalid-type-form] Invalid subscript of object of type `def list(self, ignore_patterns: Iterable[str] | None) -> Iterable[Any]` in a type expression
- django-stubs/contrib/staticfiles/finders.pyi:27:59 error[invalid-type-form] Invalid subscript of object of type `def list(self, ignore_patterns: Iterable[str] | None) -> Iterable[Any]` in type expression
+ django-stubs/contrib/staticfiles/finders.pyi:27:59 error[invalid-type-form] Invalid subscript of object of type `def list(self, ignore_patterns: Iterable[str] | None) -> Iterable[Any]` in a return type annotation
- django-stubs/contrib/staticfiles/finders.pyi:35:11 error[invalid-type-form] Invalid subscript of object of type `def list(self, ignore_patterns: Iterable[str] | None) -> Iterable[Any]` in type expression
+ django-stubs/contrib/staticfiles/finders.pyi:35:11 error[invalid-type-form] Invalid subscript of object of type `def list(self, ignore_patterns: Iterable[str] | None) -> Iterable[Any]` in a type expression
- django-stubs/utils/datastructures.pyi:92:23 error[invalid-type-form] Invalid subscript of object of type `def dict(self) -> Unknown` in type expression
+ django-stubs/utils/datastructures.pyi:92:23 error[invalid-type-form] Invalid subscript of object of type `def dict(self) -> Unknown` in a return type annotation

ibis (https://github.com/ibis-project/ibis)
- ibis/backends/clickhouse/tests/test_client.py:313:35 error[invalid-type-form] Variable of type `Int64` is not allowed in a type expression
+ ibis/backends/clickhouse/tests/test_client.py:313:35 error[invalid-type-form] Variable of type `Int64` is not allowed in a parameter annotation
- ibis/backends/datafusion/udfs.py:18:51 error[invalid-type-form] Variable of type `Int32` is not allowed in a type expression
+ ibis/backends/datafusion/udfs.py:18:51 error[invalid-type-form] Variable of type `Int32` is not allowed in a return type annotation
- ibis/backends/datafusion/udfs.py:30:63 error[invalid-type-form] Variable of type `Int32` is not allowed in a type expression
+ ibis/backends/datafusion/udfs.py:30:63 error[invalid-type-form] Variable of type `Int32` is not allowed in a return type annotation
- ibis/backends/datafusion/udfs.py:42:68 error[invalid-type-form] Variable of type `Int32` is not allowed in a type expression
+ ibis/backends/datafusion/udfs.py:42:68 error[invalid-type-form] Variable of type `Int32` is not allowed in a return type annotation
- ibis/backends/datafusion/udfs.py:46:37 error[invalid-type-form] Variable of type `Time` is not allowed in a type expression
+ ibis/backends/datafusion/udfs.py:46:37 error[invalid-type-form] Variable of type `Time` is not allowed in a parameter annotation
- ibis/backends/datafusion/udfs.py:46:49 error[invalid-type-form] Variable of type `Int32` is not allowed in a type expression
+ ibis/backends/datafusion/udfs.py:46:49 error[invalid-type-form] Variable of type `Int32` is not allowed in a return type annotation
- ibis/backends/datafusion/udfs.py:107:44 error[invalid-type-form] Variable of type `Int32` is not allowed in a type expression
+ ibis/backends/datafusion/udfs.py:107:44 error[invalid-type-form] Variable of type `Int32` is not allowed in a return type annotation
- ibis/expr/types/json.py:106:46 error[invalid-type-form] Variable of type `property` is not allowed in a type expression
+ ibis/expr/types/json.py:106:46 error[invalid-type-form] Variable of type `property` is not allowed in a parameter annotation

jax (https://github.com/google/jax)
- jax/experimental/mosaic/gpu/dialect_lowering.py:2579:33 error[invalid-type-form] Variable of type `Never` is not allowed in a type expression
+ jax/experimental/mosaic/gpu/dialect_lowering.py:2579:33 error[invalid-type-form] Variable of type `Never` is not allowed in a parameter annotation

jinja (https://github.com/pallets/jinja)
- src/jinja2/environment.py:399:27 error[escape-character-in-forward-annotation] Escape characters are not allowed in type expressions
+ src/jinja2/environment.py:399:27 error[escape-character-in-forward-annotation] Escape characters are not allowed in parameter annotations
- src/jinja2/environment.py:1177:27 error[escape-character-in-forward-annotation] Escape characters are not allowed in type expressions
+ src/jinja2/environment.py:1177:27 error[escape-character-in-forward-annotation] Escape characters are not allowed in parameter annotations

mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
- gridfs/asynchronous/grid_file.py:288:75 error[invalid-type-form] Invalid subscript of object of type `def list(self, session: AsyncClientSession | None = None) -> CoroutineType[Any, Any, Unknown]` in type expression
+ gridfs/asynchronous/grid_file.py:288:75 error[invalid-type-form] Invalid subscript of object of type `def list(self, session: AsyncClientSession | None = None) -> CoroutineType[Any, Any, Unknown]` in a return type annotation

mypy (https://github.com/python/mypy)
- mypy/typeshed/stdlib/_curses_panel.pyi:22:25 error[invalid-type-form] Function `window` is not valid in a type expression
+ mypy/typeshed/stdlib/_curses_panel.pyi:22:25 error[invalid-type-form] Function `window` is not valid in a return type annotation
- mypy/typeshed/stdlib/builtins.pyi:213:54 error[invalid-type-form] `...` is not allowed in this context in a type expression
+ mypy/typeshed/stdlib/builtins.pyi:213:54 error[invalid-type-form] `...` is not allowed in this context in a parameter annotation
- mypy/typeshed/stdlib/builtins.pyi:625:56 error[invalid-type-form] `...` is not allowed in this context in a type expression
+ mypy/typeshed/stdlib/builtins.pyi:625:56 error[invalid-type-form] `...` is not allowed in this context in a parameter annotation
- mypy/typeshed/stdlib/builtins.pyi:688:56 error[invalid-type-form] `...` is not allowed in this context in a type expression
+ mypy/typeshed/stdlib/builtins.pyi:688:56 error[invalid-type-form] `...` is not allowed in this context in a parameter annotation
- mypy/typeshed/stdlib/builtins.pyi:803:40 error[invalid-type-form] `...` is not allowed in this context in a type expression
+ mypy/typeshed/stdlib/builtins.pyi:803:40 error[invalid-type-form] `...` is not allowed in this context in a return type annotation
- mypy/typeshed/stdlib/builtins.pyi:834:75 error[invalid-type-form] `...` is not allowed in this context in a type expression
+ mypy/typeshed/stdlib/builtins.pyi:834:75 error[invalid-type-form] `...` is not allowed in this context in a parameter annotation
- mypy/typeshed/stdlib/builtins.pyi:961:68 error[invalid-type-form] `...` is not allowed in this context in a type expression
+ mypy/typeshed/stdlib/builtins.pyi:961:68 error[invalid-type-form] `...` is not allowed in this context in a return type annotation
- mypy/typeshed/stdlib/builtins.pyi:965:65 error[invalid-type-form] `...` is not allowed in this context in a type expression
+ mypy/typeshed/stdlib/builtins.pyi:965:65 error[invalid-type-form] `...` is not allowed in this context in a return type annotation
- mypy/typeshed/stdlib/builtins.pyi:1014:36 error[invalid-type-form] `...` is not allowed in this context in a type expression
+ mypy/typeshed/stdlib/builtins.pyi:1014:36 error[invalid-type-form] `...` is not allowed in this context in a parameter annotation
- mypy/typeshed/stdlib/builtins.pyi:1892:29 error[invalid-type-form] `...` is not allowed in this context in a type expression
+ mypy/typeshed/stdlib/builtins.pyi:1892:29 error[invalid-type-form] `...` is not allowed in this context in a return type annotation
- mypy/typeshed/stdlib/sqlite3/__init__.pyi:275:33 error[invalid-type-form] Variable of type `property` is not allowed in a type expression
+ mypy/typeshed/stdlib/sqlite3/__init__.pyi:275:33 error[invalid-type-form] Variable of type `property` is not allowed in a return type annotation
- mypy/typeshed/stdlib/sqlite3/__init__.pyi:287:41 error[invalid-type-form] Variable of type `property` is not allowed in a type expression
+ mypy/typeshed/stdlib/sqlite3/__init__.pyi:287:41 error[invalid-type-form] Variable of type `property` is not allowed in a return type annotation
- mypy/typeshed/stdlib/sqlite3/__init__.pyi:293:31 error[invalid-type-form] Variable of type `property` is not allowed in a type expression
+ mypy/typeshed/stdlib/sqlite3/__init__.pyi:293:31 error[invalid-type-form] Variable of type `property` is not allowed in a return type annotation
- mypy/typeshed/stdlib/typing.pyi:410:20 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a type expression
+ mypy/typeshed/stdlib/typing.pyi:410:20 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a parameter annotation
- mypy/typeshed/stdlib/typing.pyi:411:31 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a type expression
+ mypy/typeshed/stdlib/typing.pyi:411:31 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a return type annotation
- mypy/typeshed/stdlib/typing.pyi:466:28 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a type expression
+ mypy/typeshed/stdlib/typing.pyi:466:28 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a parameter annotation
- mypy/typeshed/stdlib/typing.pyi:548:27 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a type expression
+ mypy/typeshed/stdlib/typing.pyi:548:27 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a return type annotation
- mypy/typeshed/stdlib/typing.pyi:550:27 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a type expression
+ mypy/typeshed/stdlib/typing.pyi:550:27 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a parameter annotation
- mypy/typeshed/stdlib/typing.pyi:719:26 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a type expression
+ mypy/typeshed/stdlib/typing.pyi:719:26 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a parameter annotation
- mypy/typeshed/stdlib/typing.pyi:724:22 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a type expression
+ mypy/typeshed/stdlib/typing.pyi:724:22 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a return type annotation
- mypy/typeshed/stdlib/typing.pyi:737:65 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a type expression
+ mypy/typeshed/stdlib/typing.pyi:737:65 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a parameter annotation
- mypy/typeshed/stdlib/typing.pyi:740:61 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a type expression
+ mypy/typeshed/stdlib/typing.pyi:740:61 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a return type annotation
- mypy/typeshed/stdlib/typing.pyi:743:42 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a type expression
+ mypy/typeshed/stdlib/typing.pyi:743:42 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a return type annotation
- mypy/typeshed/stdlib/typing.pyi:743:50 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a type expression
+ mypy/typeshed/stdlib/typing.pyi:743:50 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a return type annotation
- mypy/typeshed/stdlib/typing.pyi:744:67 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a type expression
+ mypy/typeshed/stdlib/typing.pyi:744:67 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a return type annotation
- mypy/typeshed/stdlib/typing.pyi:746:69 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a type expression
+ mypy/typeshed/stdlib/typing.pyi:746:69 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a return type annotation
- mypy/typeshed/stdlib/typing.pyi:748:68 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a type expression
+ mypy/typeshed/stdlib/typing.pyi:748:68 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a return type annotation
- mypy/typeshed/stdlib/typing.pyi:749:69 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a type expression
+ mypy/typeshed/stdlib/typing.pyi:749:69 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a return type annotation
- mypy/typeshed/stdlib/typing.pyi:763:54 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a type expression
+ mypy/typeshed/stdlib/typing.pyi:763:54 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a return type annotation
- mypy/typeshed/stdlib/typing.pyi:764:55 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a type expression
+ mypy/typeshed/stdlib/typing.pyi:764:55 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a return type annotation
- mypy/typeshed/stdlib/typing.pyi:767:62 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a type expression
+ mypy/typeshed/stdlib/typing.pyi:767:62 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a parameter annotation
- mypy/typeshed/stdlib/typing.pyi:785:24 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a type expression
+ mypy/typeshed/stdlib/typing.pyi:785:24 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a parameter annotation
- mypy/typeshed/stdlib/typing.pyi:785:38 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a type expression
+ mypy/typeshed/stdlib/typing.pyi:785:38 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a parameter annotation
- mypy/typeshed/stdlib/typing.pyi:787:24 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a type expression
+ mypy/typeshed/stdlib/typing.pyi:787:24 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a parameter annotation
- mypy/typeshed/stdlib/typing.pyi:798:32 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a type expression
+ mypy/typeshed/stdlib/typing.pyi:798:32 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a parameter annotation
- mypy/typeshed/stdlib/typing.pyi:803:38 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a type expression
+ mypy/typeshed/stdlib/typing.pyi:803:38 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a parameter annotation
- mypy/typeshed/stdlib/typing.pyi:805:54 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a type expression
+ mypy/typeshed/stdlib/typing.pyi:805:54 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a return type annotation
- mypy/typeshed/stdlib/typing.pyi:806:32 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a type expression
+ mypy/typeshed/stdlib/typing.pyi:806:32 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a return type annotation
- mypy/typeshed/stdlib/typing.pyi:814:63 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a type expression
+ mypy/typeshed/stdlib/typing.pyi:814:63 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a parameter annotation
- mypy/typeshed/stdlib/typing.pyi:838:48 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a type expression
+ mypy/typeshed/stdlib/typing.pyi:838:48 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a parameter annotation
- mypy/typeshed/stdlib/typing.pyi:840:43 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a type expression
+ mypy/typeshed/stdlib/typing.pyi:840:43 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a parameter annotation
- mypy/typeshed/stdlib/typing.pyi:840:80 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a type expression
+ mypy/typeshed/stdlib/typing.pyi:840:80 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a parameter annotation
- mypy/typeshed/stdlib/typing.pyi:850:16 error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in type expression
+ mypy/typeshed/stdlib/typing.pyi:850:16 error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in a type expression
- mypy/typeshed/stdlib/typing.pyi:877:39 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a type expression
+ mypy/typeshed/stdlib/typing.pyi:877:39 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a return type annotation
- mypy/typeshed/stdlib/typing.pyi:881:47 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a type expression
+ mypy/typeshed/stdlib/typing.pyi:881:47 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a return type annotation
- mypy/typeshed/stdlib/typing.pyi:907:27 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a type expression
+ mypy/typeshed/stdlib/typing.pyi:907:27 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a return type annotation
- mypy/typeshed/stdlib/typing.pyi:966:14 error[invalid-type-form] Variable of type `object` is not allowed in a type expression
+ mypy/typeshed/stdlib/typing.pyi:966:14 error[invalid-type-form] Variable of type `object` is not allowed in a parameter annotation
- mypy/typeshed/stdlib/typing.pyi:985:38 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a type expression
+ mypy/typeshed/stdlib/typing.pyi:985:38 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a return type annotation
- mypy/typeshed/stdlib/typing.pyi:1012:14 error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in type expression
+ mypy/typeshed/stdlib/typing.pyi:1012:14 error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in a type expression
- mypy/typeshed/stdlib/typing.pyi:1035:16 error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in type expression
+ mypy/typeshed/stdlib/typing.pyi:1035:16 error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in a type expression
- mypy/typeshed/stdlib/typing.pyi:1036:24 error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in type expression
+ mypy/typeshed/stdlib/typing.pyi:1036:24 error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in a type expression
- mypy/typeshed/stdlib/typing_extensions.pyi:250:25 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ mypy/typeshed/stdlib/typing_extensions.pyi:250:25 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- mypy/typeshed/stdlib/typing_extensions.pyi:256:29 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ mypy/typeshed/stdlib/typing_extensions.pyi:256:29 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- mypy/typeshed/stdlib/typing_extensions.pyi:371:52 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ mypy/typeshed/stdlib/typing_extensions.pyi:371:52 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a return type annotation
- mypy/typeshed/stdlib/typing_extensions.pyi:499:37 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ mypy/typeshed/stdlib/typing_extensions.pyi:499:37 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- mypy/typeshed/stdlib/typing_extensions.pyi:647:17 error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in type expression
+ mypy/typeshed/stdlib/typing_extensions.pyi:647:17 error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in a parameter annotation
- mypy/typeshed/stdlib/typing_extensions.pyi:686:17 error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in type expression
+ mypy/typeshed/stdlib/typing_extensions.pyi:686:17 error[invalid-type-form] Invalid subscript of object of type `_SpecialForm` in a parameter annotation
- mypyc/test-data/fixtures/typing-full.pyi:14:34 error[invalid-type-form] Variable of type `object` is not allowed in a type expression
+ mypyc/test-data/fixtures/typing-full.pyi:14:34 error[invalid-type-form] Variable of type `object` is not allowed in a parameter annotation
- mypyc/test-data/fixtures/typing-full.pyi:16:54 error[invalid-type-form] Variable of type `object` is not allowed in a type expression
+ mypyc/test-data/fixtures/typing-full.pyi:16:54 error[invalid-type-form] Variable of type `object` is not allowed in a parameter annotation
- mypyc/test-data/fixtures/typing-full.pyi:17:37 error[invalid-type-form] Variable of type `object` is not allowed in a type expression
+ mypyc/test-data/fixtures/typing-full.pyi:17:37 error[invalid-type-form] Variable of type `object` is not allowed in a return type annotation
- mypyc/test-data/fixtures/typing-full.pyi:69:27 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a type expression
+ mypyc/test-data/fixtures/typing-full.pyi:69:27 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a return type annotation
- mypyc/test-data/fixtures/typing-full.pyi:113:50 error[invalid-type-form] Variable of type `object` is not allowed in a type expression
+ mypyc/test-data/fixtures/typing-full.pyi:113:50 error[invalid-type-form] Variable of type `object` is not allowed in a parameter annotation
- mypyc/test-data/fixtures/typing-full.pyi:131:30 error[invalid-type-form] Variable of type `object` is not allowed in a type expression
+ mypyc/test-data/fixtures/typing-full.pyi:131:30 error[invalid-type-form] Variable of type `object` is not allowed in a parameter annotation
- mypyc/test-data/fixtures/typing-full.pyi:137:28 error[invalid-type-form] Invalid subscript of object of type `Literal[0]` in type expression
+ mypyc/test-data/fixtures/typing-full.pyi:137:28 error[invalid-type-form] Invalid subscript of object of type `Literal[0]` in a return type annotation
- mypyc/test-data/fixtures/typing-full.pyi:154:34 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a type expression
+ mypyc/test-data/fixtures/typing-full.pyi:154:34 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a return type annotation
- mypyc/test-data/fixtures/typing-full.pyi:173:22 error[invalid-type-form] Variable of type `Literal[0]` is not allowed in a type expression
+ mypyc/test-data/fixtures/typing-full.pyi:173:22 error[invalid-type-form] Variable of type `Literal[0]` is not allowed in a parameter annotation
- mypyc/test-data/fixtures/typing-full.pyi:173:41 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a type expression
+ mypyc/test-data/fixtures/typing-full.pyi:173:41 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a parameter annotation
- mypyc/test-data/fixtures/typing-full.pyi:174:22 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a type expression
+ mypyc/test-data/fixtures/typing-full.pyi:174:22 error[invalid-type-form] Variable of type `TypeVar` is not allowed in a parameter annotation

nionutils (https://github.com/nion-software/nionutils)
- nion/utils/Geometry.py:690:37 error[invalid-type-form] Variable of type `property` is not allowed in a type expression
+ nion/utils/Geometry.py:690:37 error[invalid-type-form] Variable of type `property` is not allowed in a return type annotation

pandas (https://github.com/pandas-dev/pandas)
- pandas/core/_numba/extensions.py:74:48 error[invalid-type-form] Function `any` is not valid in a type expression
+ pandas/core/_numba/extensions.py:74:48 error[invalid-type-form] Function `any` is not valid in a parameter annotation
- pandas/core/arrays/datetimes.py:632:21 error[invalid-type-form] Variable of type `property` is not allowed in a type expression
+ pandas/core/arrays/datetimes.py:632:21 error[invalid-type-form] Variable of type `property` is not allowed in a return type annotation
- pandas/core/series.py:1507:17 error[invalid-type-form] Variable of type `Accessor` is not allowed in a type expression
+ pandas/core/series.py:1507:17 error[invalid-type-form] Variable of type `Accessor` is not allowed in a parameter annotation
- pandas/core/series.py:1508:23 error[invalid-type-form] Variable of type `Accessor` is not allowed in a type expression
+ pandas/core/series.py:1508:23 error[invalid-type-form] Variable of type `Accessor` is not allowed in a parameter annotation
- pandas/core/series.py:1516:10 error[invalid-type-form] Variable of type `Accessor` is not allowed in a type expression
+ pandas/core/series.py:1516:10 error[invalid-type-form] Variable of type `Accessor` is not allowed in a return type annotation
- pandas/core/series.py:1539:37 error[invalid-type-form] Variable of type `Accessor` is not allowed in a type expression
+ pandas/core/series.py:1539:37 error[invalid-type-form] Variable of type `Accessor` is not allowed in a parameter annotation
- pandas/core/series.py:1674:10 error[invalid-type-form] Variable of type `Accessor` is not allowed in a type expression
+ pandas/core/series.py:1674:10 error[invalid-type-form] Variable of type `Accessor` is not allowed in a return type annotation
- pandas/core/series.py:6003:30 error[invalid-type-form] Variable of type `Accessor` is not allowed in a type expression
+ pandas/core/series.py:6003:30 error[invalid-type-form] Variable of type `Accessor` is not allowed in a parameter annotation
- pandas/core/series.py:6917:19 error[invalid-type-form] Invalid subscript of object of type `Accessor` in type expression
+ pandas/core/series.py:6917:19 error[invalid-type-form] Invalid subscript of object of type `Accessor` in a type expression
- pandas/core/series.py:8642:15 error[invalid-type-form] Variable of type `Accessor` is not allowed in a type expression
+ pandas/core/series.py:8642:15 error[invalid-type-form] Variable of type `Accessor` is not allowed in a parameter annotation

pandera (https://github.com/pandera-dev/pandera)
- pandera/backends/pyspark/checks.py:59:49 error[invalid-type-form] Function `is_table` is not valid in a type expression
+ pandera/backends/pyspark/checks.py:59:49 error[invalid-type-form] Function `is_table` is not valid in a parameter annotation
- pandera/backends/pyspark/checks.py:75:23 error[invalid-type-form] Function `is_bool` is not valid in a type expression
+ pandera/backends/pyspark/checks.py:75:23 error[invalid-type-form] Function `is_bool` is not valid in a parameter annotation

pip (https://github.com/pypa/pip)
- src/pip/_vendor/truststore/_macos.py:314:42 error[invalid-type-form] Variable of type `type[_Pointer[c_void_p]]` is not allowed in a type expression
+ src/pip/_vendor/truststore/_macos.py:314:42 error[invalid-type-form] Variable of type `type[_Pointer[c_void_p]]` is not allowed in a parameter annotation

poetry (https://github.com/python-poetry/poetry)
- src/poetry/utils/env/env_manager.py:257:48 error[invalid-type-form] Invalid subscript of object of type `def list(self, name: str | None = None) -> Unknown` in type expression
+ src/poetry/utils/env/env_manager.py:257:48 error[invalid-type-form] Invalid subscript of object of type `def list(self, name: str | None = None) -> Unknown` in a return type annotation
- tests/repositories/fixtures/pypi.org/generate.py:111:35 error[invalid-type-form] Invalid subscript of object of type `def list(self, location: Path | None = None) -> Iterator[ReleaseFileMetadata]` in type expression
+ tests/repositories/fixtures/pypi.org/generate.py:111:35 error[invalid-type-form] Invalid subscript of object of type `def list(self, location: Path | None = None) -> Iterator[ReleaseFileMetadata]` in a parameter annotation

prefect (https://github.com/PrefectHQ/prefect)
- src/integrations/prefect-snowflake/prefect_snowflake/experimental/workers/spcs.py:746:76 error[invalid-type-form] Module `datetime` is not valid in a type expression: Did you mean to use the module's member `datetime.datetime`?
+ src/integrations/prefect-snowflake/prefect_snowflake/experimental/workers/spcs.py:746:76 error[invalid-type-form] Module `datetime` is not valid in a return type annotation: Did you mean to use the module's member `datetime.datetime`?

pydantic (https://github.com/pydantic/pydantic)
- pydantic/main.py:288:39 error[invalid-type-form] Invalid subscript of object of type `def dict(self, *, include: set[int] | set[str] | Mapping[int, Divergent] | Mapping[str, Divergent] | None = None, exclude: set[int] | set[str] | Mapping[int, Divergent] | Mapping[str, Divergent] | None = None, by_alias: bool = False, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) -> dict[str, Any]` in type expression
+ pydantic/main.py:288:39 error[invalid-type-form] Invalid subscript of object of type `def dict(self, *, include: set[int] | set[str] | Mapping[int, Divergent] | Mapping[str, Divergent] | None = None, exclude: set[int] | set[str] | Mapping[int, Divergent] | Mapping[str, Divergent] | None = None, by_alias: bool = False, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) -> dict[str, Any]` in a return type annotation
- pydantic/main.py:570:10 error[invalid-type-form] Invalid subscript of object of type `def dict(self, *, include: set[int] | set[str] | Mapping[int, Divergent] | Mapping[str, Divergent] | None = None, exclude: set[int] | set[str] | Mapping[int, Divergent] | Mapping[str, Divergent] | None = None, by_alias: bool = False, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) -> dict[str, Any]` in type expression
+ pydantic/main.py:570:10 error[invalid-type-form] Invalid subscript of object of type `def dict(self, *, include: set[int] | set[str] | Mapping[int, Divergent] | Mapping[str, Divergent] | None = None, exclude: set[int] | set[str] | Mapping[int, Divergent] | Mapping[str, Divergent] | None = None, by_alias: bool = False, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) -> dict[str, Any]` in a return type annotation
- pydantic/main.py:1145:31 error[invalid-type-form] Invalid subscript of object of type `def dict(self, *, include: set[int] | set[str] | Mapping[int, Divergent] | Mapping[str, Divergent] | None = None, exclude: set[int] | set[str] | Mapping[int, Divergent] | Mapping[str, Divergent] | None = None, by_alias: bool = False, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) -> dict[str, Any]` in type expression
+ pydantic/main.py:1145:31 error[invalid-type-form] Invalid subscript of object of type `def dict(self, *, include: set[int] | set[str] | Mapping[int, Divergent] | Mapping[str, Divergent] | None = None, exclude: set[int] | set[str] | Mapping[int, Divergent] | Mapping[str, Divergent] | None = None, by_alias: bool = False, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) -> dict[str, Any]` in a return type annotation

pytest (https://github.com/pytest-dev/pytest)
- src/_pytest/_code/code.py:507:24 error[invalid-type-form] Invalid subscript of object of type `property` in type expression
+ src/_pytest/_code/code.py:507:24 error[invalid-type-form] Invalid subscript of object of type `property` in a parameter annotation
- src/_pytest/_code/code.py:596:23 error[invalid-type-form] Invalid subscript of object of type `property` in type expression
+ src/_pytest/_code/code.py:596:23 error[invalid-type-form] Invalid subscript of object of type `property` in a return type annotation
- src/_pytest/pytester.py:1578:36 error[invalid-type-form] Function `str` is not valid in a type expression
+ src/_pytest/pytester.py:1578:36 error[invalid-type-form] Function `str` is not valid in a parameter annotation
- src/_pytest/pytester.py:1597:53 error[invalid-type-form] Function `str` is not valid in a type expression
+ src/_pytest/pytester.py:1597:53 error[invalid-type-form] Function `str` is not valid in a parameter annotation
- src/_pytest/pytester.py:1602:54 error[invalid-type-form] Function `str` is not valid in a type expression
+ src/_pytest/pytester.py:1602:54 error[invalid-type-form] Function `str` is not valid in a parameter annotation
- src/_pytest/pytester.py:1636:28 error[invalid-type-form] Function `str` is not valid in a type expression
+ src/_pytest/pytester.py:1636:28 error[invalid-type-form] Function `str` is not valid in a return type annotation
- src/_pytest/pytester.py:1640:32 error[invalid-type-form] Function `str` is not valid in a type expression
+ src/_pytest/pytester.py:1640:32 error[invalid-type-form] Function `str` is not valid in a parameter annotation
- src/_pytest/pytester.py:1678:31 error[invalid-type-form] Function `str` is not valid in a type expression
+ src/_pytest/pytester.py:1678:31 error[invalid-type-form] Function `str` is not valid in a parameter annotation

rotki (https://github.com/rotki/rotki)
- rotkehlchen/chain/accounts.py:51:61 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ rotkehlchen/chain/accounts.py:51:61 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation
- rotkehlchen/types.py:1028:48 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a type expression
+ rotkehlchen/types.py:1028:48 error[invalid-type-form] Variable of type `_SpecialForm` is not allowed in a parameter annotation

schemathesis (https://github.com/schemathesis/schemathesis)
- src/schemathesis/schemas.py:746:82 error[invalid-type-form] Function `Case` is not valid in a type expression
+ src/schemathesis/schemas.py:746:82 error[invalid-type-form] Function `Case` is not valid in a return type annotation

scrapy (https://github.com/scrapy/scrapy)
- scrapy/spiderloader.py:127:23 error[invalid-type-form] Invalid subscript of object of type `def list(self) -> Unknown` in type expression
+ scrapy/spiderloader.py:127:23 error[invalid-type-form] Invalid subscript of object of type `def list(self) -> Unknown` in a return type annotation

strawberry (https://github.com/strawberry-graphql/strawberry)
- strawberry/types/arguments.py:124:40 error[invalid-type-form] Variable of type `property` is not allowed in a type expression
+ strawberry/types/arguments.py:124:40 error[invalid-type-form] Variable of type `property` is not allowed in a return type annotation

sympy (https://github.com/sympy/sympy)
- sympy/external/gmpy.py:351:67 error[invalid-type-form] Function `str` is not valid in a type expression
+ sympy/external/gmpy.py:351:67 error[invalid-type-form] Function `str` is not valid in a return type annotation
- sympy/polys/rings.py:1363:44 error[invalid-type-form] Function `str` is not valid in a type expression
+ sympy/polys/rings.py:1363:44 error[invalid-type-form] Function `str` is not valid in a parameter annotation
- sympy/polys/rings.py:1821:47 error[invalid-type-form] Function `str` is not valid in a type expression
+ sympy/polys/rings.py:1821:47 error[invalid-type-form] Function `str` is not valid in a parameter annotation

trio (https://github.com/python-trio/trio)
- src/trio/_socket.py:625:19 error[invalid-type-form] Invalid subscript of object of type `property` in type expression
+ src/trio/_socket.py:625:19 error[invalid-type-form] Invalid subscript of object of type `property` in a parameter annotation
- src/trio/testing/_raises_group.py:50:21 error[invalid-type-form] Invalid subscript of object of type `property` in type expression
+ src/trio/testing/_raises_group.py:50:21 error[invalid-type-form] Invalid subscript of object of type `property` in a type expression
- src/trio/testing/_raises_group.py:60:25 error[invalid-type-form] Invalid subscript of object of type `property` in type expression
+ src/trio/testing/_raises_group.py:60:25 error[invalid-type-form] Invalid subscript of object of type `property` in a parameter annotation

xarray (https://github.com/pydata/xarray)
- xarray/core/dataarray.py:1990:46 error[invalid-type-form] Variable of type `UncachedAccessor[StringAccessor[DataArray]]` is not allowed in a type expression
+ xarray/core/dataarray.py:1990:46 error[invalid-type-form] Variable of type `UncachedAccessor[StringAccessor[DataArray]]` is not allowed in a parameter annotation
- xarray/core/dataarray.py:3567:15 error[invalid-type-form] Variable of type `UncachedAccessor[StringAccessor[DataArray]]` is not allowed in a type expression
+ xarray/core/dataarray.py:3567:15 error[invalid-type-form] Variable of type `UncachedAccessor[StringAccessor[DataArray]]` is not allowed in a parameter annotation
- xarray/core/dataarray.py:4065:16 error[invalid-type-form] Variable of type `UncachedAccessor[StringAccessor[DataArray]]` is not allowed in a type expression
+ xarray/core/dataarray.py:4065:16 error[invalid-type-form] Variable of type `UncachedAccessor[StringAccessor[DataArray]]` is not allowed in a parameter annotation
- xarray/core/dataarray.py:4098:16 error[invalid-type-form] Variable of type `UncachedAccessor[StringAccessor[DataArray]]` is not allowed in a type expression
+ xarray/core/dataarray.py:4098:16 error[invalid-type-form] Variable of type `UncachedAccessor[StringAccessor[DataArray]]` is not allowed in a parameter annotation
- xarray/core/dataarray.py:4100:45 error[invalid-type-form] Variable of type `UncachedAccessor[StringAccessor[DataArray]]` is not allowed in a type expression
+ xarray/core/dataarray.py:4100:45 error[invalid-type-form] Variable of type `UncachedAccessor[StringAccessor[DataArray]]` is not allowed in a parameter annotation
- xarray/core/dataarray.py:4131:45 error[invalid-type-form] Variable of type `UncachedAccessor[StringAccessor[DataArray]]` is not allowed in a type expression
+ xarray/core/dataarray.py:4131:45 error[invalid-type-form] Variable of type `UncachedAccessor[StringAccessor[DataArray]]` is not allowed in a parameter annotation
- xarray/core/dataarray.py:4259:39 error[invalid-type-form] Variable of type `UncachedAccessor[StringAccessor[DataArray]]` is not allowed in a type expression
+ xarray/core/dataarray.py:4259:39 error[invalid-type-form] Variable of type `UncachedAccessor[StringAccessor[DataArray]]` is not allowed in a parameter annotation
- xarray/core/dataarray.py:4275:41 error[invalid-type-form] Variable of type `UncachedAccessor[StringAccessor[DataArray]]` is not allowed in a type expression
+ xarray/core/dataarray.py:4275:41 error[invalid-type-form] Variable of type `UncachedAccessor[StringAccessor[DataArray]]` is not allowed in a parameter annotation
- xarray/core/dataarray.py:4295:36 error[invalid-type-form] Variable of type `UncachedAccessor[StringAccessor[DataArray]]` is not allowed in a type expression
+ xarray/core/dataarray.py:4295:36 error[invalid-type-form] Variable of type `UncachedAccessor[StringAccessor[DataArray]]` is not allowed in a parameter annotation
- xarray/core/dataarray.py:4949:55 error[invalid-type-form] Variable of type `UncachedAccessor[StringAccessor[DataArray]]` is not allowed in a type expression
+ xarray/core/dataarray.py:4949:55 error[invalid-type-form] Variable of type `UncachedAccessor[StringAccessor[DataArray]]` is not allowed in a return type annotation
- xarray/core/dataarray.py:6315:14 error[invalid-type-form] Variable of type `UncachedAccessor[StringAccessor[DataArray]]` is not allowed in a type expression
+ xarray/core/dataarray.py:6315:14 error[invalid-type-form] Variable of type `UncachedAccessor[StringAccessor[DataArray]]` is not allowed in a parameter annotation
- xarray/core/dataarray.py:6519:25 error[invalid-type-form] Variable of type `UncachedAccessor[StringAccessor[DataArray]]` is not allowed in a type expression
+ xarray/core/dataarray.py:6519:25 error[invalid-type-form] Variable of type `UncachedAccessor[StringAccessor[DataArray]]` is not allowed in a parameter annotation
- xarray/core/dataarray.py:6890:14 error[invalid-type-form] Variable of type `UncachedAccessor[StringAccessor[DataArray]]` is not allowed in a type expression
+ xarray/core/dataarray.py:6890:14 error[invalid-type-form] Variable of type `UncachedAccessor[StringAccessor[DataArray]]` is not allowed in a parameter annotation
- xarray/core/dataarray.py:7272:14 error[invalid-type-form] Variable of type `UncachedAccessor[StringAccessor[DataArray]]` is not allowed in a type expression
+ xarray/core/dataarray.py:7272:14 error[invalid-type-form] Variable of type `UncachedAccessor[StringAccessor[DataArray]]` is not allowed in a parameter annotation

Full report with detailed diff (timing results)

@AlexWaygood AlexWaygood marked this pull request as ready for review April 1, 2026 21:22
@astral-sh-bot astral-sh-bot bot requested a review from oconnor663 April 1, 2026 21:22
let ty = self.infer_attribute_expression(attribute_expression);

if let Type::TypeVar(tvar) = ty
&& tvar.paramspec_attr(self.db()).is_some()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain this piece? Since it looks like a behavior change, but I'm guessing it's not?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a pre-existing special-case that already exists in annotation_expression.rs:

match attribute.ctx {
ast::ExprContext::Load => {
let attribute_type = self.infer_attribute_expression(attribute);
if let Type::TypeVar(typevar) = attribute_type
&& typevar.paramspec_attr(self.db()).is_some()
{
TypeAndQualifiers::declared(attribute_type)
} else {
infer_name_or_attribute(
attribute_type,
annotation,
self,
pep_613_policy,
)
}
}

and now has to be copied over to type_expression.rs, because of the fact that we call infer_type_expression() directly from more places.

The repeated logic is a bit ugly, though (as is the special case to begin with). I'll see if I can factor it out.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in 8d2eec6

@AlexWaygood AlexWaygood force-pushed the alex/invalid-expr-messages branch from 8c3251f to 246831b Compare April 2, 2026 14:11
@AlexWaygood AlexWaygood requested a review from MichaReiser as a code owner April 2, 2026 14:11
Base automatically changed from alex/invalid-expr-messages to main April 2, 2026 14:16
@AlexWaygood AlexWaygood force-pushed the alex/return-param-type-expr branch from 4dd20b4 to 82efcdd Compare April 2, 2026 15:13
@AlexWaygood AlexWaygood force-pushed the alex/return-param-type-expr branch from 82efcdd to 0bf4a84 Compare April 2, 2026 15:21
@AlexWaygood AlexWaygood enabled auto-merge (squash) April 2, 2026 16:02
@AlexWaygood AlexWaygood merged commit b889571 into main Apr 2, 2026
50 of 51 checks passed
@AlexWaygood AlexWaygood deleted the alex/return-param-type-expr branch April 2, 2026 16:05
carljm added a commit that referenced this pull request Apr 2, 2026
* main:
  [ty] Improve robustness of various type-qualifier-related checks (#24251)
  Only run the release-gate on workflow dispatch (#24366)
  [ty] Use `infer_type_expression` for parsing parameter annotations and return-type annotations (#24353)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants