Repository: dotnet/roslyn
File: src/Compilers/CSharp/Test/Syntax/Parsing/NameParsingTests.cs (C#)

Code before:
                    N(SyntaxKind.IdentifierName);
                    {
                        N(SyntaxKind.IdentifierToken, "Z");
                    }
                }
                N(SyntaxKind.ColonToken);
                N(SyntaxKind.DefaultLiteralExpression);
                {
                    N(SyntaxKind.DefaultKeyword);
                }
            }
            EOF();
        }

        [Fact]
        public void ParseGenericNameInvocationWithPartiallyOmittedTypeArguments()
        {
            // Tests for partially closed generic type names where the first type argument is missing
            var source = """
                class C
                {
                    void M<T1, T2>()
                    {
                        M<,int>();      // First argument omitted
                        M<string,>();   // Second argument omitted
                        M<,int,>();     // First and third arguments omitted (if we had 3 params)
                    }
                }
                """;

            UsingTree(source);

            N(SyntaxKind.CompilationUnit);
            {
                N(SyntaxKind.ClassDeclaration);
                {
                    N(SyntaxKind.ClassKeyword);
                    N(SyntaxKind.IdentifierToken, "C");
                    N(SyntaxKind.OpenBraceToken);
                    N(SyntaxKind.MethodDeclaration);
                    {
                        N(SyntaxKind.PredefinedType);
                        {
                            N(SyntaxKind.VoidKeyword);
                        }
                        N(SyntaxKind.IdentifierToken, "M");
                        N(SyntaxKind.TypeParameterList);
                        {
                            N(SyntaxKind.LessThanToken);
                            N(SyntaxKind.TypeParameter);
                            {

Review comment (suggestion):
@copilot  add variants with ,, as well.

Also, we should validate that we get proper binding diagnostics in these cases. We don't want this to accidentally be accepted.

Code after:
                    N(SyntaxKind.IdentifierName);
                    {
                        N(SyntaxKind.IdentifierToken, "Z");
                    }
                }
                N(SyntaxKind.ColonToken);
                N(SyntaxKind.DefaultLiteralExpression);
                {
                    N(SyntaxKind.DefaultKeyword);
                }
            }
            EOF();
        }

        [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/71379")]
        public void ParseGenericNameInvocationWithPartiallyOmittedTypeArguments()
        {
            // Tests for partially closed generic type names where the first type argument is missing
            var source = """
                class C
                {
                    void M<T1, T2>()
                    {
                        M<,int>();      // First argument omitted
                        M<string,>();   // Second argument omitted
                        M<,int,>();     // First and third arguments omitted (if we had 3 params)
                    }
                }
                """;

            UsingTree(source,
                // (5,11): error CS1031: Type expected
                //         M<,int>();      // First argument omitted
                Diagnostic(ErrorCode.ERR_TypeExpected, ",").WithLocation(5, 11),
                // (6,18): error CS1031: Type expected
                //         M<string,>();   // Second argument omitted
                Diagnostic(ErrorCode.ERR_TypeExpected, ">").WithLocation(6, 18),
                // (7,11): error CS1031: Type expected
                //         M<,int,>();     // First and third arguments omitted (if we had 3 params)
                Diagnostic(ErrorCode.ERR_TypeExpected, ",").WithLocation(7, 11),
                // (7,16): error CS1031: Type expected
                //         M<,int,>();     // First and third arguments omitted (if we had 3 params)
                Diagnostic(ErrorCode.ERR_TypeExpected, ">").WithLocation(7, 16));

            N(SyntaxKind.CompilationUnit);
            {
                N(SyntaxKind.ClassDeclaration);
                {
                    N(SyntaxKind.ClassKeyword);
                    N(SyntaxKind.IdentifierToken, "C");
                    N(SyntaxKind.OpenBraceToken);