Prevent expression selector from selecting just a label
Previously, extract variable could act on e.g. 'break@outerLoop' and extract the label, leading into nonsensical 'val x = @outerLoop'. Prevent JetRefactoringUtil.selectExpression from returning label expressions to fix this. #KT-4515 Fixed
This commit is contained in:
committed by
Nikolay Krasko
parent
998d2c5ec8
commit
7a2321460d
@@ -0,0 +1,7 @@
|
||||
fun f() {
|
||||
@loop while (true) {
|
||||
break@lo<selection>o</selection>p
|
||||
}
|
||||
}
|
||||
// KT-4515: Extract variable can attempt to extract a label from a labelled statement.
|
||||
/* break@loop */
|
||||
@@ -0,0 +1,6 @@
|
||||
class Foo() {
|
||||
val s = this@F<selection>o</selection>o.toString()
|
||||
}
|
||||
|
||||
// KT-4515: Extract variable can attempt to extract a label from a labelled statement.
|
||||
/* this@Foo */
|
||||
Reference in New Issue
Block a user