dotnet / dotnet/roslyn

No IntelliSense in lambda body of ternary consequent expression when ternary alternative expression is missing or invalid

Open
#79,443 1 comment 0 reactions 1 assignee Claimed by @333fred View on GitHub
Area-Compilers
Dominant language
C#
Stars
20.7k
Forks
4.3k
PR merge metrics
PR metrics pending

Description

**Full issue information + repro project**:
https://github.com/just-ero/roslyn-issues-repros/tree/main/5.0.0/005_NoIntelliSense_FuncTernary

### Version

> [!NOTE]
> **Roslyn**: 5.0.0-1.25361.2 (fdd628a8)
> **.NET SDK**: 10.0.100-preview.6.25358.103
>
> **Visual Studio Code**: 1.102.1
> **C# Extension**: 2.86.19
> **C# Dev Kit Extension**: 1.40.25

### Steps to Reproduce

1. Add the following code wherever syntactically applicable:
```cs
void M()
{
Func f = true
? (i => i.ToString())
: (i => );
}
```
Note: Any invalid alternative expression results in the behavior.
2. Hover over `i.ToString()` to see no IntelliSense.

### Expected Behavior

The consequent expression is correctly recognized, IntelliSense is offered, and code has semantic highlighting.

### Actual Behavior

It does not.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.