fixed PY-9660 Convert Method to Property: provokes Getter should return something when converting function which has return without return value

This commit is contained in:
Ekaterina Tuzova
2013-05-11 13:07:35 +04:00
parent 465a0b05d5
commit 3a3f31d1b6
3 changed files with 10 additions and 1 deletions
@@ -49,8 +49,10 @@ public class PyConvertMethodToPropertyIntention extends BaseIntentionAction {
function.accept(new PyRecursiveElementVisitor() {
@Override
public void visitPyReturnStatement(PyReturnStatement node) {
available[0] = true;
if (node.getExpression() != null)
available[0] = true;
}
});
return available[0];
@@ -0,0 +1,3 @@
class A():
def mo<caret>o(self):
return
@@ -23,6 +23,10 @@ public class PyConvertMethodToPropertyIntentionTest extends PyIntentionTestCase
doNegateIntentionTest(PyBundle.message("INTN.convert.method.to.property"));
}
public void testEmptyReturn() throws Exception {
doNegateIntentionTest(PyBundle.message("INTN.convert.method.to.property"));
}
public void testNoReturn() throws Exception {
doNegateIntentionTest(PyBundle.message("INTN.convert.method.to.property"));
}