Fix NON_EXHAUSTIVE_WHEN_STATEMENT warnings in project code
This commit is contained in:
committed by
teamcityserver
parent
a6edd852ff
commit
f3116cb64a
@@ -265,6 +265,7 @@ private fun FirRegularClass.computeSamCandidateNames(session: FirSession): Set<N
|
||||
is FirSimpleFunction -> if (declaration.modality == Modality.ABSTRACT) {
|
||||
samCandidateNames.add(declaration.name)
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
@@ -41,6 +41,7 @@ data class ArgumentMapping(
|
||||
is ResolvedCallArgument.VarargArgument -> resolvedArgument.arguments.forEach {
|
||||
argumentToParameterMapping[it] = valueParameter
|
||||
}
|
||||
ResolvedCallArgument.DefaultArgument -> {}
|
||||
}
|
||||
}
|
||||
return argumentToParameterMapping
|
||||
|
||||
+4
-5
@@ -293,11 +293,9 @@ abstract class AbstractFirStatusResolveTransformer(
|
||||
}
|
||||
return when (declaration) {
|
||||
is FirCallableDeclaration -> {
|
||||
when (declaration) {
|
||||
is FirFunction -> {
|
||||
for (valueParameter in declaration.valueParameters) {
|
||||
transformValueParameter(valueParameter, data)
|
||||
}
|
||||
if (declaration is FirFunction) {
|
||||
for (valueParameter in declaration.valueParameters) {
|
||||
transformValueParameter(valueParameter, data)
|
||||
}
|
||||
}
|
||||
declaration
|
||||
@@ -397,6 +395,7 @@ abstract class AbstractFirStatusResolveTransformer(
|
||||
when (superClass) {
|
||||
is FirRegularClass -> forceResolveStatusesOfClass(superClass)
|
||||
is FirTypeAlias -> forceResolveStatusOfCorrespondingClass(superClass.expandedTypeRef)
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -59,6 +59,7 @@ class FirGlobalClassGenerationProcessor(
|
||||
when (owner) {
|
||||
is FirRegularClass -> owner.addDeclaration(klass)
|
||||
is FirFile -> owner.addDeclaration(klass)
|
||||
else -> {}
|
||||
}
|
||||
session.generatedClassIndex.registerClass(klass, owner)
|
||||
session.predicateBasedProvider.registerGeneratedDeclaration(klass, owner)
|
||||
|
||||
+7
-9
@@ -33,16 +33,14 @@ class FirClassDeclaredMemberScope(
|
||||
private val callablesIndex: Map<Name, List<FirCallableSymbol<*>>> = run {
|
||||
val result = mutableMapOf<Name, MutableList<FirCallableSymbol<*>>>()
|
||||
loop@ for (declaration in klass.declarations) {
|
||||
when (declaration) {
|
||||
is FirCallableDeclaration -> {
|
||||
val name = when (declaration) {
|
||||
is FirConstructor -> CONSTRUCTOR_NAME
|
||||
is FirVariable -> if (declaration.isSynthetic) continue@loop else declaration.name
|
||||
is FirSimpleFunction -> declaration.name
|
||||
else -> continue@loop
|
||||
}
|
||||
result.getOrPut(name) { mutableListOf() } += declaration.symbol
|
||||
if (declaration is FirCallableDeclaration) {
|
||||
val name = when (declaration) {
|
||||
is FirConstructor -> CONSTRUCTOR_NAME
|
||||
is FirVariable -> if (declaration.isSynthetic) continue@loop else declaration.name
|
||||
is FirSimpleFunction -> declaration.name
|
||||
else -> continue@loop
|
||||
}
|
||||
result.getOrPut(name) { mutableListOf() } += declaration.symbol
|
||||
}
|
||||
}
|
||||
result
|
||||
|
||||
Reference in New Issue
Block a user