There seem to be a disturbing myth saying that everything you eat right before bedtime magically turns to fat. This is not true, whatsoever!
These results show that eating at night is not associated with an increased propensity to gain weight, suggesting that individuals trying to lose weight should not rely on decreasing evening calorie intake as a primary strategy for promoting weight loss. – Source
There’s actually a study suggestion it might be preferable.
To conclude, ingestion of larger AM meals resulted in slightly greater weight loss, but ingestion of larger PM meals resulted in better maintenance of fat-free mass. Thus, incorporation of larger PM meals in a weight loss regimen may be important in minimizing the loss of fat-free mass. – Source
I do, however, recommend people to not eat right before bedtime because most of the times you don’t need it. It all comes down to how many calories you’ve consumed during the day. If you plan for a late meal then go ahead but if you’ll fall asleep within 1 – 2 hours you might want to skip the meal and just see the extra calories as progress towards your total weight lose goal.