Seems that I found answer myself. As far as I understand type inference is working only for template functions but not struct or class templates. This is why this not working and enum is not responsible for that. I don't know why I use D enough long but I did not remember this fact.