dotnet/command-line-api

`init` accessor of CliAction.Terminating cannot be called in C# 7

KalleOlaviNiemitalo opened this issue · 0 comments

#2205 changed the CliAction.Terminating property from { get; protected set; } to { get; protected init; } here:

/// <summary>
/// Indicates that the action terminates a command line invocation, and later actions are skipped.
/// </summary>
public bool Terminating { get; protected init; } = true;

The init accessor cannot be directly called in C# 7; it requires at least C# 9. That makes the property difficult to initialize in these cases:

#1586 was a similar issue about the init accessor of Option.Arity, fixed in #1595 by changing to set.