Repository: dotnet/roslyn
File: src/Compilers/CSharp/Test/Symbol/Symbols/Source/MethodTests.cs (C#)

Code before:
}
";
            var comp = CreateCompilation(source);
            comp.VerifyDiagnostics();

            var syntax = comp.SyntaxTrees[0];
            var model = comp.GetSemanticModel(syntax);

            var type = syntax.GetRoot().DescendantNodes().OfType<ClassDeclarationSyntax>().Single();
            var methods = syntax.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().ToArray();

            var classC = model.GetDeclaredSymbol(type);
            var partialDef = model.GetDeclaredSymbol(methods[0]);
            var partialDefConstructed = partialDef.Construct(classC); // M<C>()

            Assert.True(partialDef.IsPartialDefinition);
            Assert.False(partialDefConstructed.IsPartialDefinition);

            var partialImpl = model.GetDeclaredSymbol(methods[1]);
            var partialImplConstructed = partialImpl.Construct(classC); // M<C>()

            Assert.False(partialImpl.IsPartialDefinition);
            Assert.False(partialImplConstructed.IsPartialDefinition);
        }

        [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/13456")]
        public void PartialMethodsLocationsAndSyntaxReferences()
        {
            var source1 = """
                namespace N1
                {
                    partial class C1
                    {
                        partial void PartialM();
                    }
                }
                """;

            var source2 = """
                namespace N1
                {
                    partial class C1
                    {
                        partial void PartialM() { }
                    }
                }
                """;

            var comp = CreateCompilation([(source1, "source1"), (source2, "source2")]);
            comp.VerifyDiagnostics();


Review comment (suggestion):
```suggestion
        [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/22598")]
``` #Closed

Code after:
}
";
            var comp = CreateCompilation(source);
            comp.VerifyDiagnostics();

            var syntax = comp.SyntaxTrees[0];
            var model = comp.GetSemanticModel(syntax);

            var type = syntax.GetRoot().DescendantNodes().OfType<ClassDeclarationSyntax>().Single();
            var methods = syntax.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().ToArray();

            var classC = model.GetDeclaredSymbol(type);
            var partialDef = model.GetDeclaredSymbol(methods[0]);
            var partialDefConstructed = partialDef.Construct(classC); // M<C>()

            Assert.True(partialDef.IsPartialDefinition);
            Assert.False(partialDefConstructed.IsPartialDefinition);

            var partialImpl = model.GetDeclaredSymbol(methods[1]);
            var partialImplConstructed = partialImpl.Construct(classC); // M<C>()

            Assert.False(partialImpl.IsPartialDefinition);
            Assert.False(partialImplConstructed.IsPartialDefinition);
        }

        [Fact, WorkItem("https://github.com/dotnet/roslyn/issues/22598")]
        public void PartialMethodsLocationsAndSyntaxReferences()
        {
            var source1 = """
                namespace N1
                {
                    partial class C1
                    {
                        partial void PartialM();
                    }
                }
                """;

            var source2 = """
                namespace N1
                {
                    partial class C1
                    {
                        partial void PartialM() { }
                    }
                }
                """;

            var comp = CreateCompilation([(source1, "source1"), (source2, "source2")]);
            comp.VerifyDiagnostics();