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

Code before:
                            {
                                N(SyntaxKind.IdentifierToken, "X");
                            }
                        }
                        N(SyntaxKind.DotToken);
                        N(SyntaxKind.IdentifierName);
                        {
                            N(SyntaxKind.IdentifierToken, "Y");
                        }
                    }
                    N(SyntaxKind.DotToken);
                    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);

Review comment (suggestion):
@copilot the new tests (and any tests you modified) should have `[Fact, WorkItem("...")]` to associate them with the issue being fixed.  

For tests that now no longer report a syntax error, we need to make a compilation and verify diagnostics on it to make sure that we are reporting a binding error.

Code after:
                            {
                                N(SyntaxKind.IdentifierToken, "X");
                            }
                        }
                        N(SyntaxKind.DotToken);
                        N(SyntaxKind.IdentifierName);
                        {
                            N(SyntaxKind.IdentifierToken, "Y");
                        }
                    }
                    N(SyntaxKind.DotToken);
                    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),