anchor.diff:      neededClasses.addAll(mixinClasses);
   
       // 3. Add classes only needed for their constructors.
  -    classesOnlyNeededForConstructor = _codegenWorld.constructorReferences
  -        .where((cls) => !neededClasses.contains(cls))
  -        .toSet();
  -    neededClasses.addAll(classesOnlyNeededForConstructor);
  +    for (var cls in _codegenWorld.constructorReferences) {
  +      if (neededClasses.add(cls)) {
  +        classesOnlyNeededForConstructor.add(cls);
  +      }
  +    }
   
       // 4. Find all classes needed for rti.
       // It is important that this is the penultimate step, at this point,
  
positive.code:             .putIfAbsent(_outputUnitData.outputUnitForClass(cls), () => [])
              .add(cls);
        }
      }
    }
  
  
negative.code:     Set<ClassEntity> backendTypeHelpers =
          getBackendTypeHelpers(_commonElements).toSet();
  
      /// A class type is 'shadowed' if the class is needed for direct
      /// instantiation in one OutputUnit while its type is needed in another
      /// OutputUnit.
      bool isClassTypeShadowed(ClassEntity cls) {
        return !backendTypeHelpers.contains(cls) &&
            _rtiNeededClasses.contains(cls) &&
            !classesOnlyNeededForRti.contains(cls) &&
            _options.deferClassTypes &&
            _outputUnitData.outputUnitForClass(cls) !=
                _outputUnitData.outputUnitForClassType(cls);
      }
  
      // Compute needed classes.
      Set<ClassEntity> instantiatedClasses =
          // TODO(johnniwinther): This should be accessed from a codegen closed
  