bring var to scope: disabled for resource variables (IDEA-180436)

EA-61004 - assert: BringVariableIntoScopeFix.invoke
This commit is contained in:
Anna.Kozlova
2017-10-12 15:01:45 +02:00
parent 0056220d8b
commit f253087643
2 changed files with 26 additions and 1 deletions

View File

@@ -0,0 +1,25 @@
// "Bring 'Resource r' into scope" "false"
class IDEA121153 {
String foo()
{
try (Resource r = getResource()) {
}
return <caret>r.get();
}
public Resource getResource() {
return new Resource();
}
class Resource implements AutoCloseable{
@Override
public void close() {
}
public String get() {
return "";
}
}
}