New J2K: retrieve constructor call return type correctly
#KT-33431 fixed
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
public class Person {
|
||||
private final String name;
|
||||
|
||||
public Person(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// RUNTIME_WITH_FULL_JDK
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class TestLambda {
|
||||
public static void main(String[] args) {
|
||||
List<String> names = Arrays.asList("A", "B");
|
||||
List<Person> people = names.stream().map(Person::new).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import java.util.Arrays
|
||||
import java.util.stream.Collectors
|
||||
|
||||
object TestLambda {
|
||||
@JvmStatic
|
||||
fun main(args: Array<String>) {
|
||||
val names: List<String> = Arrays.asList("A", "B")
|
||||
val people: List<Person?> = names.stream().map { name: String -> Person(name) }.collect(Collectors.toList())
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user