type compatibility constrain: unchecked conversion: return type is inference variable case

This commit is contained in:
Anna Kozlova
2014-01-31 21:41:17 +04:00
parent 5a9c00a259
commit f26b80359a
4 changed files with 37 additions and 6 deletions
@@ -0,0 +1,10 @@
public class Sample {
interface G<A> {}
interface G1 extends G {}
<B> B bar(B b) {return null;}
void f(G1 g1) {
G<String> l11 = bar(g1);
}
}
@@ -38,6 +38,10 @@ public class ConstraintsInferenceMiscTest extends LightDaemonAnalyzerTestCase {
doTest(false);
}
public void testTypeCompatibilityUncheckedConversionReturnConstraints() throws Exception {
doTest(false);
}
private void doTest(final boolean checkWarnings) {
doTestNewInference(BASE_PATH + "/" + getTestName(false) + ".java", checkWarnings, false);
}