https://kotlinlang.org logo
#announcements
Title
# announcements
j

jw

10/10/2017, 4:17 AM
.map(::MyClass)
q

qwert_ukg

10/10/2017, 4:19 AM
how it will be?
use map like this
listOf("str").map {MyClass(it)}
👍 1
e

ersin_ertan

10/10/2017, 4:53 AM
Jake's implementation uses the map function call notation(not a lambda) because the argument is a method reference for `MyClass`'s constructor(which will implicitly use
it
as the constructor argument)
q

qwert_ukg

10/10/2017, 5:08 AM
how it will be on my example?
k

karelpeeters

10/10/2017, 5:31 AM
Again, his exact code should work fine.
j

judrummer

10/10/2017, 7:33 AM
listOf("str").map(::MyClass) . is same as listOf("str").map{ MyClass(it) }