I'm struggling to understand this. I want a list ...
# getting-started
w
I'm struggling to understand this. I want a list of MerchantRecord -> String? I've got the following code.
Copy code
private fun toTree(inputRecords: List<MerchantRecord>) {
		val byMerchant: (MerchantRecord) -> String? = { it.merchantName }
		val byAccount: (MerchantRecord) -> String? = { it.accountName }

		val groupings = listOf({ it.masterMerchantName }, { it.portfolio }, byMerchant, byAccount)
		toTree(inputRecords, groupings)
	}
And In intellij I can refactor inline. ByAccount or byMerchant however as soon as I refactor the last entry it complains.