The problem has to do with the indeterminate nature of what would happen if MyClass had a subclass (because generics, such as Array, are not classes and don't magically do polymorphism). Just do what the error message says, and all will be well: