Fix NON_EXHAUSTIVE_WHEN_STATEMENT warnings in project code
This commit is contained in:
committed by
teamcityserver
parent
a6edd852ff
commit
f3116cb64a
+1
@@ -58,6 +58,7 @@ interface FirDeclarationPresenter {
|
||||
is ConeKotlinType -> {
|
||||
appendRepresentation(it)
|
||||
}
|
||||
is ConeKotlinTypeConflictingProjection -> {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -197,6 +197,7 @@ object FirConflictsChecker : FirBasicDeclarationChecker() {
|
||||
}
|
||||
}
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
if (declarationName != null) {
|
||||
session.lookupTracker?.recordLookup(
|
||||
|
||||
+1
@@ -130,6 +130,7 @@ object FirInlineClassDeclarationChecker : FirRegularClassChecker() {
|
||||
}
|
||||
}
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -37,6 +37,7 @@ object FirNestedClassChecker : FirRegularClassChecker() {
|
||||
reporter.reportOn(declaration.source, NESTED_CLASS_NOT_ALLOWED, declaration.description, context)
|
||||
}
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -39,6 +39,7 @@ object FirProjectionRelationChecker : FirBasicDeclarationChecker() {
|
||||
}
|
||||
is FirTypeAlias ->
|
||||
checkTypeRef(declaration.expandedTypeRef, context, reporter)
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -48,6 +48,7 @@ object FirReturnAllowedChecker : FirReturnExpressionChecker() {
|
||||
}
|
||||
is FirProperty -> if (!containingDeclaration.isLocal) return false
|
||||
is FirValueParameter -> return true
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
return true
|
||||
|
||||
@@ -857,6 +857,8 @@ class HtmlFirDump internal constructor(private var linkResolver: FirLinkResolver
|
||||
}
|
||||
is ConeIntersectionType -> resolved { generate(type) }
|
||||
is ConeIntegerLiteralType -> inlineUnsupported(type)
|
||||
is ConeLookupTagBasedType,
|
||||
is ConeStubType -> {}
|
||||
}
|
||||
generateTypeArguments(type)
|
||||
if (type.isMarkedNullable) {
|
||||
|
||||
+2
@@ -76,6 +76,7 @@ class FirElementSerializer private constructor(
|
||||
is FirProperty -> propertyProto(declaration)?.let { builder.addProperty(it) }
|
||||
is FirSimpleFunction -> functionProto(declaration)?.let { builder.addFunction(it) }
|
||||
is FirTypeAlias -> typeAliasProto(declaration)?.let { builder.addTypeAlias(it) }
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,6 +152,7 @@ class FirElementSerializer private constructor(
|
||||
is FirProperty -> propertyProto(declaration)?.let { builder.addProperty(it) }
|
||||
is FirSimpleFunction -> functionProto(declaration)?.let { builder.addFunction(it) }
|
||||
is FirEnumEntry -> enumEntryProto(declaration).let { builder.addEnumEntry(it) }
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -76,6 +76,7 @@ class Fir2IrConverter(
|
||||
when (it) {
|
||||
is FirRegularClass -> processClassAndNestedClassHeaders(it)
|
||||
is FirTypeAlias -> classifierStorage.registerTypeAlias(it, declarationStorage.getIrFile(file))
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -107,6 +108,7 @@ class Fir2IrConverter(
|
||||
when (declaration) {
|
||||
is FirSimpleFunction -> processedCallableNames += declaration.name
|
||||
is FirProperty -> processedCallableNames += declaration.name
|
||||
else -> {}
|
||||
}
|
||||
processMemberDeclaration(declaration, anonymousObject, irClass) ?: continue
|
||||
}
|
||||
|
||||
@@ -155,6 +155,7 @@ class Fir2IrDeclarationStorage(
|
||||
constructorCache[declaration] = irConstructor
|
||||
}
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -249,6 +249,7 @@ private fun ConeClassifierLookupTag.enhanceMutability(
|
||||
return ConeClassLikeLookupTagImpl(mutableId)
|
||||
}
|
||||
}
|
||||
null -> {}
|
||||
}
|
||||
|
||||
return this
|
||||
|
||||
@@ -118,6 +118,7 @@ private fun StringBuilder.appendConeType(coneType: ConeKotlinType) {
|
||||
is ConeFlexibleType -> {
|
||||
appendConeType(coneType.lowerBound)
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -240,6 +240,7 @@ class FirRenderer(builder: StringBuilder, private val mode: RenderMode = RenderM
|
||||
print(callableDeclaration.symbol.callableId)
|
||||
}
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
|
||||
if (callableDeclaration is FirFunction) {
|
||||
@@ -382,6 +383,7 @@ class FirRenderer(builder: StringBuilder, private val mode: RenderMode = RenderM
|
||||
memberDeclaration.typeParameters.renderTypeParameters()
|
||||
}
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user