mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-01 02:38:59 +07:00
[java-inspections] IDEA-287311 Bug: Inspection 'bring variable into scope' introduces Compilation error when used with 'var'
GitOrigin-RevId: 85f7f526ec1cee6533f441bf42bc43b1b0bb8be1
This commit is contained in:
committed by
intellij-monorepo-bot
parent
eea5b2207e
commit
c7ed6477fb
@@ -0,0 +1,11 @@
|
||||
// "Bring 'String msg' into scope" "true"
|
||||
public class BringVarIntoScope {
|
||||
public void moveVariableDeclarationOutOfBlock(boolean b) {
|
||||
String msg;
|
||||
if (b) {
|
||||
msg = "Leap year";
|
||||
} else {
|
||||
msg = "Not a leap year";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Bring 'String msg' into scope" "true"
|
||||
public class BringVarIntoScope {
|
||||
public void moveVariableDeclarationOutOfBlock(boolean b) {
|
||||
if (b) {
|
||||
var msg = "Leap year";
|
||||
} else {
|
||||
<caret>msg = "Not a leap year";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user