Skip to content

Commit 4b003d9

Browse files
committed
[ty] Add type-expression syntax link to invalid-type-expression
1 parent 0590b38 commit 4b003d9

File tree

1 file changed

+3
-1
lines changed
  • crates/ty_python_semantic/src/types

1 file changed

+3
-1
lines changed

crates/ty_python_semantic/src/types/infer.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7743,7 +7743,9 @@ impl<'db> TypeInferenceBuilder<'db> {
77437743
message: std::fmt::Arguments,
77447744
) -> Type<'db> {
77457745
if let Some(builder) = self.context.report_lint(&INVALID_TYPE_FORM, expression) {
7746-
builder.into_diagnostic(message);
7746+
let mut diag = builder.into_diagnostic(message);
7747+
diag.info("See the following page for a reference on valid type expressions:");
7748+
diag.info("https://typing.python.org/en/latest/spec/annotations.html#type-and-annotation-expressions");
77477749
}
77487750
Type::unknown()
77497751
}

0 commit comments

Comments
 (0)