Place the flour and icing sugar in a large bowl. Rub in the butter with your fingertips until the mixture resembles fine breadcrumbs.
Add the egg yolk and water and mix quickly so that it comes together to form a firm dough. Wrap in cling film and leave to rest in the fridge for about 30 minutes.
Preheat the oven to 200C/ Gas 6 (180C fan).
Roll out the pastry to form a circle about 5cm/2in larger than your flan tin. Line the tin with the pastry. Pop it into the fridge to chill for a further 15 minutes.
You now need to blind-bake the pastry. Prick the base of the pastry with a fork then line the pastry case with a circle of greaseproof paper and fill with baking beans (these are ceramic beads, but you can use lentils or dried beans if you don't have any). Bake the pastry for 10 minutes, or until just lightly golden-brown, then remove the paper and beans and return to the oven to cook for a further 5-7 minutes, or until golden-brown and dried out.
For the filling
Melt the butter in a medium pan over a low heat, then add the chocolate and stir until melted.
Remove from the heat and beat in the sugar and flour, then beat in the eggs, one at a time.
Pour the chocolate mixture into the pastry case, filling it almost to the top. Bake for 10-12 minutes, or until just set around the edges and still slightly wobbly in the centre.
Serve warm with raspberries or strawberries, or allow it to cool and dust with icing sugar.