From 0153f5d92a6b78dfb699e02f87ea82af5044f10c Mon Sep 17 00:00:00 2001 From: Artem Kobzar Date: Mon, 21 Mar 2022 18:53:04 +0000 Subject: [PATCH] chore: set isComplete flag also for interfaces that do not contain constructor fields. --- libraries/stdlib/js-ir/runtime/typeCheckUtils.kt | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/libraries/stdlib/js-ir/runtime/typeCheckUtils.kt b/libraries/stdlib/js-ir/runtime/typeCheckUtils.kt index fc572111ef3..c15e4aaa23d 100644 --- a/libraries/stdlib/js-ir/runtime/typeCheckUtils.kt +++ b/libraries/stdlib/js-ir/runtime/typeCheckUtils.kt @@ -153,15 +153,12 @@ private fun completeInterfaceCache(ctor: Ctor): IsImplementsCache? { } } - val constructor = fastGetPrototype(ctor)?.constructor ?: return null - val parentInterfacesCache = completeInterfaceCache(constructor) ?: return interfacesCache + val parentInterfacesCache = fastGetPrototype(ctor)?.constructor?.let(::completeInterfaceCache) - if (interfacesCache == null) return parentInterfacesCache - - interfacesCache.extendCacheWith(parentInterfacesCache) - interfacesCache.isComplete = true - - return interfacesCache + return interfacesCache?.apply { + extendCacheWith(parentInterfacesCache) + isComplete = true + } ?: parentInterfacesCache } // Old JS Backend