inline parameter: assignment to local variable between its declaration and the call causes the incompilable code (IDEA-52164)

This commit is contained in:
anna
2010-02-11 17:56:33 +03:00
parent 208129c56b
commit 2d7473841b
3 changed files with 47 additions and 0 deletions
@@ -228,6 +228,15 @@ public class InlineParameterTest extends LightCodeInsightTestCase {
}
}
public void testWriteAccess() throws Exception {
try {
doTest(false);
}
catch (BaseRefactoringProcessor.ConflictsInTestsException e) {
assertEquals("Parameter initializer depends on value which is not available inside method and cannot be inlined", e.getMessage());
}
}
private void doTest(final boolean createLocal) throws Exception {
getProject().putUserData(InlineParameterExpressionProcessor.CREATE_LOCAL_FOR_TESTS,createLocal);