[FIR] Prevent potential exponent complexity in isValidTypeParameterFromOuterDeclaration
This commit is contained in:
committed by
TeamCityServer
parent
3beb447e85
commit
aff885bcd1
@@ -41,7 +41,13 @@ fun isValidTypeParameterFromOuterDeclaration(
|
|||||||
return true // Extra check is required because of classDeclaration will be resolved later
|
return true // Extra check is required because of classDeclaration will be resolved later
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val visited = mutableSetOf<FirDeclaration>()
|
||||||
|
|
||||||
fun containsTypeParameter(currentDeclaration: FirDeclaration?): Boolean {
|
fun containsTypeParameter(currentDeclaration: FirDeclaration?): Boolean {
|
||||||
|
if (currentDeclaration == null || !visited.add(currentDeclaration)) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
if (currentDeclaration is FirTypeParameterRefsOwner) {
|
if (currentDeclaration is FirTypeParameterRefsOwner) {
|
||||||
if (currentDeclaration.typeParameters.any { it.symbol == typeParameterSymbol }) {
|
if (currentDeclaration.typeParameters.any { it.symbol == typeParameterSymbol }) {
|
||||||
return true
|
return true
|
||||||
|
|||||||
Reference in New Issue
Block a user