correct enum auto with function (closes #4135)