mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 12:55:05 +00:00
[ty] Do not look up __init__
on instances (#18092)
## Summary Dunder methods are never looked up on instances. We do this implicitly in `try_call_dunder`, but the corresponding flag was missing in the instance-construction code where we use `member_lookup_with_policy` directly. fixes https://github.com/astral-sh/ty/issues/322 ## Test Plan Added regression test.
This commit is contained in:
parent
1eab59e681
commit
97d7b46936
3 changed files with 27 additions and 1 deletions
|
@ -4516,7 +4516,8 @@ impl<'db> Type<'db> {
|
|||
.member_lookup_with_policy(
|
||||
db,
|
||||
"__init__".into(),
|
||||
MemberLookupPolicy::MRO_NO_OBJECT_FALLBACK,
|
||||
MemberLookupPolicy::NO_INSTANCE_FALLBACK
|
||||
| MemberLookupPolicy::MRO_NO_OBJECT_FALLBACK,
|
||||
)
|
||||
.symbol
|
||||
.is_unbound()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue