kevinmost
myList.map { when(it.someMethod()) { ... // "it" would have previously been provided by .map {...}, but is now provided by the when block and is of a different type } }