Skip to content

Commit 1e0ae04

Browse files
committed
Minor. Convert if to when
1 parent b5a8ffa commit 1e0ae04

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/NewResolutionOldInference.kt

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -259,15 +259,13 @@ class NewResolutionOldInference(
259259

260260
if (resolvedCall.status.possibleTransformToSuccess()) {
261261
for (error in status.diagnostics) {
262-
if (error is UnsupportedInnerClassCall) {
263-
resolvedCall.trace.report(Errors.UNSUPPORTED.on(resolvedCall.call.callElement, error.message))
264-
}
265-
else if (error is NestedClassViaInstanceReference) {
266-
tracing.nestedClassAccessViaInstanceReference(resolvedCall.trace, error.classDescriptor, resolvedCall.explicitReceiverKind)
267-
}
268-
else if (error is ErrorDescriptorDiagnostic) {
269-
// todo
270-
// return@map null
262+
when (error) {
263+
is UnsupportedInnerClassCall -> resolvedCall.trace.report(Errors.UNSUPPORTED.on(resolvedCall.call.callElement, error.message))
264+
is NestedClassViaInstanceReference -> tracing.nestedClassAccessViaInstanceReference(resolvedCall.trace, error.classDescriptor, resolvedCall.explicitReceiverKind)
265+
is ErrorDescriptorDiagnostic -> {
266+
// todo
267+
// return@map null
268+
}
271269
}
272270
}
273271
}

0 commit comments

Comments
 (0)