Found out that Kotlin fails to correctly infer type arguments in a rather simple situation if you switch from using 2 argument function to extension function. Reported as an issue:
https://youtrack.jetbrains.com/issue/KT-40220
If anyone's interested, please vote for visibility. Or maybe you'll suggest a workaround, would be great!
This is my second inference related bug, the first one got lost it seems, I hope this one won't. I want to make a library with a nice API, this gets in a way 🙂