-
Notifications
You must be signed in to change notification settings - Fork 414
Closed
dotnet/dotnet
#2359Labels
Description
#2205 changed the CliAction.Terminating property from { get; protected set; } to { get; protected init; } here:
command-line-api/src/System.CommandLine/Invocation/CliAction.cs
Lines 15 to 18 in 104bb34
| /// <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:
- When targeting .NET Framework, where Microsoft does not support C# 8.
- When the application must remain buildable in Visual Studio 2017 (whose support ends in April 2027).
#1586 was a similar issue about the init accessor of Option.Arity, fixed in #1595 by changing to set.