mirror of
https://github.com/astral-sh/ruff
synced 2026-01-22 05:51:03 -05:00
[flake8-type-checking] Fix false positives for typing.Annotated (#14311)
This commit is contained in:
@@ -87,6 +87,11 @@ impl ResolvedReference {
|
||||
.intersects(SemanticModelFlags::DEFERRED_TYPE_DEFINITION)
|
||||
}
|
||||
|
||||
/// Return `true` if the context is in any kind of type definition.
|
||||
pub const fn in_type_definition(&self) -> bool {
|
||||
self.flags.intersects(SemanticModelFlags::TYPE_DEFINITION)
|
||||
}
|
||||
|
||||
/// Return `true` if the context is in a type-checking block.
|
||||
pub const fn in_type_checking_block(&self) -> bool {
|
||||
self.flags
|
||||
|
||||
Reference in New Issue
Block a user