dotnet / dotnet/roslyn

Hot Reload fails to apply change with "Unexpected null - file EditSession.cs line 705"

Open
#75,567 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
20.7k
Forks
4.3k
PR merge metrics
PR metrics pending

Description

I was debugging Roslyn, and did the following steps:
- In `src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs`, I went through the entire `AddMethod` method once, which branched into `method.MethodKind == MethodKind.Conversion`, but didn't return control back to the caller.
- I then moved the current statement cursor back to the return statement within the branch mentioned above.
- Stepped into the `ConversionGenerator.AddConversionTo` method.
- Replaced the `explicitInterfaceSpecifier:` argument with a copy-pasted argument
- Added a parameter to `GenerateModifiers` before `CodeGenerationDestination destination`, and also adjusted the inner body.
- Removed parentheses from the collection expressions that were contained within the body.
- Used the new parameter that was inserted.

I don't know how to find more detailed logs.

Contributor guide

Open the contributing guide

Research direction

Start with the debugging sequence in src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs, especially AddMethod and ConversionGenerator.AddConversionTo, then inspect EditSession.cs at line 705. Reproduce the Hot Reload edit and determine why it reports "Unexpected null"; done means the described change applies without that failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
compilers, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.