@@ -1117,13 +1117,6 @@ impl<'db, 'ast> TypeInferenceBuilder<'db, 'ast> {
1117
1117
// - Check for inheritance from a `@final` classes
1118
1118
// - If the class is a protocol class: check for inheritance from a non-protocol class
1119
1119
for ( i, base_class) in class. explicit_bases ( self . db ( ) ) . iter ( ) . enumerate ( ) {
1120
- if let Some ( ( class, solid_base) ) = base_class
1121
- . to_class_type ( self . db ( ) )
1122
- . and_then ( |class| Some ( ( class, class. nearest_solid_base ( self . db ( ) ) ?) ) )
1123
- {
1124
- solid_bases. insert ( solid_base, i, class. class_literal ( self . db ( ) ) . 0 ) ;
1125
- }
1126
-
1127
1120
let base_class = match base_class {
1128
1121
Type :: SpecialForm ( SpecialFormType :: Generic ) => {
1129
1122
if let Some ( builder) = self
@@ -1155,13 +1148,17 @@ impl<'db, 'ast> TypeInferenceBuilder<'db, 'ast> {
1155
1148
) ;
1156
1149
continue ;
1157
1150
}
1158
- Type :: ClassLiteral ( class) => class,
1159
- // dynamic/unknown bases are never `@final`
1151
+ Type :: ClassLiteral ( class) => ClassType :: NonGeneric ( * class) ,
1152
+ Type :: GenericAlias ( class ) => ClassType :: Generic ( * class ) ,
1160
1153
_ => continue ,
1161
1154
} ;
1162
1155
1156
+ if let Some ( solid_base) = base_class. nearest_solid_base ( self . db ( ) ) {
1157
+ solid_bases. insert ( solid_base, i, base_class. class_literal ( self . db ( ) ) . 0 ) ;
1158
+ }
1159
+
1163
1160
if is_protocol
1164
- && !( base_class. is_protocol ( self . db ( ) )
1161
+ && !( base_class. class_literal ( self . db ( ) ) . 0 . is_protocol ( self . db ( ) )
1165
1162
|| base_class. is_known ( self . db ( ) , KnownClass :: Object ) )
1166
1163
{
1167
1164
if let Some ( builder) = self
0 commit comments