1. Whisk together egg yolks, sugar, cornstarch, and salt in a heatproof bowl until thick and pale in color. Set aside.
2. In a medium saucepan, bring milk to a gentle boil. Whisk about half a cup of the hot milk into the egg yolks to temper them, so they won’t curdle, then, continuing to whisk, add the remainder of the milk in a steady stream.
3. Set the bowl over a medium saucepan of simmering water (do not let the bottom of the bowl touch the water) and cook the egg-milk mixture, whisking constantly, until thick and glossy, five to seven minutes.
4. Remove the bowl from heat and whisk in the vanilla and melted chocolate until well combined. Let the filling mixture sit for two minutes to cool slightly, then whisk in butter until the custard is smooth and silky. Place a piece of plastic wrap directly on top of the chocolate filling so that a skin does not form and let cool for 30 minutes, or until it reaches room temperature.
5. When the filling has cooled, pour it into the prepared crust. Cover the pie with plastic wrap and place it in the refrigerator to chill for at least three hours, or overnight.