mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
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:
+3
-1
@@ -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
|
||||
+4
@@ -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"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user