Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CS1584, CS1658 produced on cref to method with function pointer parameter #50559

Closed
AArnott opened this issue Jan 16, 2021 · 2 comments
Closed
Assignees
Labels
Area-Compilers Bug Feature - Function Pointers Adding Function Pointers Resolution-Duplicate The described behavior is tracked in another issue
Milestone

Comments

@AArnott
Copy link
Contributor

AArnott commented Jan 16, 2021

Version Used: VS 16.9 Preview 4 (30912.315.main)

C# apparently cannot take a cref to a method where the full signature is specified if the signature contains a function pointer type.
Note that C# will even suggest via completion the syntax that then produces two warnings.

d063ac82-472b-486c-935e-b44df9ca84c5

Steps to Reproduce:

Sharplab

using System;
class PInvoke
{
    /// <inheritdoc cref = "X(delegate* unmanaged[Stdcall]{void*, void*, int})"/>
    internal static unsafe int Y() => throw new NotImplementedException();

    internal static unsafe int X(delegate* unmanaged[Stdcall]<void*, void*, int> IfCallback) => throw new NotImplementedException();
}

Expected Behavior:

No warnings

Actual Behavior:

Severity	Code	Description	Project	File	Line
Warning	CS1658	) expected. See also error CS1026.	GenerationSandbox.Tests (net472), GenerationSandbox.Tests (net5.0), GenerationSandbox.Tests (netcoreapp3.1)	D:\git\CsWin32\test\GenerationSandbox.Tests\Exp.cs	25
Warning	CS1584	XML comment has syntactically incorrect cref attribute 'X(delegate* unmanaged[Stdcall]{void*, void*, int})'	GenerationSandbox.Tests (net472), GenerationSandbox.Tests (net5.0), GenerationSandbox.Tests (netcoreapp3.1)	D:\git\CsWin32\test\GenerationSandbox.Tests\Exp.cs	25
@svick
Copy link
Contributor

svick commented Jan 16, 2021

I think this is a duplicate of #48363.

@jaredpar jaredpar added Bug and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Jan 20, 2021
@jaredpar jaredpar added this to the 16.10 milestone Jan 20, 2021
@jaredpar
Copy link
Member

Agree that looks like a dupe. That had fallen off my radar though. Got it properly triaged and closing this out as a dupe of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Bug Feature - Function Pointers Adding Function Pointers Resolution-Duplicate The described behavior is tracked in another issue
Projects
None yet
Development

No branches or pull requests

4 participants