Skip to content

Instantly share code, notes, and snippets.

@tindzk
Created October 28, 2014 16:17
Show Gist options
  • Save tindzk/5b0323dad2308b6c9016 to your computer and use it in GitHub Desktop.
Save tindzk/5b0323dad2308b6c9016 to your computer and use it in GitHub Desktop.
Java variance annotations in Scala
// Java interface
interface ITextConverter {
public void nodesToText(List<? extends Object> nodes);
}
// Scala implementation
new ITextConverter {
override def nodesToText[T <: Object](nodes: java.util.List[T]) { ... } // Error: Does not override anything.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment