A Java geek
  • Me
  • Books
  • Speaking
  • Mentions
  • Focus
  • Newsletters

context receiver

A collection of 1 posts
Toying with Kotlin's context receivers
Development

Toying with Kotlin's context receivers

Kotlin added the idea of Context Receivers in version 1.6.20. In this post, I’d like to toy with them to understand how useful they can be. If you want to play along, you’ll need to compile with the -Xcontext-receivers flag. The main idea behind context receivers is to pass additional parameters to a function without having to do it explicitly. A simplified model sample Let’s start with a simple example to show how it works.

May 15, 2022
A Java geek © 2008-2026
v. 9744a65fcb2ff5057d025d26766c50d6f934fc0b/13747693232
Latest Posts