Added pattern matching to HasAttributeConstraint