Files
Anna Kozlova 1f0f1acfbc [java] warn on non-instantiatable intersection types (IDEA-277529)
extend for any context

GitOrigin-RevId: d6f499348c8278bcb58951900ebf116440719082
2021-09-07 07:14:24 +00:00

10 lines
248 B
Java

class Test {
<S extends Runnable> S f() {
return null;
}
{
String m = <warning descr="Intersection type 'Runnable & String' cannot be instantiated, because 'java.lang.String' is final">f</warning>();
System.out.println(m);
}
}