From 5b947144d4a0d097bb7d5481b41d6dca5fb4bcd9 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Wed, 11 Nov 2020 13:03:20 +0300 Subject: [PATCH] FirTypeIntersectionScope: don't create in no-supertypes situation --- .../kotlin/fir/scopes/impl/FirTypeIntersectionScope.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirTypeIntersectionScope.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirTypeIntersectionScope.kt index 618488e7776..cfb77f7a65e 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirTypeIntersectionScope.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirTypeIntersectionScope.kt @@ -493,6 +493,9 @@ class FirTypeIntersectionScope private constructor( dispatchReceiverType: ConeKotlinType, ): FirTypeScope { scopes.singleOrNull()?.let { return it } + if (scopes.isEmpty()) { + return Empty + } return FirTypeIntersectionScope(session, overrideChecker, scopes, dispatchReceiverType) } }