إذا نذر بصوم يوم النحر، وأيام التشريق يصح نذره؛ لأنه نذر بصوم مشروع
If someone vows to fast on the day of sacrifice or the days of tashrīq, the Hanafi discussion separates the legal formation of the vow from the prohibition of fasting on those days.
Fasting as such is an act of worship, so a vow concerning its genus can be recognized; fasting on those specified days remains prohibited. The validity of the vow is not permission to fast on Eid.
Fulfillment is discussed through fasting on an allowable day instead. Jurists differ over the underlying treatment of this vow.