Created
February 11, 2019 12:05
-
-
Save polyglotpiglet/8487d4a3faba40321dd52ca3f844dbce to your computer and use it in GitHub Desktop.
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
| import java.util.Arrays; | |
| import java.util.Collection; | |
| import java.util.List; | |
| public class Main { | |
| public interface Cat { | |
| } | |
| private static class Tortie implements Cat { | |
| } | |
| public static void main(String... args) { | |
| DoStuff<Cat> catDoStuff = new DoStuff<>(); | |
| List<Tortie> torties = Arrays.asList(new Tortie()); | |
| catDoStuff.go(torties); // sad | |
| } | |
| public static class DoStuff<T extends Cat> { | |
| void go(Collection<T> items) { | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment