From 5de4ce6f57fbc4b8ae23477ddd2268d80f256e7f Mon Sep 17 00:00:00 2001 From: "Pavel V. Talanov" Date: Wed, 9 Mar 2016 17:17:41 +0300 Subject: [PATCH] Minor, FunctionCodegen: add additional logging on missing function descriptor Trying to diagnose light class building failures --- .../src/org/jetbrains/kotlin/codegen/FunctionCodegen.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/FunctionCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/FunctionCodegen.java index f43884ea36b..a19a96f13c5 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/FunctionCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/FunctionCodegen.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2015 JetBrains s.r.o. + * Copyright 2010-2016 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -108,8 +108,9 @@ public class FunctionCodegen { public void gen(@NotNull KtNamedFunction function) { SimpleFunctionDescriptor functionDescriptor = bindingContext.get(BindingContext.FUNCTION, function); - assert functionDescriptor != null : "No descriptor for function " + function.getText() + "\n" + - "in " + function.getContainingFile().getVirtualFile(); + if (functionDescriptor == null) { + throw ExceptionLogger.logDescriptorNotFound("No descriptor for function " + function.getName(), function); + } if (owner.getContextKind() != OwnerKind.DEFAULT_IMPLS || function.hasBody()) { generateMethod(JvmDeclarationOriginKt.OtherOrigin(function, functionDescriptor), functionDescriptor,