@@ -65,6 +65,15 @@ public static void HasModifier(Context cx, TextWriter trapFile, IEntity target,
65
65
trapFile . has_modifiers ( target , Modifier . Create ( cx , modifier ) ) ;
66
66
}
67
67
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
+
68
77
private static void ExtractNamedTypeModifiers ( Context cx , TextWriter trapFile , IEntity key , ISymbol symbol )
69
78
{
70
79
if ( symbol . Kind != SymbolKind . NamedType )
@@ -106,8 +115,11 @@ public static void ExtractModifiers(Context cx, TextWriter trapFile, IEntity key
106
115
if ( symbol . IsVirtual )
107
116
HasModifier ( cx , trapFile , key , Modifiers . Virtual ) ;
108
117
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 ) ;
111
123
112
124
if ( symbol . IsOverride )
113
125
HasModifier ( cx , trapFile , key , Modifiers . Override ) ;
0 commit comments