public void VisitExtension(ComponentChildContentIntermediateNode node) { // Check that each child content has a unique parameter name within its scope. This is important // because the parameter name can be implict, and it doesn't work well when nested. if (node.IsParameterized) { for (var i = 0; i < Ancestors.Count - 1; i++) { var ancestor = Ancestors[i] as ComponentChildContentIntermediateNode; if (ancestor != null && ancestor.IsParameterized && string.Equals(node.ParameterName, ancestor.ParameterName, StringComparison.Ordinal)) { // Duplicate name. We report an error because this will almost certainly also lead to an error // from the C# compiler that's way less clear. node.Diagnostics.Add(BlazorDiagnosticFactory.Create_ChildContentRepeatedParameterName( node.Source, node, (ComponentExtensionNode)Ancestors[0], // Encosing component ancestor, // conflicting child content node (ComponentExtensionNode)Ancestors[i + 1])); // Encosing component of conflicting child content node } } } base.VisitDefault(node); }