From d55d2c7bcfb9ad1d795555ec4a6a1e627dd89461 Mon Sep 17 00:00:00 2001 From: Nikolay Krasko Date: Mon, 4 Jun 2012 20:29:42 +0400 Subject: [PATCH] Add monitoring for out-of-block-modification in function literals --- .../org/jetbrains/jet/lang/psi/JetModifiableBlockHelper.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetModifiableBlockHelper.java b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetModifiableBlockHelper.java index 9fccc4574c5..e78f20432b1 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetModifiableBlockHelper.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/JetModifiableBlockHelper.java @@ -27,7 +27,6 @@ public final class JetModifiableBlockHelper { } // TODO: Need tests for this method - // TODO: Consider for FUNCTION_LITERALS public static boolean shouldChangeModificationCount(PsiElement place) { JetDeclaration declaration = PsiTreeUtil.getParentOfType(place, JetDeclaration.class, true); if (declaration != null) { @@ -47,6 +46,9 @@ public final class JetModifiableBlockHelper { return shouldChangeModificationCount(property); } + else if (declaration instanceof JetFunctionLiteral) { + return shouldChangeModificationCount(declaration); + } } return true;