mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
covariant return types: difference between java7 & java6 (IDEA-83599)
This commit is contained in:
+2
-2
@@ -7,7 +7,7 @@ interface Matcher<T> {
|
||||
}
|
||||
|
||||
interface ArgumentConstraintPhrases {
|
||||
<T> T with(Matcher<T> matcher);
|
||||
<error descr="'with(Matcher<T>)' clashes with 'with(Matcher<Boolean>)'; both methods have same erasure"><T> T with(Matcher<T> matcher)</error>;
|
||||
boolean with(Matcher<Boolean> matcher);
|
||||
byte with(Matcher<Byte> matcher);
|
||||
short with(Matcher<Short> matcher);
|
||||
@@ -19,7 +19,7 @@ interface ArgumentConstraintPhrases {
|
||||
|
||||
class ExpectationGroupBuilder implements ArgumentConstraintPhrases {
|
||||
|
||||
public <T> T with(final Matcher<T> matcher) {
|
||||
<error descr="'with(Matcher<T>)' clashes with 'with(Matcher<Boolean>)'; both methods have same erasure">public <T> T with(final Matcher<T> matcher)</error> {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
/** @noinspection UnusedDeclaration*/
|
||||
interface Matcher<T> {
|
||||
|
||||
boolean matches(Object object);
|
||||
|
||||
void _dont_implement_Matcher___instead_extend_BaseMatcher_();
|
||||
}
|
||||
|
||||
interface ArgumentConstraintPhrases {
|
||||
<T> T with(Matcher<T> matcher);
|
||||
boolean with(Matcher<Boolean> matcher);
|
||||
byte with(Matcher<Byte> matcher);
|
||||
int with(Matcher<Integer> matcher);
|
||||
long with(Matcher<Long> matcher);
|
||||
float with(Matcher<Float> matcher);
|
||||
double with(Matcher<Double> matcher);
|
||||
}
|
||||
|
||||
class ExpectationGroupBuilder implements ArgumentConstraintPhrases {
|
||||
|
||||
public <T> T with(final Matcher<T> matcher) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean with(final Matcher<Boolean> matcher) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public byte with(final Matcher<Byte> matcher) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int with(final Matcher<Integer> matcher) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public long with(final Matcher<Long> matcher) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public float with(final Matcher<Float> matcher) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public double with(final Matcher<Double> matcher) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user