Simak narrates from Atiyyah bin Jubayr (may Allah have mercy on him): My mother was nursing a child, and a child of ours had died. My father swore that he would not go near her until she weaned the child. When four months passed, it was said to him that she had become separated from him, so he informed Sayyiduna Ali (may Allah be pleased with him). He said: If you swore with the intent of harming her, she is your wife; otherwise she has become separated from you.
Imam al-Shafi'i (may Allah have mercy on him) said in his old opinion: Whoever holds this view should also say that likewise, if she has an ailment that intercourse would harm, or he began the oath and its form was not one of harm, then it is not ila; and this view has a good basis, and Allah knows best.
Others said: He is one who has taken an oath of ila, and every oath which prevents intercourse is ila. Al-Shafi'i stated this view explicitly in his new opinion, and argued that Allah Almighty revealed the ruling of ila without qualification, mentioning neither anger nor contentment in it.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الإيلاء / 15241