Abu Atiyyah (may Allah have mercy on him) said that his brother died, and his nursing child was there. Abu Atiyyah (may Allah have mercy on him) said to his wife: Nurse him. She said: I fear that you will make me pregnant. So Abu Atiyyah (may Allah have mercy on him) swore that as long as she nursed him, he would not come near her. She did so until she weaned him. He said: I mentioned this to Sayyiduna Ali (may Allah be pleased with him), and he said: You intended good, and ila only happens in a state of anger.
(b) Abu Atiyyah (may Allah have mercy on him) said that he married his brother's wife, and she was nursing his nephew.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الإيلاء / 15240
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