Fix construction of Mock classes in case of generic inner types

This fixes testMissingDependencyConflictingLibraries for NI and also
 fixes changed test for OI as well
This commit is contained in:
Mikhail Zarechenskiy
2020-02-18 17:13:58 +03:00
parent 83824d0ba6
commit d169435300
8 changed files with 49 additions and 9 deletions
@@ -51,19 +51,20 @@ class NotFoundClasses(private val storageManager: StorageManager, private val mo
private val isInner: Boolean,
numberOfDeclaredTypeParameters: Int
) : ClassDescriptorBase(storageManager, container, name, SourceElement.NO_SOURCE, /* isExternal = */ false) {
private val typeParameters = (0 until numberOfDeclaredTypeParameters).map { index ->
private val declaredTypeParameters = (0 until numberOfDeclaredTypeParameters).map { index ->
TypeParameterDescriptorImpl.createWithDefaultBound(
this, Annotations.EMPTY, false, Variance.INVARIANT, Name.identifier("T$index"), index, storageManager
)
}
private val typeConstructor = ClassTypeConstructorImpl(this, typeParameters, setOf(module.builtIns.anyType), storageManager)
private val typeConstructor =
ClassTypeConstructorImpl(this, computeConstructorTypeParameters(), setOf(module.builtIns.anyType), storageManager)
override fun getKind() = ClassKind.CLASS
override fun getModality() = Modality.FINAL
override fun getVisibility() = Visibilities.PUBLIC
override fun getTypeConstructor() = typeConstructor
override fun getDeclaredTypeParameters() = typeParameters
override fun getDeclaredTypeParameters() = declaredTypeParameters
override fun isInner() = isInner
override fun isCompanionObject() = false