Open flbulgarelli opened 8 years ago
When you extract the right side of this to a method:
var arma = armas.max({unArma => unArma.poder(poderBase)})
You get:
var arma = this.armaMasPoderosa()
and
method armaMasPoderosa() { armas.max({unArma => unArma.poder(poderBase)}) }
It still uses this instead of self, and the extracted method doesn't return anything, but it should.
PR #975 fixes the this/self issue, but not the missing "return".
Related to #712, I think they can be viewed both at same time
Now when you try to do any extract method, extract local variable, it crashes like in #712
Tested today, is not failing, but still it could include parameters. Nevertheless, I think all refactors can be delayed for next generation IDE.
In case this refactor is ever worked on, I'm adding another problem. I selected the condition in an if expression and extracted it to a method. The method extracted does not have return.
If you try to do an extract method here:
You get the same error as described here in #697
I tried selecting the whole
baz
method, the whole body, the return statement and the returned the expression, with same results.