@@ -86,7 +86,10 @@ public static void ExtractModifiers(Context cx, TextWriter trapFile, IEntity key
8686 if ( symbol . IsSealed )
8787 HasModifier ( cx , trapFile , key , "sealed" ) ;
8888
89- ExtractStaticModifier ( cx , trapFile , key , symbol ) ;
89+ var fromSource = symbol . DeclaringSyntaxReferences . Length > 0 ;
90+
91+ if ( symbol . IsStatic && ! ( symbol . Kind == SymbolKind . Field && ( ( IFieldSymbol ) symbol ) . IsConst && ! fromSource ) )
92+ HasModifier ( cx , trapFile , key , "static" ) ;
9093
9194 if ( symbol . IsVirtual )
9295 HasModifier ( cx , trapFile , key , "virtual" ) ;
@@ -101,7 +104,8 @@ public static void ExtractModifiers(Context cx, TextWriter trapFile, IEntity key
101104 if ( symbol . IsOverride )
102105 HasModifier ( cx , trapFile , key , "override" ) ;
103106
104- ExtractAsyncModifier ( cx , trapFile , key , symbol ) ;
107+ if ( symbol . Kind == SymbolKind . Method && ( ( IMethodSymbol ) symbol ) . IsAsync )
108+ HasModifier ( cx , trapFile , key , "async" ) ;
105109
106110 if ( symbol . IsExtern )
107111 HasModifier ( cx , trapFile , key , "extern" ) ;
@@ -125,20 +129,6 @@ public static void ExtractModifiers(Context cx, TextWriter trapFile, IEntity key
125129 }
126130 }
127131
128- public static void ExtractAsyncModifier ( Context cx , TextWriter trapFile , IEntity key , ISymbol symbol )
129- {
130- if ( symbol . Kind == SymbolKind . Method && ( ( IMethodSymbol ) symbol ) . IsAsync )
131- HasModifier ( cx , trapFile , key , "async" ) ;
132- }
133-
134- public static void ExtractStaticModifier ( Context cx , TextWriter trapFile , IEntity key , ISymbol symbol )
135- {
136- var fromSource = symbol . DeclaringSyntaxReferences . Length > 0 ;
137-
138- if ( symbol . IsStatic && ! ( symbol . Kind == SymbolKind . Field && ( ( IFieldSymbol ) symbol ) . IsConst && ! fromSource ) )
139- HasModifier ( cx , trapFile , key , "static" ) ;
140- }
141-
142132 public static Modifier Create ( Context cx , string modifier )
143133 {
144134 return ModifierFactory . Instance . CreateEntity ( cx , ( typeof ( Modifier ) , modifier ) , modifier ) ;
0 commit comments