access static via instance: ensure type params are attached to the class reference (IDEA-139440)

This commit is contained in:
Anna Kozlova
2015-04-24 12:59:31 +02:00
parent e5097dfc24
commit b61e8bdb39
3 changed files with 59 additions and 3 deletions

View File

@@ -0,0 +1,27 @@
// "Access static 'Bug.right(B)' via class 'Bug' reference" "true"
class Bug<A, B> {
public A getLeft() {
return null;
}
public B getRight() {
return null;
}
private boolean isRight() {
return false;
}
public static <A, B> Bug<A, B> left(A a) {
return null;
}
public static <A, B> Bug<A, B> right(B b) {
return null;
}
public Bug<A, B> foo() {
return isRight() ? Bug.<A, B>right(getRight()) : this.<A,B>left(getLeft());
}
}

View File

@@ -0,0 +1,27 @@
// "Access static 'Bug.right(B)' via class 'Bug' reference" "true"
class Bug<A, B> {
public A getLeft() {
return null;
}
public B getRight() {
return null;
}
private boolean isRight() {
return false;
}
public static <A, B> Bug<A, B> left(A a) {
return null;
}
public static <A, B> Bug<A, B> right(B b) {
return null;
}
public Bug<A, B> foo() {
return isRight() ? this.<A, B><caret>right(getRight()) : this.<A,B>left(getLeft());
}
}