Created
October 28, 2014 16:17
-
-
Save tindzk/5b0323dad2308b6c9016 to your computer and use it in GitHub Desktop.
Java variance annotations in Scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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