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

Function pointers are not encoded into XML docs #46674

Open
john-h-k opened this issue Aug 10, 2020 · 2 comments
Open

Function pointers are not encoded into XML docs #46674

john-h-k opened this issue Aug 10, 2020 · 2 comments
Labels

Comments

@john-h-k
Copy link
Contributor

john-h-k commented Aug 10, 2020

Version Used: Latest public preview

Steps to Reproduce:

/// <summary>
/// Registers a callback for when this <see cref="GpuTask"/> completes
/// </summary>
/// <typeparam name="T">The type of the state to be passed to <paramref name="onFinished"/></typeparam>
/// <param name="state">The <typeparamref name="T"/> to pass to <paramref name="onFinished"/></param>
/// <param name="onFinished">The callback to invoke when this <see cref="GpuTask"/> finishes</param>
public void RegisterCallback<T>(T state, delegate*<T, void> onFinished) where T : class => _awaiter.RegisterCallback(state, onFinished);
  1. Have this code
  2. Build this code
  3. Try to use XML output from this code

Expected Behavior: Function pointers are encoded in the XML, or at least compiler provides a warning

Actual Behavior: Function pointers are not encoded in the metadata and simply vanish,, no warning or messages are provided, e.g the XML output for above is

<member name="M:Voltium.Core.Memory.GpuTask.RegisterCallback``1(``0,)">
@GlebChili
Copy link

Can confirm same issue with Roslyn in dotnet sdk 5.0.100 (RTM).

Fragment of the code to generate docs:

         /// <summary>
        /// Pushes a given C# function pointer with native Cdecl calling convention onto the Lua stack.
        /// </summary>
        /// <remarks>
        /// Function which pointer is pushed onto the Lua stack must conform lua_CFunction specification as described here: https://www.lua.org/pil/26.1.html
        /// </remarks>
        /// <param name="function_pointer">C# function pointer with native calling convention Cdecl.</param>
        public unsafe void PushCFunction(delegate* unmanaged[Cdecl]<IntPtr, int> function_pointer);

Resulting XML docs:

        <member name="M:GmodNET.API.ILua.PushCFunction()">
            <summary>
            Pushes a given C# function pointer with native Cdecl calling convention onto the Lua stack.
            </summary>
            <remarks>
            Function which pointer is pushed onto the Lua stack must conform lua_CFunction specification as described here: https://www.lua.org/pil/26.1.html
            </remarks>
            <param name="function_pointer">C# function pointer with native calling convention Cdecl.</param>
        </member>

@saucecontrol
Copy link
Member

#48363 is about defining the DocID format. Implementation will be easy once the DocID is defined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants