Peel and dice the squash into medium sized cubes.
Steam the squash for 20 minutes.
Finely chop the garlic and cut the mushrooms into strips.
Fry the garlic and mushrooms for a good 5 minutes in olive oil in a frying pan.
Crumble the chestnuts.
In a bowl, beat the egg with the cream.
Once the squash is cooked, crush it very coarsely with a fork in a lightly oiled gratin dish.
Add the mushrooms, the garlic and the chestnut pieces, and mix everything together gently.
Pour over the egg + cream mixture and mix again gently to homogenize.
Place a few slices of cheese on top and bake for 20 minutes at 180°C.