uqbar-project / wollok

Wollok Programming Language
GNU General Public License v3.0
60 stars 16 forks source link

Extract method is broken #703

Open flbulgarelli opened 8 years ago

flbulgarelli commented 8 years ago

If you try to do an extract method here:

object foo {

    method baz() {
        var x = 9
        return x * 3 + 7
    }
}

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.

matifreyre commented 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.

matifreyre commented 8 years ago

PR #975 fixes the this/self issue, but not the missing "return".

fdodino commented 7 years ago

Related to #712, I think they can be viewed both at same time

fdodino commented 7 years ago

Now when you try to do any extract method, extract local variable, it crashes like in #712

fdodino commented 5 years ago

issueRefactor

Tested today, is not failing, but still it could include parameters. Nevertheless, I think all refactors can be delayed for next generation IDE.

mmatos commented 5 years ago

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. imagen