-
Notifications
You must be signed in to change notification settings - Fork 187
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
[dotnet-sdk-9.0.100-preview.3.24175.24] CS1646 error when building Hawaso #10186
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
@marcpopMSFT Could you please help check this issue and confirm if it is a blocker for .NET 9 Preview3? Thanks. |
This should be moved to the Roslyn repo most likely but I don't have permissions to move it. @jaredpar |
@chsienki is this in the razor generator or roslyn? |
@jaredpar from a glance it looks like razor |
Ah yeah, this is a fallout of the runtime fuse changes (so a real break). That #nullable restore
#line (8,20)-(8,36) "C:\projects\scratch\razorrepro9p3\Pages\Index.cshtml"
Convert.ToInt32(
#line default
#line hidden
#nullable disable
#nullable restore
#line (8,36)-(8,37) "C:\projects\scratch\razorrepro9p3\Pages\Index.cshtml"
@
#line default
#line hidden
#nullable disable
#nullable restore
#line (8,37)-(8,42) "C:\projects\scratch\razorrepro9p3\Pages\Index.cshtml"
count
#line default
#line hidden
#nullable disable
#nullable restore
#line (8,42)-(8,43) "C:\projects\scratch\razorrepro9p3\Pages\Index.cshtml"
) |
@Junjun-zhao this is a real issue, but niche enough that the Razor compiler team don't consider it a blocker for P3. |
We were not consistently handling recovery after seeing `@` signs in code blocks, which meant that there were all sorts of interesting scenarios where an escaped C# identifier would cause odd error recovery. There are a few edge cases that are now compile errors, but this is a more consistent overall experience. Fixes dotnet#10186 as well.
We were not consistently handling recovery after seeing `@` signs in code blocks, which meant that there were all sorts of interesting scenarios where an escaped C# identifier would cause odd error recovery. There are a few edge cases that are now compile errors, but this is a more consistent overall experience. Fixes dotnet#10186 as well.
We were not consistently handling recovery after seeing `@` signs in code blocks, which meant that there were all sorts of interesting scenarios where an escaped C# identifier would cause odd error recovery. There are a few edge cases that are now compile errors, but this is a more consistent overall experience. Fixes #10186 as well.
@333fred We verified this issue with the latest build 9.0.100-preview.5.24227.1, it is still reproducing. Could you please help to confirm whether the fix is merged into the build? Thanks. |
@Junjun-zhao can you link to that specific build please? Hard to verify without SHAs. Thanks. |
@333fred Please try with the build getting from https://aka.ms/dotnet/9.0.1xx/daily/dotnet-sdk-win-x64.exe |
Ok, I've dug into this a bit more; from what I can tell, all Fuse did here was expose the fact that |
And, to be clear, #10232 did not actually fix this, as I misunderstood the cause of the errors in this sample. |
…ng tag helpers Because of how we were rewriting tag helper attribute values, we didn't output a single, unified token when moving an implicit C# transition back to standard C#. This meant that, when we emit `#line` directives, we considered the `@` and the identifier that followed it to be separate tokens; when we added more precise info for FUSE, this then meant that they were emitted on separate lines during runtime codegen and everything fell apart. To fix this, we now unify those implicit transition tokens, rather than trying to keep them as separate tokens. Fixes #10186, for real this time.
…ng tag helpers Because of how we were rewriting tag helper attribute values, we didn't output a single, unified token when moving an implicit C# transition back to standard C#. This meant that, when we emit `#line` directives, we considered the `@` and the identifier that followed it to be separate tokens; when we added more precise info for FUSE, this then meant that they were emitted on separate lines during runtime codegen and everything fell apart. To fix this, we now unify those implicit transition tokens, rather than trying to keep them as separate tokens. Fixes #10186, for real this time.
…ng tag helpers (#10331) Because of how we were rewriting tag helper attribute values, we didn't output a single, unified token when moving an implicit C# transition back to standard C#. This meant that, when we emit `#line` directives, we considered the `@` and the identifier that followed it to be separate tokens; when we added more precise info for FUSE, this then meant that they were emitted on separate lines during runtime codegen and everything fell apart. To fix this, we now unify those implicit transition tokens, rather than trying to keep them as separate tokens. Fixes #10186, for real this time.
Thank you @333fred. We verified this issue with latest build dotnet-sdk-9.0.100-preview.5.24253.17, it has been fixed |
…ng tag helpers (dotnet#10331) Because of how we were rewriting tag helper attribute values, we didn't output a single, unified token when moving an implicit C# transition back to standard C#. This meant that, when we emit `#line` directives, we considered the `@` and the identifier that followed it to be separate tokens; when we added more precise info for FUSE, this then meant that they were emitted on separate lines during runtime codegen and everything fell apart. To fix this, we now unify those implicit transition tokens, rather than trying to keep them as separate tokens. Fixes dotnet#10186, for real this time. (cherry picked from commit 26ce354)
#10386 is the backport for servicing 17.10/8.0.3xx. |
* Correctly stitch `@` characters to following identifiers when rewriting tag helpers (#10331) Because of how we were rewriting tag helper attribute values, we didn't output a single, unified token when moving an implicit C# transition back to standard C#. This meant that, when we emit `#line` directives, we considered the `@` and the identifier that followed it to be separate tokens; when we added more precise info for FUSE, this then meant that they were emitted on separate lines during runtime codegen and everything fell apart. To fix this, we now unify those implicit transition tokens, rather than trying to keep them as separate tokens. Fixes #10186, for real this time. (cherry picked from commit 26ce354) * Update baseline for 17.10 code.
17.10.1 doesn't fix this issue for me as that still ships with 8.0.300 as far as I can see If you manually install 8.0.301 and then use global.json to target that specifically then it works. |
Actually, 8.0.301 doesn't fix it for us so it may not be the same issue. I've got a minimal repro for it so I'll create a new issue |
@MatthewSteeples the fix for this issue will be in 8.0.302 not 8.0.301. |
@jaredpar Not sure which issue you mean by "this" there. If you're referring to 10426 that's great. If you're referring to 10186 then it may be worth updating the release notes page because they indicate that 10186 is fixed and released already in 17.10.1 |
@MatthewSteeples it's a bit confusing because this bug exists in both VS and .NET SDK. While the bug fix goes into razor as a single change, it ships in both products and they ship on slightly different schedules. The VS portion of the fix will impact the design time aspect of razor: errors showing up when editting, the error list in Intellisense mode, etc ... The .NET SDK portion is needed to solve the actual build errors. |
Hi @jaredpar @MatthewSteeples , Verified it on the latest build 8.0.302, this issue has been fixed.
|
facing same issue after VS 2022 update to 17.10.1 |
I am still getting errors with this issue after updating VS2022 to 17.10.1. For the following razor syntax: I get: |
@ssugden The |
FYI, I still have the issue in VS2022 Community 17.10.1 with SDK 8.0.6 |
In VS2022 17.10.1, the
where The following errors occur:
The above builds successfully in VS2022 17.9.7. Also, there is related question in SO. |
Thanks everyone for your additional testing scenarios (both here and on vs feedback). I've added all the ones that weren't directly covered in #10471, but no code changes are required. 8.0.302, which is out today, addresses all the samples that have been submitted so far to my knowledge. There are still a few potential issues here, mainly around some particularly esoteric cases such as a tag helper attribute value that starts with I'm going to lock this thread to avoid the resolution getting buried. If anyone is still seeing issues on 8.0.302, please open a new issue so that we can triage appropriately. Thanks! |
Application Name: Hawaso
OS: Windows 10 22H2
CPU: X64
.NET Build Number: dotnet-sdk-9.0.100-preview.3.24175.24
App Source Location Checking at:
https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2012415
Github Link:
https://github.com/VisualAcademy/Hawaso
Verify Scenarios:
Description:
CS1646 error shows when we build Hawaso\Hawaso project with dotnet-sdk-9.0.100-preview.3.24175.24
Minimal Repro steps (Demo attached):
Demo.zip
The machine has dotnet-sdk-9.0.100-preview.3.24175.24 installed.
7.Build the app with 9.0.100-preview.3.24175.24 SDK
Expected Result: Build successfully.
Actual Result:
dotnet info:
@dotnet-actwx-bot @dotnet/compat
The text was updated successfully, but these errors were encountered: