Skip to content

Commit 404c1da

Browse files
committed
Update types.rs
1 parent 223f24a commit 404c1da

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

crates/ty_python_semantic/src/types.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4221,7 +4221,9 @@ impl<'db> Type<'db> {
42214221
/// Returns the inferred return type of `self` if it is a function literal.
42224222
fn inferred_return_type(self, db: &'db dyn Db) -> Option<Type<'db>> {
42234223
match self {
4224-
Type::FunctionLiteral(function_type) => Some(function_type.inferred_return_type(db)),
4224+
Type::FunctionLiteral(function_type) if !function_type.file(db).is_stub(db) => {
4225+
Some(function_type.inferred_return_type(db))
4226+
}
42254227
_ => None,
42264228
}
42274229
}

0 commit comments

Comments
 (0)