Fix default type of static classes inside parametrized parents
Default type of LazySubstitutingClassDescriptor is not lazy. However, most of default types are, and there is an optimization in KotlinTypeFactory, which uses default type for simple type without type arguments and/or annotations. LazySubstitutingClassDescriptor's default type creates simple type with factory, which may therefore cause recursion. #KT-34029 Fixed
This commit is contained in:
+7
-1
@@ -141,7 +141,13 @@ public class LazySubstitutingClassDescriptor extends ModuleAwareClassDescriptor
|
||||
@Override
|
||||
public SimpleType getDefaultType() {
|
||||
List<TypeProjection> typeProjections = TypeUtils.getDefaultTypeProjections(getTypeConstructor().getParameters());
|
||||
return KotlinTypeFactory.simpleNotNullType(getAnnotations(), this, typeProjections);
|
||||
return KotlinTypeFactory.simpleTypeWithNonTrivialMemberScope(
|
||||
getAnnotations(),
|
||||
getTypeConstructor(),
|
||||
typeProjections,
|
||||
false,
|
||||
getUnsubstitutedMemberScope()
|
||||
);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
Reference in New Issue
Block a user