Skip to content

Define documentation comment ID for function pointers #48363

Open
@svick

Description

The documentation comment ID format for function pointers doesn't seem to be defined. Consider the following code (using recent daily build of Roslyn):

string code = @"
class C
{
    unsafe void M(delegate*<int, void> p, int i) {}
}";

var tree = SyntaxFactory.ParseSyntaxTree(code);

var compilation = CSharpCompilation.Create(null, options: new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary, allowUnsafe: true))
	.AddSyntaxTrees(tree)
	.AddReferences(MetadataReference.CreateFromFile(typeof(object).Assembly.Location));
	
var method = compilation.GetSymbolsWithName("M").Single();
Console.WriteLine(DocumentationCommentId.CreateDeclarationId(method));
Console.WriteLine(method.GetDocumentationCommentId());

This prints:

M:C.M(,System.Int32)
M:C.M(,System.Int32)

which shows empty string as the documentation comment ID for a function pointer parameter.

The function pointers proposal doesn't define this format either.

How should the documentation comment ID format for function pointers look like? Once that's decided, the implementation should be updated so that documentation comment IDs for members with function pointers start working.

Originally reported at dotnet/csharplang#3978.

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions