infer spec type from location