mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 13:02:30 +07:00
java switch expressions: infer Object if one of branches has null type (IDEA-241470)
GitOrigin-RevId: 489d3413091cbd1a85348fae0a428e29b287f7e0
This commit is contained in:
committed by
intellij-monorepo-bot
parent
6324dc91a2
commit
8aafb282f3
@@ -116,4 +116,12 @@ class MyTest {
|
||||
|
||||
System.out.println(c.getCanonicalName());
|
||||
}
|
||||
|
||||
static void testNull(int i) {
|
||||
var v = switch(i) {
|
||||
case 1 -> "abcd";
|
||||
default -> null;
|
||||
};
|
||||
System.out.println(v.<error descr="Cannot resolve method 'substring' in 'Object'">substring</error>(1));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user