new inference: lambda compatibility: ground type constraint added

This commit is contained in:
Anna Kozlova
2014-02-03 19:35:45 +04:00
parent 11f8200f47
commit ef15e60ccf
3 changed files with 18 additions and 0 deletions
@@ -0,0 +1,13 @@
import java.util.List;
public class Sample {
interface Fun<A extends List <String>, B> {
B f(A a);
}
<T, R> void foo(Fun<? super T , R> f) {}
{
foo((List<String> ls) -> ls.size());
}
}
@@ -50,6 +50,10 @@ public class ConstraintsInferenceMiscTest extends LightDaemonAnalyzerTestCase {
doTest(false);
}
public void testLambdaGroundTest() throws Exception {
doTest(false);
}
private void doTest(final boolean checkWarnings) {
doTestNewInference(BASE_PATH + "/" + getTestName(false) + ".java", checkWarnings, false);
}