mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
add type cast intention for poly expressions (IDEA-188731)
inference errors on poly expressions are not propagated to the expected type (variable declaration, return statement, etc) like for standalone expressions: dedicated intentions should be registered
This commit is contained in:
+13
@@ -0,0 +1,13 @@
|
||||
// "Cast to 'B'" "true"
|
||||
import java.util.*;
|
||||
|
||||
class A { }
|
||||
|
||||
class B extends A {
|
||||
public B getStrings() {
|
||||
return (B) getFirstItem(new ArrayList<A>());
|
||||
}
|
||||
|
||||
public static <T> T getFirstItem(Set<T> items) { return null; }
|
||||
public static <T> T getFirstItem(List<T> items) { return null; }
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// "Cast to 'B'" "true"
|
||||
import java.util.*;
|
||||
|
||||
class A { }
|
||||
|
||||
class B extends A {
|
||||
public B getStrings() {
|
||||
return get<caret>FirstItem(new ArrayList<A>());
|
||||
}
|
||||
|
||||
public static <T> T getFirstItem(Set<T> items) { return null; }
|
||||
public static <T> T getFirstItem(List<T> items) { return null; }
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// "Cast to 'B'" "false"
|
||||
import java.util.*;
|
||||
|
||||
class A { }
|
||||
|
||||
class B extends A {
|
||||
public B getStrings() {
|
||||
return get<caret>FirstItem(new ArrayList<A>());
|
||||
}
|
||||
|
||||
public static <T> T getFirstItem(Set<T> items) { return null; }
|
||||
public static <T> ArrayList<T> getFirstItem(List<T> items) { return null; }
|
||||
}
|
||||
Reference in New Issue
Block a user