check enum and enum field constraints (closes #2018)