File tree Expand file tree Collapse file tree 3 files changed +3
-3
lines changed
crates/ty_python_semantic
resources/mdtest/annotations Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ async def outer_async(): # avoid unrelated syntax errors on `yield` and `await`
9999 o : bar(), # error: [invalid-type-form] "Function calls are not allowed in type expressions"
100100 p : int | f " foo " , # error: [invalid-type-form] "F-strings are not allowed in type expressions"
101101 # error: [invalid-type-form] "Slices are not allowed in type expressions"
102- # error: [invalid-type-form] "Cannot subscript object of type "
102+ # error: [invalid-type-form] "Invalid subscript"
103103 q : [1 , 2 , 3 ][1 :2 ],
104104 ):
105105 reveal_type(a) # revealed: Unknown
Original file line number Diff line number Diff line change @@ -330,7 +330,7 @@ from other import Literal
330330# ?
331331#
332332# error: [invalid-type-form] "Int literals are not allowed in this context in a type expression"
333- # error: [invalid-type-form] "Cannot subscript object of type `_SpecialForm` in type expression"
333+ # error: [invalid-type-form] "Invalid subscript of object of type `_SpecialForm` in type expression"
334334a1: Literal[26 ]
335335
336336def f ():
Original file line number Diff line number Diff line change @@ -903,7 +903,7 @@ impl<'db> TypeInferenceBuilder<'db, '_> {
903903 self . infer_type_expression ( slice) ;
904904 if let Some ( builder) = self . context . report_lint ( & INVALID_TYPE_FORM , subscript) {
905905 builder. into_diagnostic ( format_args ! (
906- "Cannot subscript object of type `{}` in type expression" ,
906+ "Invalid subscript of object of type `{}` in type expression" ,
907907 value_ty. display( self . db( ) )
908908 ) ) ;
909909 }
You can’t perform that action at this time.
0 commit comments