Skip to content

Commit d32b0d6

Browse files
committed
review feedback
1 parent 7e3ed18 commit d32b0d6

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

crates/ty_python_semantic/resources/mdtest/annotations/invalid.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

crates/ty_python_semantic/resources/mdtest/annotations/literal.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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"
334334
a1: Literal[26]
335335

336336
def f():

crates/ty_python_semantic/src/types/infer/builder/type_expression.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)