Skip to content

Instantly share code, notes, and snippets.

@arkivanov
Created May 10, 2019 15:53
Show Gist options
  • Save arkivanov/90db53c6944ce725d168baea7c7d2899 to your computer and use it in GitHub Desktop.
Save arkivanov/90db53c6944ce725d168baea7c7d2899 to your computer and use it in GitHub Desktop.
Java invariance in Kotlin 2
fun bar(source: Observable<out CharSequence>) {
source.scan { a, b -> "$a,$b" } // Compilation error
}
fun foo(source: Observable<String>) {
bar(source)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment