Start with the pastry. Put the flour, cornmeal, sugar and salt in a large bowl and whisk to combine.
Add the diced butter to the flour mix, and toss to coat.
Press each piece of butter flat with your fingertips – don’t overwork it – then stir in just enough water to bring the mix together into a smooth, but not wet ball of dough – you should need up to 100ml or so.
Tip the dough on a floured work surface and shape it into a roughly ¾cm-thick rectangle.
Fold the top third of the rectangle down into the centre, then fold the bottom third up over it. Turn the pastry 90 degrees, repeat the folds, then cut the pastry in half.
On a well-floured work surface, roll out one half of the pastry and use it to line a deep pie dish about 23cm in diameter, making sure there’s enough slightly to overhang the sides all the way around. Cover completely and chill for at least two hours and up to 12.
Roll out the other half of the pastry into a rectangle at least 25cm wide, then lift on to a floured flat baking tray or board, wrap well and chill.
Meanwhile, make the filling. Tip the defrosted bilberries into a sieve over a jug to catch their juices.
Put the blueberries into a large bowl with the sugar, salt and citrus juice, toss and leave to steep for a couple of hours, stirring occasionally, until the juices have really started to run and the berries look slightly deflated.
Drain the blueberry liquid into a small pan, pressing the berries gently while keeping them intact, then add the bilberry juice and 200g of the blueberries, and bring to a simmer.
Leave to simmer gently until the berries have broken down and the liquid has reduced and thickened slightly.
In a small bowl, whisk some of the berry juices into the arrowroot to make a loose paste, then stir this back into the pan until well combined and thickened.
Stir in the remaining blueberries and the bilberries, leave to cool, stirring occasionally, then, once completely cool, spoon the fruit filling into the chilled pie shell.
Cut the remaining pastry rectangle into roughly 2½cm-wide strips, then arrange these on top of the pie in a neat over-and-under lattice pattern.
Go all around the edge of the pie with the back of a fork, pressing the strips on to the rim of the dish, then return to the fridge and chill for at least another 30 minutes.
Heat the oven and a rimmed baking sheet lined with greaseproof paper to 220C (200C fan)/425F/gas 7.
Beat the egg with a splash of water, then brush all over the pastry, being careful not to smear any filling on to the pastry because it will burn during baking.
Sprinkle with more sugar, then put the pie in the oven for 25 minutes.
Turn down the heat to 200C (180C fan)/390F/gas 6 and bake for a further 45 minutes, or until the pastry is golden brown and the filling is bubbling in the centre.
Remove the pie from the oven and leave to cool down and set further before cutting into it.
