mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
inline: insert cast to avoid changes in resolve (IDEA-152837; IDEA-155045)
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
|
||||
interface Vector<M> {
|
||||
M get(int i);
|
||||
}
|
||||
class Test {
|
||||
|
||||
private static void call(Vector args_) {
|
||||
Vector<String> ar<caret>gs = args_;
|
||||
|
||||
String s = args.get(0);
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
|
||||
interface Vector<M> {
|
||||
M get(int i);
|
||||
}
|
||||
class Test {
|
||||
|
||||
private static void call(Vector args_) {
|
||||
|
||||
String s = ((Vector<String>) args_).get(0);
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
|
||||
class Cat {}
|
||||
class DomesticCat extends Cat {}
|
||||
|
||||
class Test {
|
||||
public static void main(String[] args) {
|
||||
Cat c<caret>at = new DomesticCat();
|
||||
petCat(cat);
|
||||
}
|
||||
|
||||
static void petCat(Cat cat) {
|
||||
System.out.println("A Cat");
|
||||
}
|
||||
|
||||
static void petCat(DomesticCat domesticCat) {
|
||||
System.out.println("A DomesticCat");
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
|
||||
class Cat {}
|
||||
class DomesticCat extends Cat {}
|
||||
|
||||
class Test {
|
||||
public static void main(String[] args) {
|
||||
petCat((Cat) new DomesticCat());
|
||||
}
|
||||
|
||||
static void petCat(Cat cat) {
|
||||
System.out.println("A Cat");
|
||||
}
|
||||
|
||||
static void petCat(DomesticCat domesticCat) {
|
||||
System.out.println("A DomesticCat");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user