Add test for inferring type from defaults