Skip to content

Target-typed conditional expression doesn't handle typing well #81021

@DoctorKrolic

Description

@DoctorKrolic

Similar to #73894

Version Used:
Latest VS 2026 [11201.2]

Steps to Reproduce:

class C
{
    public DateTime M(bool b)
    {
        return b ? new($$) : default;
    }
}

Start typing ticks at $$

Expected Behavior:
I get ticks: completion since it is one of possible constructor parameters

Actual Behavior:
If you invoke competion in empty parens and start typing, the completion is shown. If you just start typing, it is not:
Image

Additional info:
The underlying issue here is similar to #78627: any error in one of branches knocks out all error recovery, so type information is lost:
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions