Could you please explain me, why it is so: ``` ...
# announcements
m
Could you please explain me, why it is so:
Copy code
var fullTariffList = mutableListOf<TariffInfo>()

    var testTariffList = listOf(TariffInfo(name="tariff_1"), TariffInfo(name="tariff_2"))

    testTariffList.forEach{ tariffInfo ->
        arrayOf("customer", "reseller", "vendor").forEach {tariffInfo.type = it; println(tariffInfo); fullTariffList.add(tariffInfo)}
    }
  println(fullTariffList);
Copy code
TariffInfo(type=customer, name=tariff_1)
TariffInfo(type=reseller, name=tariff_1)
TariffInfo(type=vendor, name=tariff_1)
TariffInfo(type=customer, name=tariff_2)
TariffInfo(type=reseller, name=tariff_2)
TariffInfo(type=vendor, name=tariff_2)
[TariffInfo(type=vendor, name=tariff_1), TariffInfo(type=vendor, name=tariff_1), TariffInfo(type=vendor, name=tariff_1), TariffInfo(type=vendor, name=tariff_2), TariffInfo(type=vendor, name=tariff_2), TariffInfo(type=vendor, name=tariff_2)]