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

Code before:
            var source = @"
class C
{
    A<> a1;
    A<T> a2;
    A<,> a3;
    A<T U> a4;
    A<,,> a5;
    A<T,> a6;
    A<,T> a7;
    A<T U,,> a8;
}
";
            CreateCompilation(source).VerifyDiagnostics(
                // (7,9): error CS1003: Syntax error, ',' expected
                //     A<T U> a4;
                Diagnostic(ErrorCode.ERR_SyntaxError, "U").WithArguments(",").WithLocation(7, 9),
                // (7,9): error CS0246: The type or namespace name 'U' could not be found (are you missing a using directive or an assembly reference?)
                //     A<T U> a4;
                Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "U").WithArguments("U").WithLocation(7, 9),
                // (11,9): error CS1003: Syntax error, ',' expected
                //     A<T U,,> a8;
                Diagnostic(ErrorCode.ERR_SyntaxError, "U").WithArguments(",").WithLocation(11, 9),
                // (8,5): error CS0246: The type or namespace name 'A<,,>' could not be found (are you missing a using directive or an assembly reference?)
                //     A<,,> a5;
                Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "A<,,>").WithArguments("A<,,>").WithLocation(8, 5),
                // (9,5): error CS0246: The type or namespace name 'A<,>' could not be found (are you missing a using directive or an assembly reference?)
                //     A<T,> a6;
                Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "A<T,>").WithArguments("A<,>").WithLocation(9, 5),
                // (10,5): error CS0246: The type or namespace name 'A<,>' could not be found (are you missing a using directive or an assembly reference?)
                //     A<,T> a7;
                Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "A<,T>").WithArguments("A<,>").WithLocation(10, 5),
                // (11,5): error CS0246: The type or namespace name 'A<,,,>' could not be found (are you missing a using directive or an assembly reference?)
                //     A<T U,,> a8;
                Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "A<T U,,>").WithArguments("A<,,,>").WithLocation(11, 5),
                // (4,5): error CS0246: The type or namespace name 'A<>' could not be found (are you missing a using directive or an assembly reference?)
                //     A<> a1;
                Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "A<>").WithArguments("A<>").WithLocation(4, 5),
                // (5,5): error CS0246: The type or namespace name 'A<>' could not be found (are you missing a using directive or an assembly reference?)
                //     A<T> a2;
                Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "A<T>").WithArguments("A<>").WithLocation(5, 5),
                // (5,7): error CS0246: The type or namespace name 'T' could not be found (are you missing a using directive or an assembly reference?)
                //     A<T> a2;
                Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "T").WithArguments("T").WithLocation(5, 7),
                // (6,5): error CS0246: The type or namespace name 'A<,>' could not be found (are you missing a using directive or an assembly reference?)
                //     A<,> a3;
                Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "A<,>").WithArguments("A<,>").WithLocation(6, 5),
                // (7,5): error CS0246: The type or namespace name 'A<,>' could not be found (are you missing a using directive or an assembly reference?)
                //     A<T U> a4;
                Diagnostic(ErrorCode.ERR_SingleTypeNameNotFound, "A<T U>").WithArguments("A<,>").WithLocation(7, 5),
                // (7,7): error CS0246: The type or namespace name 'T' could not be found (are you missing a using directive or an assembly reference?)

Review comment (bug):
@copilot since these are binding tests now, we should actually ensure that there is a `class A<T>` (and multiple type arg variants) to make sure that even if we bind to that type, we still fail because of the omitted type arguments. 

Code after:
                            }
                        }
                        N(SyntaxKind.SemicolonToken);
                    }
                    N(SyntaxKind.CloseBraceToken);
                }
                N(SyntaxKind.EndOfFileToken);
            }
            EOF();
        }

        [Fact]
        public void TypeArguments2()
        {
            var tree = UsingTree(@"
class C
{
    new C<>();
    new C<, >();
    C<C<>> a1;
    C<A<>> a1;
    object a1 = typeof(C<C<, >, int>);
    object a2 = Swap<>(1, 1);
}

class M<,> { }
", options: TestOptions.Regular,
                // (4,12): error CS1519: Invalid token '(' in class, record, struct, or interface member declaration
                //     new C<>();
                Diagnostic(ErrorCode.ERR_InvalidMemberDecl, "(").WithArguments("(").WithLocation(4, 12),
                // (4,13): error CS8124: Tuple must contain at least two elements.
                //     new C<>();
                Diagnostic(ErrorCode.ERR_TupleTooFewElements, ")").WithLocation(4, 13),
                // (4,14): error CS1519: Invalid token ';' in class, record, struct, or interface member declaration
                //     new C<>();
                Diagnostic(ErrorCode.ERR_InvalidMemberDecl, ";").WithArguments(";").WithLocation(4, 14),
                // (5,14): error CS1519: Invalid token '(' in class, record, struct, or interface member declaration
                //     new C<, >();
                Diagnostic(ErrorCode.ERR_InvalidMemberDecl, "(").WithArguments("(").WithLocation(5, 14),
                // (5,15): error CS8124: Tuple must contain at least two elements.
                //     new C<, >();
                Diagnostic(ErrorCode.ERR_TupleTooFewElements, ")").WithLocation(5, 15),
                // (5,16): error CS1519: Invalid token ';' in class, record, struct, or interface member declaration
                //     new C<, >();
                Diagnostic(ErrorCode.ERR_InvalidMemberDecl, ";").WithArguments(";").WithLocation(5, 16),
                // (12,9): error CS1001: Identifier expected
                // class M<,> { }
                Diagnostic(ErrorCode.ERR_IdentifierExpected, ",").WithLocation(12, 9),
                // (12,10): error CS1001: Identifier expected
                // class M<,> { }
                Diagnostic(ErrorCode.ERR_IdentifierExpected, ">").WithLocation(12, 10));