ansman
04/01/2025, 4:13 PMtitle: context(Component.Slot<Text>, Component.Slot<Icon>) RowScope.() -> Unit
fun Component.Slot<Text>.Text(...) {}
In Kotlin 2.1.10 this worked fine:
title = {
Title()
}
But in 2.1.20 this is an error with:
cannot be called in this context with an implicit receiver. Use an explicit receiver if necessary.
The issue is that you don't seem to be able to actually add a context receiver as there doesn't seem to be a way to access the context receiver.Chris Lee
04/01/2025, 4:19 PMansman
04/01/2025, 4:19 PMansman
04/01/2025, 4:23 PMansman
04/01/2025, 4:23 PMansman
04/01/2025, 4:28 PMansman
04/01/2025, 4:28 PMansman
04/01/2025, 4:29 PMKotlin compiler version 2.2 will be the last version that supports context receivers.
Consider migrating to extension receivers or regular parameters now.
Alternatively, migrate directly to context parameters when Kotlin 2.2 is released.
ansman
04/01/2025, 4:29 PMChris Lee
04/01/2025, 4:29 PMAlejandro Serrano.Mena
04/02/2025, 8:27 AMansman
04/02/2025, 12:34 PMAlejandro Serrano.Mena
04/02/2025, 12:35 PM-Xcontext-parameters
ansman
04/02/2025, 12:35 PMansman
04/02/2025, 12:35 PMAlejandro Serrano.Mena
04/02/2025, 12:36 PMansman
04/02/2025, 12:37 PMansman
04/02/2025, 12:37 PMAlejandro Serrano.Mena
04/02/2025, 12:38 PMansman
04/02/2025, 12:39 PMansman
04/02/2025, 1:04 PMAlejandro Serrano.Mena
04/02/2025, 1:05 PMansman
04/02/2025, 1:05 PMDaniel Pitts
04/03/2025, 2:25 AMansman
04/03/2025, 12:57 PMphldavies
04/24/2025, 9:01 AMcannot be called in this context with an implicit receiver. Use an explicit receiver if necessary.
) introduced in 2.1.20 in the cross-play of context-receivers (and context-parameters) with dslmarker - https://pl.kotl.in/SKLn3b26G
Weirdly enough, introducing a type-argument on the scope function "fixes" it and it resolves properly.Alejandro Serrano.Mena
04/24/2025, 9:09 AMphldavies
04/24/2025, 9:16 AMAlejandro Serrano.Mena
04/24/2025, 9:35 AMphldavies
04/24/2025, 10:21 AMansman
04/24/2025, 2:27 PM