Warum darf sich eine 'continue'-Anweisung nicht in einem' finally'-Block befinden?
Ich habe kein problem Ich bin nur Neugierig. Stellen Sie sich folgendes Szenario vor:
foreach (var foo in list)
{
try
{
//Some code
}
catch (Exception)
{
//Some more code
}
finally
{
continue;
}
}
Dies wird nicht kompiliert, da es ausgelöst wirdCompilerfehler CS0157:
Die Kontrolle kann den Hauptteil einer finally-Klausel nicht verlassen
Warum?