有人能告诉我为什么编译器在下面的代码中认为这break
是必要的吗?yield return
foreach (DesignerNode node in nodeProvider.GetNodes(span, node => node.NodeType != NDjango.Interfaces.NodeType.ParsingContext))
{
switch (node.ErrorMessage.Severity)
{
case -1:
case 0:
continue;
case 1:
yield return new TagSpan<ErrorTag>(node.SnapshotSpan, new ErrorTag(PredefinedErrorTypeNames.Warning));
break;
default:
yield return new TagSpan<ErrorTag>(node.SnapshotSpan, new ErrorTag(PredefinedErrorTypeNames.SyntaxError));
break;
}
}