mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
switch expression type: initial
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
class MyTest {
|
||||
<T> T foo(T t) {
|
||||
return t;
|
||||
}
|
||||
|
||||
void m(int i) {
|
||||
String s = foo(switch (i) {default -> "str";});
|
||||
String s1 = <error descr="Incompatible types. Required String but 'foo' was inferred to T:
|
||||
no instance(s) of type variable(s) exist so that Object conforms to String">foo(switch (i) {case 1 -> new Object(); default -> "str";});</error>
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user