From 020bab1d7c9d54ad36f171f8997db9759327de64 Mon Sep 17 00:00:00 2001 From: Denis Zharkov Date: Thu, 3 Nov 2016 17:22:08 +0300 Subject: [PATCH] Minor. Get rid of possible exception when no runtime in class-path This change is made under the assumption that some version of built-in classes will always be available through `module.builtIns.getBuiltInClassByFqName` --- .../src/org/jetbrains/kotlin/codegen/JvmRuntimeTypes.kt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/JvmRuntimeTypes.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/JvmRuntimeTypes.kt index bcd3acd4b41..611860cd55b 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/JvmRuntimeTypes.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/JvmRuntimeTypes.kt @@ -59,11 +59,7 @@ class JvmRuntimeTypes(module: ModuleDescriptor) { * @return `Continuation` type */ private fun createNullableAnyContinuation(module: ModuleDescriptor): KotlinType { - // TODO: create a synthesized class descriptor here instead of looking at the classpath, or report a proper diagnostic - // This code will throw when compiling with "-no-stdlib" because no built-ins would be found in the classpath either - val classDescriptor = module.resolveTopLevelClass( - DescriptorUtils.CONTINUATION_INTERFACE_FQ_NAME, NoLookupLocation.FROM_BACKEND - ) ?: throw AssertionError("${DescriptorUtils.CONTINUATION_INTERFACE_FQ_NAME} was not found in built-ins") + val classDescriptor = module.builtIns.getBuiltInClassByFqName(DescriptorUtils.CONTINUATION_INTERFACE_FQ_NAME) return TypeConstructorSubstitution.createByParametersMap( mapOf(classDescriptor.declaredTypeParameters.single() to TypeProjectionImpl(module.builtIns.nullableAnyType))