mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 18:28:55 +07:00
lambda -> method reference: ensure functional type was not changed after transformation (IDEA-136163)
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
// "Replace lambda with method reference" "true"
|
||||
import java.util.prefs.Preferences;
|
||||
|
||||
class Test {
|
||||
|
||||
private Preferences preferences;
|
||||
|
||||
{
|
||||
foo(short.class, (Writer<Short>) Preferences::putInt);
|
||||
}
|
||||
|
||||
private <T> void foo(Class<T> type, Writer<T> writer) {}
|
||||
|
||||
interface Writer<T> {
|
||||
void write(Preferences preferences, String key, T value);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
// "Replace lambda with method reference" "true"
|
||||
import java.util.prefs.Preferences;
|
||||
|
||||
class Test {
|
||||
|
||||
private Preferences preferences;
|
||||
|
||||
{
|
||||
foo(short.class, (p, k, v) -> p.put<caret>Int(k, v));
|
||||
}
|
||||
|
||||
private <T> void foo(Class<T> type, Writer<T> writer) {}
|
||||
|
||||
interface Writer<T> {
|
||||
void write(Preferences preferences, String key, T value);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user