Skip to content

Instantly share code, notes, and snippets.

@s1monw1
Created March 17, 2023 13:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save s1monw1/63193f52a68cbcd1a21a72eb72fe3633 to your computer and use it in GitHub Desktop.
Save s1monw1/63193f52a68cbcd1a21a72eb72fe3633 to your computer and use it in GitHub Desktop.
context(PrintingScope, TimeScope)
fun <K, V> Map<K, V>.customPrint() {
// ...
}
// get type in two different ways
val funType1: KFunction3<PrintingScope, TimeScope, Map<String, String>, Unit> =
Map<String, String>::customPrint
val funType2: context(PrintingScope, TimeScope) Map<String, String>.() -> Unit =
Map<String, String>::customPrint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment