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

@typeparam where is not being recognized #8572

Closed
MarvinKlein1508 opened this issue Apr 5, 2023 · 10 comments · Fixed by #8906
Closed

@typeparam where is not being recognized #8572

MarvinKlein1508 opened this issue Apr 5, 2023 · 10 comments · Fixed by #8906
Assignees
Labels
bug Something isn't working
Milestone

Comments

@MarvinKlein1508
Copy link

MarvinKlein1508 commented Apr 5, 2023

This works in latest stable VS release but not in VS 2022 Preview 2. The code does compile successfully and everything works as expected.
grafik

grafik

To reproduce check this file:
https://github.com/MarvinKlein1508/FormPortal/blob/master/FormPortal/Components/Admin/Forms/RuleEditor.razor

@ghost ghost added the untriaged label Apr 5, 2023
@davidwengier davidwengier added the area-compiler Umbrella for all compiler issues label Apr 5, 2023
@iikuzmychov
Copy link

iikuzmychov commented May 28, 2023

the same problem, where keyword doesn't work when I use .NET 7.

UPD: changing .NET 7 to .NET 6 and then back to .NET 7 helped me for some reason...

UPD 2: rebuild also helps, but it leave ghost errors

@chsienki
Copy link
Member

chsienki commented Jun 2, 2023

I hit this too, but the project F5 compiles fine, so it's something between the tooling and the design time code generation that's breaking, and I also observed switching TFM seemed to fix it.

Also reported here: https://stackoverflow.com/questions/72095268/net6-blazor-typeparam-where-constraint-error-rz1017

@davidwengier
Copy link
Member

Ran in to this today, and also noticed that @preservewhitespace was not classified, and the compiler was reporting an error. Changing the project file in any way seemed to fix it.

@MarvinKlein1508
Copy link
Author

Just a quick site note that this actually worked back in VS17.5

@chsienki
Copy link
Member

chsienki commented Jul 3, 2023

@davidwengier Do we think this is actually a compiler error, or something weird going on with the project system?

@davidwengier
Copy link
Member

Thats an interesting question I had not considered, but I happen to be looking at project system code right now, so will see if I can see anything interesting.

@davidwengier davidwengier added bug Something isn't working and removed untriaged area-compiler Umbrella for all compiler issues labels Jul 4, 2023
@ghost ghost added the untriaged label Jul 4, 2023
@davidwengier davidwengier added this to the 17.8 P1 milestone Jul 4, 2023
@davidwengier
Copy link
Member

Okay, dug in a bit, and I think this is tooling. FallbackRazorConfiguration.Latest is pointing to RazorLanguageVersion.Version3_0, when version 8 exists. Constrained generic components were introduced with version 6 it seems.

@MarvinKlein1508
Copy link
Author

@davidwengier when will this patch be available?

@davidwengier
Copy link
Member

@MarvinKlein1508 this will be out in the first preview of 17.8

@ghost ghost locked as resolved and limited conversation to collaborators Aug 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants