You have to specify what type T is then. Instead of generic types, just make it a parent type. Then it works fine.