@@ -14,8 +14,7 @@ namespace System.CommandLine.Subsystems.Annotations;
1414/// <typeparam name="TValue">The type of value to be stored</typeparam>
1515/// <param name="owner">The subsystem that this annotation store data for.</param>
1616/// <param name="id">The identifier for this annotation, since subsystems may have multiple annotations.</param>
17- /// <param name="defaultValue">The default value to return if the annotation is not set.</param>
18- public struct AnnotationAccessor < TValue > ( CliSubsystem owner , AnnotationId < TValue > id , TValue ? defaultValue = default )
17+ public struct AnnotationAccessor < TValue > ( CliSubsystem owner , AnnotationId < TValue > id )
1918{
2019 /// <summary>
2120 /// The identifier for this annotation, since subsystems may have multiple annotations.
@@ -36,18 +35,4 @@ public struct AnnotationAccessor<TValue>(CliSubsystem owner, AnnotationId<TValue
3635 /// <param name="value">The value to retrieve.</param>
3736 /// <returns>True if the value was found, false otherwise.</returns>
3837 public readonly bool TryGet ( CliSymbol symbol , [ NotNullWhen ( true ) ] out TValue ? value ) => owner . TryGetAnnotation ( symbol , Id , out value ) ;
39-
40- /// <summary>
41- /// Retrieve the value for the annotation and symbol
42- /// </summary>
43- /// <param name="symbol">The CliSymbol the value is for.</param>
44- /// <returns>The retrieved value or <see cref="defaultValue"/> if the value was not found.</returns>
45- public readonly TValue ? Get ( CliSymbol symbol )
46- {
47- if ( TryGet ( symbol , out var value ) )
48- {
49- return value ;
50- }
51- return defaultValue ;
52- }
5338}
0 commit comments