@@ -65,6 +65,15 @@ public static void HasModifier(Context cx, TextWriter trapFile, IEntity target,
6565 trapFile . has_modifiers ( target , Modifier . Create ( cx , modifier ) ) ;
6666 }
6767
68+ private static void ExtractFieldModifiers ( Context cx , TextWriter trapFile , IEntity key , IFieldSymbol symbol )
69+ {
70+ if ( symbol . IsReadOnly )
71+ HasModifier ( cx , trapFile , key , Modifiers . Readonly ) ;
72+
73+ if ( symbol . IsRequired )
74+ HasModifier ( cx , trapFile , key , Modifiers . Required ) ;
75+ }
76+
6877 private static void ExtractNamedTypeModifiers ( Context cx , TextWriter trapFile , IEntity key , ISymbol symbol )
6978 {
7079 if ( symbol . Kind != SymbolKind . NamedType )
@@ -106,8 +115,11 @@ public static void ExtractModifiers(Context cx, TextWriter trapFile, IEntity key
106115 if ( symbol . IsVirtual )
107116 HasModifier ( cx , trapFile , key , Modifiers . Virtual ) ;
108117
109- if ( symbol . Kind == SymbolKind . Field && ( ( IFieldSymbol ) symbol ) . IsReadOnly )
110- HasModifier ( cx , trapFile , key , Modifiers . Readonly ) ;
118+ if ( symbol is IFieldSymbol field )
119+ ExtractFieldModifiers ( cx , trapFile , key , field ) ;
120+
121+ if ( symbol . Kind == SymbolKind . Property && ( ( IPropertySymbol ) symbol ) . IsRequired )
122+ HasModifier ( cx , trapFile , key , Modifiers . Required ) ;
111123
112124 if ( symbol . IsOverride )
113125 HasModifier ( cx , trapFile , key , Modifiers . Override ) ;
0 commit comments