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

Blazor Transpiler issue with named Tuples #7628

Closed
jontavakoli opened this issue Jan 2, 2021 · 4 comments · Fixed by #8085
Closed

Blazor Transpiler issue with named Tuples #7628

jontavakoli opened this issue Jan 2, 2021 · 4 comments · Fixed by #8085
Labels
area-compiler Umbrella for all compiler issues bug Something isn't working Priority:1 triaged
Milestone

Comments

@jontavakoli
Copy link

jontavakoli commented Jan 2, 2021

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)

@pranavkm pranavkm added the area-compiler Umbrella for all compiler issues label Jan 3, 2021
@ghost
Copy link

ghost commented Jan 13, 2021

Thanks for contacting us.
We're moving this issue to the Next sprint planning milestone for future evaluation / consideration. We will evaluate the request when we are planning the work for the next milestone. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@TanayParikh
Copy link
Contributor

TanayParikh commented Oct 19, 2021

Here's another example of this issue: dotnet/aspnetcore#37209.

@ghost ghost added the untriaged label Apr 12, 2022
@mkArtakMSFT mkArtakMSFT transferred this issue from dotnet/aspnetcore Apr 12, 2022
@mkArtakMSFT mkArtakMSFT transferred this issue from dotnet/razor Apr 12, 2022
@Xyncgas
Copy link

Xyncgas commented Jul 21, 2022

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

@chsienki chsienki transferred this issue from dotnet/razor-compiler Oct 28, 2022
@chsienki
Copy link
Contributor

chsienki commented Jan 5, 2023

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.

@chsienki chsienki added this to the 17.6 P1 milestone Jan 5, 2023
@ghost ghost removed the untriaged label Jan 5, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Feb 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-compiler Umbrella for all compiler issues bug Something isn't working Priority:1 triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants