[ty] Strict validation of protocol members (#17750)

This commit is contained in:
Alex Waygood 2025-08-19 23:45:41 +01:00 committed by GitHub
parent e0f4cec7a1
commit 656fc335f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 619 additions and 78 deletions

View file

@ -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),