Skip to content

Instantly share code, notes, and snippets.

@arkivanov
Created May 10, 2019 15:56
Show Gist options
  • Save arkivanov/ed44ced9e6ca93fe72357de997b09bd0 to your computer and use it in GitHub Desktop.
Save arkivanov/ed44ced9e6ca93fe72357de997b09bd0 to your computer and use it in GitHub Desktop.
Java invariance in Kotlin 3
fun bar(consumer: Consumer<String>) {
}
fun foo(consumer: Consumer<CharSequence>) {
bar(consumer) // Compilation error
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment