-
Notifications
You must be signed in to change notification settings - Fork 190
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
Blazor Transpiler issue with named Tuples #7628
Comments
Thanks for contacting us. |
Here's another example of this issue: dotnet/aspnetcore#37209. |
I don't know if it's related to this, so before making a new issue, I am experience editor error on latest Visual Studio preview with tuple being the parameter of a component in blazor, I compile it, it works |
Can confirm this still repro's for me. @jjonescz Could you take a look? The repro in dotnet/aspnetcore#37209 is easy to reproduce it. |
When Blazor attempts at transpiling the following lines of code into a RenderFragment it combines the tuple type and name which generates a type that does not exists.
[Parameter] public Action<(ApiBase Sender, TResponse Response)> WhenSuccessful { get; set; }
Looking at the “razor.g.cs” file you will find the following transpiled code which is incorrect. Interestingly enough this happens to all, but the last parameter of the tuple.
public static void CreateApi_1<TRequest, TResponse>(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, int __seq0, TRequest __arg0, int __seq1, global::System.Net.Http.HttpMethod __arg1, int __seq2, global::System.String __arg2, int __seq3, global::System.Action<(global::ZoyaOpticalEHR.Common.Controls.Apis.ApiBaseSender, TResponse Response)> __arg3, int __seq4, TResponse __arg4, int __seq5, global::Microsoft.AspNetCore.Components.EventCallback<TResponse> __arg5, int __seq6, global::Microsoft.AspNetCore.Components.RenderFragment __arg6)
Notice in the generated code it combines the type and the name of the tuple property.
Using .Net 5.0, and the latest stable version of Visual Studio 2019 (Version 16.8.3)
The text was updated successfully, but these errors were encountered: