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

Warn when an @ is optional in an attribute value #9740

Open
davidwengier opened this issue Dec 19, 2023 · 4 comments · May be fixed by #10346
Open

Warn when an @ is optional in an attribute value #9740

davidwengier opened this issue Dec 19, 2023 · 4 comments · May be fixed by #10346
Labels
area-compiler Umbrella for all compiler issues untriaged
Milestone

Comments

@davidwengier
Copy link
Contributor

See dotnet/aspire#1449 for context, but in general there is code like:

<Component OnSomeEvent="DoSomething(context)" />

and the user changed it to:

<Component OnSomeEvent="@DoSomething(context)" />

This seemed to have no effect, but nobody is really sure what the rules are for whether the @ is necessary in this context or not. It would be great if the compiler could warn when it expects a C# expression, and encounters a C# implicit expression.

@davidwengier davidwengier added the area-compiler Umbrella for all compiler issues label Dec 19, 2023
@ghost ghost added the untriaged label Dec 19, 2023
@chsienki chsienki added this to the 17.10 Planning milestone Feb 10, 2024
@chsienki
Copy link
Contributor

@jjonescz Please take a look, thanks

@jjonescz
Copy link
Member

jjonescz commented Feb 21, 2024

We would need warning waves to avoid breaking users. (Another case where we need them: #9144)

Also feels like a question for language design whether we want this or not.

@jjonescz
Copy link
Member

@chsienki I'm not sure if you want me to work on this given what I've written above

@chsienki
Copy link
Contributor

@jjonescz Can you open an issue on the razor LDM for warning waves (if we don't already have one?) and start the email thread to discuss it? Seems like something we probably want to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-compiler Umbrella for all compiler issues untriaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants