Support use of generics in closures