Skip to content

Commit

Permalink
Introduce variable does something really strange for expression in sq…
Browse files Browse the repository at this point in the history
…uare brackets

 #KT-2490 Fixed
  • Loading branch information
NataliaUkhorskaya committed Mar 7, 2013
1 parent d5b5fe8 commit 6bea999
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
Expand Up @@ -526,6 +526,9 @@ else if (parent.getParent() instanceof JetLoopExpression &&
((JetLoopExpression)parent.getParent()).getBody() != place) {
return true;
}
else if (parent.getParent() instanceof JetArrayAccessExpression) {
return true;
}
return false;
}

Expand Down
@@ -0,0 +1,9 @@
fun f(list: List<String>) {
val value = list[<selection>1 + 2</selection>]
}
/*
fun f(list: List<String>) {
val i = 1 + 2
val value = list[i]
}
*/
Expand Up @@ -137,6 +137,10 @@ public void testWhileCondition() {
doTest();
}

public void testArrayAccessExpr() {
doTest();
}

@Override
protected void setUp() throws Exception {
super.setUp();
Expand Down

0 comments on commit 6bea999

Please sign in to comment.