It is not compulsory to file when you have losses but if you want these losses are carried forward then you must file return within dua date then you can carry forward your losses in next year and you can adjust the same in income of next year but if you do not file within due date then you can not carry forward your losses in next year incometax
NOTE: If you satisfy with my reply kindly like my comment it will increase motivation to me help other people