In a medium saucepan, whisk together the sugar, cornstarch, and salt.
Gradually whisk in the whole milk until smooth.
Place the saucepan over medium heat and cook, stirring constantly, until the mixture thickens and comes to a boil, about 6-8 minutes.
Boil for 1 minute, continuing to stir constantly.
Remove the saucepan from the heat.
In a separate bowl, lightly beat the egg yolks.
Gradually whisk about 1 cup of the hot milk mixture into the egg yolks to temper them, then pour the egg mixture back into the saucepan with the remaining milk mixture, whisking constantly.
Return the saucepan to medium heat and cook, stirring constantly, for another 2 minutes until thickened.
Remove the saucepan from the heat and add the chopped chocolate, butter, and vanilla extract. Stir until the chocolate and butter are melted and the mixture is smooth.
Pour the pudding into the cooled crust and smooth the top.
Place plastic wrap directly on the surface of the pudding to prevent a skin from forming.
Refrigerate for at least 4 hours, or until set.