Skip to content

Commit 01b2318

Browse files
committed
Use is_final in a specific case
1 parent 3828c36 commit 01b2318

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎crates/zuban_python/src/type_/intersection.rs‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,13 @@ impl Intersection {
157157
.into()
158158
};
159159
for t in intersection.iter_entries() {
160-
if let Some(cls) = t.maybe_class(i_s.db)
161-
&& cls.use_cached_class_infos(i_s.db).is_final
162-
{
160+
if t.is_final(i_s.db) {
163161
add_issue(IssueKind::IntersectionCannotExistDueToFinalClass {
164162
intersection: fmt_intersection(&intersection),
165-
final_class: cls.name().into(),
163+
final_class: match t {
164+
Type::Class(c) => c.class(i_s.db).name().into(),
165+
_ => t.format_short(i_s.db),
166+
},
166167
});
167168
had_issue = true;
168169
}

0 commit comments

Comments
 (0)