Refactoring the name of a class with Context Bound
When I have a class
class Foo[A: Bar] {
...
}
and choose to refactor the name to Foo2, the wizard will change the class to
class Foo[A] :Barr] { //<--- [A] !
...
}
thus resulting in a syntax error.
class Foo[A: Bar] {
...
}
and choose to refactor the name to Foo2, the wizard will change the class to
class Foo[A] :Barr] { //<--- [A] !
...
}
thus resulting in a syntax error.
Leave a comment
on 2013-11-16 23:59 *
By justjoheinz
Of course it would be class Foo2[A] :Barr]
on 2013-11-17 03:06 *
By Simon Schäfer
Can't reproduce that problem. How is
Bar
defined? Are your classes toplevel or nested?
on 2013-11-17 03:11 *
By justjoheinz
E.g.
package util
import play.api.libs.json.Writes
class Test2[A ]: Writes] {
}
where writes is just some class from the play project.
Above is the result after the refactoring.
package util
import play.api.libs.json.Writes
class Test2[A ]: Writes] {
}
where writes is just some class from the play project.
Above is the result after the refactoring.
on 2013-11-17 03:15 *
By justjoheinz
Even simpler:
package util
class Foo[A] {}
class Test3[A: Foo] {
}
package util
class Foo[A] {}
class Test3[A: Foo] {
}
on 2013-11-17 03:19 *
By justjoheinz
And one more : just tried it with a view bound:
package util
class Bar {}
class Test4[A ]<% Bar] {
}
Here again displayed after the refactoring.
package util
class Bar {}
class Test4[A ]<% Bar] {
}
Here again displayed after the refactoring.
on 2013-11-17 03:26 *
By justjoheinz
AND it only happens when you use the keyboard Cmd-Alt R combination to start refactoring, not when you use the context menu!
Still can't reproduce it, neither with 4.0M1 nor with the nightly.
on 2013-11-17 20:02 *
By justjoheinz
Strange, I just did a complete fresh reinstall with Kepler and the 4.00M1 build from the dev update site and still get the problem. i also asked around in our Scala User Group and there the problem is not reproducable. Still - the fact that the error occurs when using the keyboard shortcut and not the context menu must point to some difference in the code.
on 2013-11-17 23:52 *
By Simon Schäfer
Both the keyboard shortcut and the context menu refer to the very same rename action. Maybe it is some operation system specific stuff, I only have Linux, thus can't test it on a Mac.
on 2013-11-20 06:56 *
By justjoheinz
Hmm, just to keep the bug going: just downgraded to scala-ide 3 and still have the same problem. I tried to experiment a little bit with the edtor bracket completion features to see if they have an influence but could not find any setting which makes a difference. I also haven't managed to find anyone to reproduce the problem yet :-(
on 2013-11-20 08:08 *
By Simon Schäfer
I could reproduce this w/ the latest 4.0.0 nightly.
Skip tree printing for rename refactorings
This commit implements rename refactorings without employing tree printing.
The ASTs from the presentation compiler are only used to find all occurrences
of the symbol that is being renamed. This information is then used to generate
changes directly.
Fix #1002643, Fix #1002622, Fix #1001966
Branch: master
Commit: scala-ide:0d8fab7dff
This commit implements rename refactorings without employing tree printing.
The ASTs from the presentation compiler are only used to find all occurrences
of the symbol that is being renamed. This information is then used to generate
changes directly.
Fix #1002643, Fix #1002622, Fix #1001966
Branch: master
Commit: scala-ide:0d8fab7dff