mirror of
https://github.com/astral-sh/ruff.git
synced 2025-11-11 16:33:55 +00:00
[ty] Strict validation of protocol members (#17750)
This commit is contained in:
parent
e0f4cec7a1
commit
656fc335f2
9 changed files with 619 additions and 78 deletions
|
|
@ -702,6 +702,10 @@ impl DefinitionKind<'_> {
|
|||
)
|
||||
}
|
||||
|
||||
pub(crate) const fn is_unannotated_assignment(&self) -> bool {
|
||||
matches!(self, DefinitionKind::Assignment(_))
|
||||
}
|
||||
|
||||
pub(crate) fn as_typevar(&self) -> Option<&AstNodeRef<ast::TypeParamTypeVar>> {
|
||||
match self {
|
||||
DefinitionKind::TypeVar(type_var) => Some(type_var),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue