A candidate's ability should be judged strictly on what are their abilities today and what is their perceived ceiling. While you can argue that years of experience correlates to those details, it certainly does not inform them.
Anecdotally, my most recent developer job post had an exactly 50:50 male to female applicant ratio. Without exception the women applying were juniors. If this article is to be believed, my putting even "1+ years of experience" might have arbitrarily rejected some number of otherwise qualified candidates.