Messenger of Allah ﷺ forbade Al-Wisal in fasting. So, one of the Muslims said to him, "But you practice Al- Wisal. O Messenger of Allah ﷺ!" The Prophet ﷺ replied, "Who amongst you is similar to me? I am given food and drink during my sleep by my Lord." So, when the people refused to stop Al-Wisal (fasting continuously), the Prophet ﷺ fasted day and night continuously along with them for a day and then another day and then they saw the crescent moon (of the month of Shawwal). The Prophet ﷺ said to them (angrily), "If It (the crescent) had not appeared, I would have made you fast for a longer period." That was as a punishment for them when they refused to stop (practicing Al-Wisal). (Using translation from Bukhārī 1965)
نَهَى رَسُولُ اللهِ ﷺ عَنِ الْوِصَالِ فَقَالَ رَجُلٌ مِنَ الْمُسْلِمِينَ فَإِنَّكَ تُوَاصِلُ يَا رَسُولَ اللهِ قَالَ «وَأَيُّكُمْ مِثْلِي إِنِّي أَبِيتُ يُطْعِمُنِي رَبِّي وَيَسْقِينِي» فَلَمَّا أَبَوْا أَنْ يَنْتَهُوا وَاصَلَ بِهِمْ يَوْمًا ثُمَّ يَوْمًا ثُمَّ رَأَوُا الْهِلَالَ فَقَالَ «لَو تَأَخَّرَ لَزِدْتُكُمْ» كَالتَّنْكِيلِ بِهِمْ حِينَ أَبَوْا أَنْ يَنْتَهُوا