Avoid indirection in class.__call__ lookup (#13595)

This commit is contained in:
Charlie Marsh 2024-10-01 14:01:36 -04:00 committed by GitHub
parent 73e884b232
commit 8d54996ffb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -616,8 +616,7 @@ impl<'db> Type<'db> {
Type::Instance(class) => {
// Since `__call__` is a dunder, we need to access it as an attribute on the class
// rather than the instance (matching runtime semantics).
let meta_ty = Type::Class(class);
let dunder_call_method = meta_ty.member(db, "__call__");
let dunder_call_method = class.class_member(db, "__call__");
if dunder_call_method.is_unbound() {
CallOutcome::not_callable(self)
} else {