mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-01 06:11:43 +00:00
![]() ## Summary `KnownInstance::instance_fallback` may return instances of supertypes. For example, it returns an instance of `_SpecialForm` for `Literal`. This means it can't be used on the right-hand side of `is_subtype_of` relationships, because it might lead to false positives. I can lead to false negatives on the left hand side of `is_subtype_of`, but this is at least a known limitation. False negatives are fine for most applications, but false positives can lead to wrong results in intersection-simplification, for example. closes #14731 ## Test Plan Added regression test |
||
---|---|---|
.. | ||
module_resolver | ||
semantic_index | ||
types | ||
util | ||
ast_node_ref.rs | ||
db.rs | ||
lib.rs | ||
module_name.rs | ||
node_key.rs | ||
program.rs | ||
python_version.rs | ||
semantic_index.rs | ||
semantic_model.rs | ||
site_packages.rs | ||
stdlib.rs | ||
symbol.rs | ||
types.rs | ||
unpack.rs |