Compiler misreporting CS0246: Type or namespace could not be found
- Dominant language
- C#
- Stars
- 20.7k
- Forks
- 4.3k
- PR merge metrics
- PR metrics pending
Description
Repro:
1. Checkout branch https://github.com/tmat/roslyn/tree/Bug78616
In this branch the namespace of `OneOrMany` type was changed from `Roslyn.Utilities` to `Microsoft.CodeAnalysis.Collections` but imports have not been updated yet.
2. Open Roslyn.sln in VS.
3. Open `AbstractEditAndContinueAnalyzer.cs` and navigate to line 1479

The statement does not access `OneOrMany`:
```C#
map.AddRange(memberBodyMap.Forward);
```
`map` is `Dictionary`
`memberBodyMap` is `DeclarationBodyMap`
`memberBodyMap.Forward` is `IReadOnlyDictionary`
The file even contains `using Microsoft.CodeAnalysis.Collections;`.
Is the error reported correcty?
Contributor guide
Research direction
Check out the Bug78616 branch and open Roslyn.sln in Visual Studio. Inspect AbstractEditAndContinueAnalyzer.cs around line 1479, including the types of map and memberBodyMap.Forward, and determine why the compiler reports CS0246 there despite the using directive. Done means explaining whether the diagnostic is correct and identifying the relevant compiler behavior or missing fix.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100