mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-22 06:21:25 +07:00
ensure functional type for formal parameters lambda is valid after method reference replacement (IDEA-135053)
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
// "Replace lambda with method reference" "true"
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
class Test {
|
||||
public Test(String s) {}
|
||||
|
||||
public static void define(Supplier<?> moduleConstructor){}
|
||||
public static void define(Function<?, ?> moduleConstructor){}
|
||||
public static void define(BiFunction<?, ?, ?> moduleConstructor){}
|
||||
|
||||
{
|
||||
define((Function<String, Object>) Test::new);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// "Replace lambda with method reference" "true"
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
class Test {
|
||||
public Test(String s) {}
|
||||
|
||||
public static void define(Supplier<?> moduleConstructor){}
|
||||
public static void define(Function<?, ?> moduleConstructor){}
|
||||
public static void define(BiFunction<?, ?, ?> moduleConstructor){}
|
||||
|
||||
{
|
||||
define((String s) -> new Test<caret>(s));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user