Dont show warning for KT-21515 with LV>=1.3
This commit is contained in:
@@ -97,11 +97,13 @@ abstract class AbstractTypeConstructor(storageManager: StorageManager) : TypeCon
|
||||
// We also check if there are a loop with additional edges going from owner of companion to
|
||||
// the companion itself.
|
||||
// Note that we use already disconnected types to not report two diagnostics on cyclic supertypes
|
||||
supertypeLoopChecker.findLoopsInSupertypesAndDisconnect(
|
||||
this, resultWithoutCycles,
|
||||
{ it.computeNeighbours(useCompanions = true) },
|
||||
{ reportScopesLoopError(it) }
|
||||
)
|
||||
if (shouldReportCyclicScopeWithCompanionWarning) {
|
||||
supertypeLoopChecker.findLoopsInSupertypesAndDisconnect(
|
||||
this, resultWithoutCycles,
|
||||
{ it.computeNeighbours(useCompanions = true) },
|
||||
{ reportScopesLoopError(it) }
|
||||
)
|
||||
}
|
||||
|
||||
supertypes.supertypesWithoutCycles = (resultWithoutCycles as? List<KotlinType>) ?: resultWithoutCycles.toList()
|
||||
})
|
||||
@@ -118,6 +120,7 @@ abstract class AbstractTypeConstructor(storageManager: StorageManager) : TypeCon
|
||||
|
||||
// TODO: overload in AbstractTypeParameterDescriptor?
|
||||
protected open fun reportScopesLoopError(type: KotlinType) {}
|
||||
protected open val shouldReportCyclicScopeWithCompanionWarning: Boolean = false
|
||||
|
||||
protected open fun getAdditionalNeighboursInSupertypeGraph(useCompanions: Boolean): Collection<KotlinType> = emptyList()
|
||||
protected open fun defaultSupertypeIfEmpty(): KotlinType? = null
|
||||
|
||||
Reference in New Issue
Block a user