Wrong binder used in `SwitchExpressionBinder` logic
- Dominant language
- C#
- Stars
- 20.7k
- Forks
- 4.3k
- PR merge metrics
- PR metrics pending
Description
It is possible for the semantic model to add some more specific binders to the binder chain. But in `BindSwitchExpression` we call `BindSwitchExpressionCore` which walks the binder chain (with `.Next`) until a `SwitchExpressionBinder` is reached. That binder is then used to bind the operand.
But when binding expressions, we should be either using the original binder or one derived from the original binder using `GetBinder` (which gives the opportunity for binders injected by the semantic model to maintain themselves).
Contributor guide
Research direction
Start at BindSwitchExpression and trace how BindSwitchExpressionCore walks the binder chain to SwitchExpressionBinder. Verify how the operand is bound and how GetBinder can preserve binders injected by the semantic model; done means the original or appropriately derived binder is used instead of the traversed binder.
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
- 45/100