turn invoke into macro that inlines values by type