Context receivers are superseded by context parameters starting from Kotlin 2.2.0. This inspection helps to migrate from context receivers to context parameters for projects that have enabled context receivers but have not yet migrated to context parameters syntax.
δΎ‹:
context(MutableList<String>, C)
private fun foo() {
add("new")
bar()
baz()
}
class C {
fun bar() {}
}
fun C.baz() {}
After the migration:
context(strings: MutableList<String>, c: C)
private fun foo() {
strings.add("new")
c.bar()
c.baz()
}
class C {
fun bar() {}
}
fun C.baz() {}