@@ -274,28 +274,36 @@ private void Populate(ISymbol? optionalSymbol, CachedEntity entity)
274274
275275 bool duplicationGuard , deferred ;
276276
277- switch ( entity . TrapStackBehaviour )
277+ if ( Extractor . Mode is ExtractorMode . Standalone )
278278 {
279- case TrapStackBehaviour . NeedsLabel :
280- if ( ! tagStack . Any ( ) )
281- ExtractionError ( "TagStack unexpectedly empty" , optionalSymbol , entity ) ;
282- duplicationGuard = false ;
283- deferred = false ;
284- break ;
285- case TrapStackBehaviour . NoLabel :
286- duplicationGuard = false ;
287- deferred = tagStack . Any ( ) ;
288- break ;
289- case TrapStackBehaviour . OptionalLabel :
290- duplicationGuard = false ;
291- deferred = false ;
292- break ;
293- case TrapStackBehaviour . PushesLabel :
294- duplicationGuard = true ;
295- deferred = duplicationGuard && tagStack . Any ( ) ;
296- break ;
297- default :
298- throw new InternalError ( "Unexpected TrapStackBehaviour" ) ;
279+ duplicationGuard = false ;
280+ deferred = false ;
281+ }
282+ else
283+ {
284+ switch ( entity . TrapStackBehaviour )
285+ {
286+ case TrapStackBehaviour . NeedsLabel :
287+ if ( ! tagStack . Any ( ) )
288+ ExtractionError ( "TagStack unexpectedly empty" , optionalSymbol , entity ) ;
289+ duplicationGuard = false ;
290+ deferred = false ;
291+ break ;
292+ case TrapStackBehaviour . NoLabel :
293+ duplicationGuard = false ;
294+ deferred = tagStack . Any ( ) ;
295+ break ;
296+ case TrapStackBehaviour . OptionalLabel :
297+ duplicationGuard = false ;
298+ deferred = false ;
299+ break ;
300+ case TrapStackBehaviour . PushesLabel :
301+ duplicationGuard = true ;
302+ deferred = duplicationGuard && tagStack . Any ( ) ;
303+ break ;
304+ default :
305+ throw new InternalError ( "Unexpected TrapStackBehaviour" ) ;
306+ }
299307 }
300308
301309 var a = duplicationGuard && IsEntityDuplicationGuarded ( entity , out var loc )
0 commit comments