@@ -209,7 +209,12 @@ public static string GetAccessibilityModifier(Accessibility accessibility)
209209 /// Gets the abstract modifier for this type context.
210210 /// </summary>
211211 /// <returns>A string representing the abstract modifier, such as "abstract " or an empty string.</returns>
212- public string GetAbstractModifier ( ) => GetAbstractModifier ( IsAbstract ) ;
212+ public string GetAbstractModifier ( )
213+ {
214+ if ( TypeDeclarationKeyword == "interface" )
215+ return "" ; // implicitly abstract
216+ return GetAbstractModifier ( IsAbstract ) ;
217+ }
213218 /// <summary>
214219 /// Gets the abstract modifier for a given abstract status.
215220 /// </summary>
@@ -221,13 +226,18 @@ public static string GetAccessibilityModifier(Accessibility accessibility)
221226 /// Gets the sealed modifier for this type context.
222227 /// </summary>
223228 /// <returns>A string representing the sealed modifier, such as "sealed " or an empty string.</returns>
224- public string GetSealedModifier ( ) => GetSealedModifier ( IsSealed ) ;
229+ public string GetSealedModifier ( )
230+ {
231+ if ( TypeDeclarationKeyword == "struct" || TypeDeclarationKeyword == "record struct" )
232+ return "" ; // implicitly sealed
233+ return GetSealedModifier ( IsSealed ) ;
234+ }
225235 /// <summary>
226236 /// Gets the sealed modifier for a given sealed status.
227237 /// </summary>
228- /// <param name="isSealead ">The sealed status of the type.</param>
238+ /// <param name="isSealed ">The sealed status of the type.</param>
229239 /// <returns>A string representing the sealed modifier, such as "sealed " or an empty string.</returns>
230- public static string GetSealedModifier ( bool isSealead ) => isSealead ? "sealed " : "" ;
240+ public static string GetSealedModifier ( bool isSealed ) => isSealed ? "sealed " : "" ;
231241
232242 /// <summary>
233243 /// Gets the type declaration string for a type symbol, determining if it is a record, struct, or class.
0 commit comments