Working around a problem with shallow analysis

This commit is contained in:
Andrey Breslav
2012-03-09 17:35:29 +04:00
parent 4831940a7d
commit 1aadf98951
@@ -225,6 +225,8 @@ public class ClosureAnnotator {
public void visitFunctionLiteralExpression(JetFunctionLiteralExpression expression) {
String name = recordAnonymousClass(expression.getFunctionLiteral());
FunctionDescriptor declarationDescriptor = (FunctionDescriptor) bindingContext.get(BindingContext.DECLARATION_TO_DESCRIPTOR, expression);
// working around a problem with shallow analysis
if (declarationDescriptor == null) return;
ClassDescriptor classDescriptor = classDescriptorForFunctionDescriptor(declarationDescriptor, name);
recordName(classDescriptor, name);
recordEnclosing(classDescriptor);