A context receiver lets a Kotlin function require an additional receiver type. It addresses a limitation of member extension functions: useful extensions may need several receivers without modifying the original class. section 13.4.3
Adding a table context
context(Table) fun Column<Int>.autoIncrement(): Column<Int> { // access properties and methods of both Table and Column<Int> } The function extends Column<Int>, while context(Table) supplies the additional Table receiver needed by its implementation. section 13.4.3
This pattern suits internal DSLs such as database table definitions. The autoIncrement call can remain an extension on Column<Int> while also accessing its surrounding Table context. section 13.4.3
