anchor.diff:    }
   
     @override
  -  MemberEntity lookupMember(IrToElementMap elementMap, Name name) {
  +  MemberEntity? lookupMember(
  +      covariant KernelToElementMapForEnv elementMap, Name name) {
       _ensureMaps(elementMap);
  -    ir.Member member = _memberMap[name];
  +    ir.Member? member = _memberMap![name];
       return member != null ? elementMap.getMember(member) : null;
     }
   
     @override
     void forEachMember(IrToElementMap elementMap, void f(MemberEntity member)) {
  -    _ensureMaps(elementMap);
  -    _members.forEach((ir.Member member) {
  +    _ensureMaps(elementMap as KernelToElementMapForEnv);
  +    _members!.forEach((ir.Member member) {
         f(elementMap.getMember(member));
       });
     }
   
     @override
  -  ConstructorEntity lookupConstructor(IrToElementMap elementMap, String name) {
  -    _ensureMaps(elementMap);
  -    ir.Member constructor = _constructorMap[name];
  +  ConstructorEntity? lookupConstructor(
  +      IrToElementMap elementMap, String? name) {
  +    _ensureMaps(elementMap as KernelToElementMapForEnv);
  +    ir.Member? constructor = _constructorMap![name!];
       return constructor != null ? elementMap.getConstructor(constructor) : null;
     }
   
     @override
     void forEachConstructor(
         IrToElementMap elementMap, void f(ConstructorEntity constructor)) {
  -    _ensureMaps(elementMap);
  -    _constructorMap.values.forEach((ir.Member constructor) {
  +    _ensureMaps(elementMap as KernelToElementMapForEnv);
  +    _constructorMap!.values.forEach((ir.Member constructor) {
         f(elementMap.getConstructor(constructor));
       });
     }
   
     void addConstructorBody(ConstructorBodyEntity constructorBody) {
       _constructorBodyList ??= <ConstructorBodyEntity>[];
  -    _constructorBodyList.add(constructorBody);
  +    _constructorBodyList!.add(constructorBody);
     }
   
     @override
  
positive.code: 
  /// Environment for fast lookup of component libraries.
  class KProgramEnv implements interfaces.KProgramEnv {
    final Set<ir.Component> _components = Set<ir.Component>();
  
    Map<Uri, KLibraryEnv> _libraryMap;
  
    /// TODO(johnniwinther): Handle arbitrary load order if needed.
    ir.Member get mainMethod => _components.first?.mainMethod;
  
    ir.Component get mainComponent => _components.first;
  
    void addComponent(ir.Component component) {
      if (_components.add(component)) {
        if (_libraryMap != null) {
          _addLibraries(component);
        }
      }
    }
  
    void _addLibraries(ir.Component component) {
      for (ir.Library library in component.libraries) {
        _libraryMap[library.importUri] = KLibraryEnv(library);
      }
    }
  
    void _ensureLibraryMap() {
      if (_libraryMap == null) {
        _libraryMap = <Uri, KLibraryEnv>{};
        for (ir.Component component in _components) {
          _addLibraries(component);
        }
      }
    }
  
    /// Return the [KLibraryEnv] for the library with the canonical [uri].
    KLibraryEnv lookupLibrary(Uri uri) {
      _ensureLibraryMap();
      return _libraryMap[uri];
    }
  
    /// Calls [f] for each library in this environment.
    void forEachLibrary(void f(KLibraryEnv library)) {
      _ensureLibraryMap();
      _libraryMap.values.forEach(f);
    }
  
    /// Returns the number of libraries in this environment.
    int get length {
      _ensureLibraryMap();
      return _libraryMap.length;
    }
  
    /// Convert this [KProgramEnv] to the corresponding [JProgramEnv].
    @override
  
negative.code:   @override
    final ir.Class node;
    @override
    late bool isMixinApplication;
  
    @override
    InterfaceType? thisType;
    @override
    InterfaceType? jsInteropType;
    @override
    InterfaceType? rawType;
    @override
    InterfaceType? instantiationToBounds;
    @override
    InterfaceType? supertype;
    @override
    InterfaceType? mixedInType;
    @override
    List<InterfaceType>? interfaces;
    @override
    OrderedTypeSet? orderedTypeSet;
  
    Iterable<ConstantValue>? _metadata;
    List<Variance>? _variances;
  
    KClassDataImpl(this.node);
  
  