Infer a record when passing an array as the template to 'type'