anonymous -> lambda: accept anonymous classes with inferred another type and ref to a parameter as the cast would be inserted (IDEA-157457)

This commit is contained in:
Anna Kozlova
2016-06-15 13:44:38 +03:00
parent fc4bbbde7c
commit f7fbc4b4bc
5 changed files with 36 additions and 43 deletions

View File

@@ -0,0 +1,20 @@
// "Replace with lambda" "true"
class DbTableBinder {
public Binder build() {
return (Binder<DbTable>) (q, dbTable) -> q.bind("name", dbTable.name);
}
}
class DbTable {
String name;
}
interface Binder <ArgType> {
void bind(A<?> sqlStatement, ArgType argType);
}
interface A<P> {
void bind(String s, String p);
}