Skip to content

Determine optimal formatting for ternary arguments #38588

Open

Description

The formatter doesn't produce readable code from the following expression:

CheckValidNullableMethodOverride(overridingMethod.DeclaringCompilation, overriddenMethod, overridingMethod, diagnostics,
checkReturnType ?
(diagnostics, overriddenMethod, overridingMethod, location) => diagnostics.Add(ErrorCode.WRN_NullabilityMismatchInReturnTypeOnOverride, location) :
(Action<DiagnosticBag, MethodSymbol, MethodSymbol, Location>)null,
checkParameters ?
(diagnostics, overriddenMethod, overridingMethod, overridingParameter, location) =>
{
diagnostics.Add(
ErrorCode.WRN_NullabilityMismatchInParameterTypeOnOverride,
location,
new FormattedSymbol(overridingParameter, SymbolDisplayFormat.ShortFormat));
}
:
(Action<DiagnosticBag, MethodSymbol, MethodSymbol, ParameterSymbol, Location>)null,
overridingMemberLocation);

However, it's not clear how this code should be formatted such that the result is readable.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions