Minor, FunctionCodegen: add additional logging on missing function descriptor

Trying to diagnose light class building failures
This commit is contained in:
Pavel V. Talanov
2016-03-09 17:17:41 +03:00
parent fc16d7c4fd
commit 5de4ce6f57
@@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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) { public void gen(@NotNull KtNamedFunction function) {
SimpleFunctionDescriptor functionDescriptor = bindingContext.get(BindingContext.FUNCTION, function); SimpleFunctionDescriptor functionDescriptor = bindingContext.get(BindingContext.FUNCTION, function);
assert functionDescriptor != null : "No descriptor for function " + function.getText() + "\n" + if (functionDescriptor == null) {
"in " + function.getContainingFile().getVirtualFile(); throw ExceptionLogger.logDescriptorNotFound("No descriptor for function " + function.getName(), function);
}
if (owner.getContextKind() != OwnerKind.DEFAULT_IMPLS || function.hasBody()) { if (owner.getContextKind() != OwnerKind.DEFAULT_IMPLS || function.hasBody()) {
generateMethod(JvmDeclarationOriginKt.OtherOrigin(function, functionDescriptor), functionDescriptor, generateMethod(JvmDeclarationOriginKt.OtherOrigin(function, functionDescriptor), functionDescriptor,