[ty] clarify requirements for scope_id argument to in_type_expression (#18488)

This commit is contained in:
Carl Meyer 2025-06-05 22:46:26 -07:00 committed by GitHub
parent cb8246bc5f
commit db8db536f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -4967,7 +4967,10 @@ impl<'db> Type<'db> {
/// `Type::ClassLiteral(builtins.int)`, that is, it is the `int` class itself. As a type
/// expression, it names the type `Type::NominalInstance(builtins.int)`, that is, all objects whose
/// `__class__` is `int`.
pub fn in_type_expression(
///
/// The `scope_id` argument must always be a scope from the file we are currently inferring, so
/// as to avoid cross-module AST dependency.
pub(crate) fn in_type_expression(
&self,
db: &'db dyn Db,
scope_id: ScopeId<'db>,