Skip to content

Commit f5dff8a

Browse files
committed
Fix singleton class lifecycle invalidation
1 parent 84fdfb6 commit f5dff8a

2 files changed

Lines changed: 696 additions & 108 deletions

File tree

rust/rubydex/src/model/definitions.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,18 @@ impl Definition {
179179
}
180180
}
181181

182+
#[must_use]
183+
pub fn has_extend_mixin(&self) -> bool {
184+
let mixins = match self {
185+
Definition::Class(definition) => definition.mixins(),
186+
Definition::SingletonClass(definition) => definition.mixins(),
187+
Definition::Module(definition) => definition.mixins(),
188+
_ => return false,
189+
};
190+
191+
mixins.iter().any(|mixin| matches!(mixin, Mixin::Extend(_)))
192+
}
193+
182194
#[must_use]
183195
pub fn is_deprecated(&self) -> bool {
184196
all_definitions!(self, it => it.flags().is_deprecated())

0 commit comments

Comments
 (0)