anchor.diff:  //-------------------------------------------------------------------------- 
   
   and GenConstant cenv cgbuf eenv (c,m,ty) sequel =
  -  let ilTy = GenType cenv m eenv.tyenv ty
  +  let ilTy = GenType cenv.amap m eenv.tyenv ty
     // Check if we need to generate the value at all
     match sequelAfterDiscard sequel with 
     | None -> 
  
positive.code:     member mgbuf.cenv = cenv
      member mgbuf.GetExplicitEntryPointInfo() = explicitEntryPointInfo
  
  /// Type generators which walk the types first to make sure all anonymous types are generated
  let GenType cenv m tyenv ty = GenTypeAux cenv.amap m tyenv ty
  let GenTypes cenv m tyenv tys = GenTypesAux cenv.amap m tyenv tys
  let GenUnionCaseSpec cenv m tyenv c tyargs = GenUnionCaseSpecAux cenv.amap m tyenv c tyargs
  let GenUnionSpec cenv m tyenv tcref tyargs = GenUnionSpecAux cenv.amap m tyenv tcref tyargs
  let GenTypePermitVoid cenv m tyenv ty = GenTypeAuxAux cenv.amap m tyenv VoidOK PtrTypesNotOK ty
  let GenTypesPermitVoid cenv m tyenv tys = List.map (GenTypePermitVoid cenv m tyenv) tys
  let GenTyApp cenv m tyenv repr tyargs = GenTyAppAux cenv.amap m tyenv repr tyargs
  let GenNamedTyApp cenv m tyenv tcref tinst = GenNamedTyAppAux cenv.amap m tyenv PtrTypesNotOK tcref tinst 
  let GenReturnType cenv m tyenv returnTyOpt = GenReturnTypeAux cenv.amap m tyenv returnTyOpt
  let GenParamType cenv m tyenv ty = GenParamTypeAux cenv.amap m tyenv ty 
  let GenParamTypes cenv m tyenv tys = GenParamTypesAux cenv.amap m tyenv tys 
  let GenTypeArgs cenv m tyenv tyargs = GenTypeArgsAux cenv.amap m tyenv tyargs
  let GenExnType amap m tyenv (ecref:TyconRef) = GenTyAppAux amap m tyenv ecref.CompiledRepresentation []
       
  //--------------------------------------------------------------------------
  // Representation of term declarations = Environments for compiling expressions.
  //-------------------------------------------------------------------------- 
  
        
  [<NoEquality; NoComparison>]
  type ValStorage = 
      /// Indicates the value is always null
      | Null 
      /// Indicates the value is stored in a static field. 
      | StaticField of ILFieldSpec * ValRef * (*hasLiteralAttr:*)bool * ILType * string * ILType * ILMethodRef  * ILMethodRef  * OptionalShadowLocal
      /// Indicates the value is "stored" as a property that recomputes it each time it is referenced. Used for simple constants that do not cause initialization triggers
      | StaticProperty of ILMethodSpec  * OptionalShadowLocal
      /// Indicates the value is "stored" as a IL static method (in a "main" class for a F# 
      /// compilation unit, or as a member) according to its inferred or specified arity.  
      | Method of  ValReprInfo * ValRef * ILMethodSpec * Range.range * ArgReprInfo list * ArgReprInfo
      /// Indicates the value is stored at the given position in the closure environment accessed via "ldarg 0"
      | Env of ILType * int * ILFieldSpec * NamedLocalIlxClosureInfo ref option  
      /// Indicates that the value is an argument of a method being generated
      | Arg of int 
      /// Indicates that the value is stored in local of the method being generated. NamedLocalIlxClosureInfo is normally empty.
      /// It is non-empty for 'local type functions', see comments on definition of NamedLocalIlxClosureInfo.
      | Local of int * NamedLocalIlxClosureInfo ref option 
  
  and OptionalShadowLocal = 
      | NoShadowLocal
      | ShadowLocal of ValStorage
  
  /// The representation of a NamedLocalClosure is based on a cloinfo.  However we can't generate a cloinfo until we've 
  /// decided the representations of other items in the recursive set. Hence we use two phases to decide representations in 
  /// a recursive set. Yuck. 
  and NamedLocalIlxClosureInfo = 
      | NamedLocalIlxClosureInfoGenerator of (IlxGenEnv -> IlxClosureInfo)
      | NamedLocalIlxClosureInfoGenerated of IlxClosureInfo
    
  and ModuleStorage = 
      { Vals: Lazy<NameMap<ValStorage>> 
        SubModules: Lazy<NameMap<ModuleStorage>> }
  
  /// BranchCallItems are those where a call to the value can be implemented as 
  /// a branch. At the moment these are only used for generating branch calls back to 
  /// the entry label of the method currently being generated. 
  and BranchCallItem = 
      | BranchCallClosure of ArityInfo
      | BranchCallMethod of 
          // Argument counts for compiled form  of F# method or value
          ArityInfo * 
          // Arg infos for compiled form of F# method or value
          (TType * ArgReprInfo) list list * 
          // Typars for F# method or value
          Tast.Typars * 
          // Typars for F# method or value
          int *
          // num obj args 
          int 
        
  and Mark = 
      | Mark of ILCodeLabel (* places we can branch to  *)
      member x.CodeLabel = (let (Mark(lab)) = x in lab)
  
  and IlxGenEnv =
      { tyenv: TypeReprEnv 
        someTypeInThisAssembly: ILType
        isFinalFile: bool
        /// Where to place the stuff we're currently generating
        cloc: CompileLocation 
        /// Hiding information down the signature chain, used to compute what's public to the assembly 
        sigToImplRemapInfo: (Remap * SignatureHidingInfo) list 
        /// All values in scope 
        valsInScope: ValMap<Lazy<ValStorage>> 
        /// For optimizing direct tail recursion to a loop - mark says where to branch to.  Length is 0 or 1. 
        /// REVIEW: generalize to arbitrary nested local loops?? 
        innerVals: (ValRef * (BranchCallItem * Mark)) list 
        /// Full list of enclosing bound values.  First non-compiler-generated element is used to help give nice names for closures and other expressions.  
        letBoundVars: ValRef list 
        /// The set of IL local variable indexes currently in use by lexically scoped variables, to allow reuse on different branches. 
        /// Really an integer set. 
        liveLocals: IntMap<unit> 
        /// Are we under the scope of a try, catch or finally? If so we can't tailcall. SEH = structured exception handling
        withinSEH: bool }
  
  let ReplaceTyenv tyenv (eenv: IlxGenEnv) = {eenv with tyenv = tyenv } 
  let EnvForTypars tps eenv =  {eenv with tyenv = TypeReprEnv.ForTypars tps } 
  let AddTyparsToEnv typars (eenv: IlxGenEnv) = {eenv with tyenv = eenv.tyenv.Add typars}
  
  let AddSignatureRemapInfo _msg (rpi, mhi) eenv = 
      { eenv with sigToImplRemapInfo = (mkRepackageRemapping rpi,mhi) :: eenv.sigToImplRemapInfo }
       
  //--------------------------------------------------------------------------
  // Print eenv
  //-------------------------------------------------------------------------- 
  
  let OutputStorage (pps: TextWriter) s = 
      match s with 
      | StaticField _ ->  pps.Write "(top)" 
      | StaticProperty _ -> pps.Write "(top)" 
      | Method _ -> pps.Write "(top)" 
      | Local _ -> pps.Write "(local)" 
      | Arg _ -> pps.Write "(arg)" 
      | Env _ -> pps.Write "(env)" 
      | Null -> pps.Write "(null)"
  
  //--------------------------------------------------------------------------
  // Augment eenv with values
  //-------------------------------------------------------------------------- 
  
  let AddStorageForVal (g: TcGlobals) (v,s) eenv = 
      let eenv = { eenv with valsInScope = eenv.valsInScope.Add v s }
      // If we're compiling fslib then also bind the value as a non-local path to 
      // allow us to resolve the compiler-non-local-references that arise from env.fs
      //
      // Do this by generating a fake "looking from the outside in" non-local value reference for
      // v, dereferencing it to find the corresponding signature Val, and adding an entry for the signature val.
      //
      // A similar code path exists in ilxgen.fs for the tables of "optimization data" for values
      if g.compilingFslib then 
          // Passing an empty remap is sufficient for FSharp.Core.dll because it turns out the remapped type signature can
          // still be resolved.
          match tryRescopeVal g.fslibCcu Remap.Empty  v with 
          | None -> eenv
          | Some vref -> 
              match vref.TryDeref with
              | VNone -> 
                  //let msg = sprintf "could not dereference external value reference to something in FSharp.Core.dll during code generation, v.MangledName = '%s', v.Range = %s" v.MangledName (stringOfRange v.Range)
                  //System.Diagnostics.Debug.Assert(false, msg)
                  eenv
              | VSome gv -> 
                  { eenv with valsInScope = eenv.valsInScope.Add gv s }
      else 
          eenv
  
  let AddStorageForLocalVals g vals eenv = List.foldBack (fun (v,s) acc -> AddStorageForVal g (v,notlazy s) acc) vals eenv
  
  //--------------------------------------------------------------------------
  // Lookup eenv 
  //-------------------------------------------------------------------------- 
    
  open Microsoft.FSharp.Compiler.AbstractIL
  open Microsoft.FSharp.Compiler.AbstractIL.Internal 
  open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library 
  
  let StorageForVal m v eenv = 
      let v = 
          try eenv.valsInScope.[v]
          with :? KeyNotFoundException ->
            assert false
            errorR(Error(FSComp.SR.ilUndefinedValue(showL(vspecAtBindL v)),m)) 
            notlazy (Arg 668(* random value for post-hoc diagnostic analysis on generated tree *) )
      v.Force()
  
  let StorageForValRef m (v: ValRef) eenv = StorageForVal m v.Deref eenv
  
  //--------------------------------------------------------------------------
  // Imported modules and the environment
  //
  // How a top level value is represented depends on its type.  If it's a 
  // function or is polymorphic, then it gets represented as a 
  // method (possibly and instance method).  Otherwise it gets represented as a 
  // static field.
  //-------------------------------------------------------------------------- 
  
  let IsValRefIsDllImport g (vref:ValRef) = 
      vref.Attribs |> HasFSharpAttributeOpt g g.attrib_DllImportAttribute 
  
  let GetMethodSpecForMemberVal amap g (memberInfo:ValMemberInfo) (vref:ValRef) = 
      let m = vref.Range
      let tps,curriedArgInfos,returnTy,retInfo = 
           assert(vref.ValReprInfo.IsSome)
           GetTopValTypeInCompiledForm g (Option.get vref.ValReprInfo) vref.Type m
      let tyenvUnderTypars = TypeReprEnv.ForTypars tps
      let flatArgInfos = List.concat curriedArgInfos
      let isCtor = (memberInfo.MemberFlags.MemberKind = MemberKind.Constructor)
      let cctor = (memberInfo.MemberFlags.MemberKind = MemberKind.ClassConstructor)
      let parentTcref = vref.TopValDeclaringEntity
      let parentTypars = parentTcref.TyparsNoRange
      let numParentTypars = parentTypars.Length
      if tps.Length < numParentTypars then error(InternalError("CodeGen check: type checking did not ensure that this method is sufficiently generic", m))
      let ctps,mtps = List.chop numParentTypars tps
      let isCompiledAsInstance = ValRefIsCompiledAsInstanceMember g vref
  
      let ilActualRetTy = 
          let ilRetTy = GenReturnTypeAux amap m tyenvUnderTypars returnTy
          if isCtor || cctor then ILType.Void else ilRetTy
  
      let ilTy = GenTypeAux amap m tyenvUnderTypars (mkAppTy parentTcref (List.map mkTyparTy ctps))
  
      if isCompiledAsInstance || isCtor then 
          // Find the 'this' argument type if any 
          let thisTy,flatArgInfos = 
              if isCtor then (GetFSharpViewOfReturnType g returnTy),flatArgInfos 
              else 
                 match flatArgInfos with 
                 | [] -> error(InternalError("This instance method '" + vref.LogicalName + "' has no arguments", m))
                 | (h,_):: t -> h,t
  
          let thisTy = if isByrefTy g thisTy then destByrefTy g thisTy else thisTy
          let thisArgTys = argsOfAppTy g thisTy
          if ctps.Length <> thisArgTys.Length then
             warning(InternalError(sprintf "CodeGen check: type checking did not quantify the correct number of type variables for this method, #parentTypars = %d, #ctps = %d, #mtps = %d, #thisArgTys = %d" numParentTypars ctps.Length mtps.Length thisArgTys.Length,m))
          else 
             List.iter2
                (fun gtp ty2 -> 
                  if not (typeEquiv g (mkTyparTy gtp) ty2) then 
                    warning(InternalError("CodeGen check: type checking did not quantify the correct type variables for this method: generalization list contained " + gtp.Name + "#" + string gtp.Stamp + " and list from 'this' pointer contained " +  (showL(typeL ty2)), m)))
                ctps 
                thisArgTys
          let methodArgTys,paramInfos = List.unzip flatArgInfos
          let ilMethodArgTys = GenParamTypesAux amap m tyenvUnderTypars methodArgTys
          let ilMethodInst = GenTypeArgsAux amap m tyenvUnderTypars (List.map mkTyparTy mtps)
          let mspec = mkILInstanceMethSpecInTy (ilTy,vref.CompiledName,ilMethodArgTys,ilActualRetTy,ilMethodInst)
          
          mspec,ctps,mtps,paramInfos,retInfo
      else 
          let methodArgTys,paramInfos = List.unzip flatArgInfos
          let ilMethodArgTys = GenParamTypesAux amap m tyenvUnderTypars methodArgTys
          let ilMethodInst = GenTypeArgsAux amap m tyenvUnderTypars (List.map mkTyparTy mtps)
          let mspec = mkILStaticMethSpecInTy (ilTy,vref.CompiledName,ilMethodArgTys,ilActualRetTy,ilMethodInst)
          
          mspec,ctps,mtps,paramInfos,retInfo
  
  // Generate the ILFieldSpec for a top-level value
  
  let ComputeFieldSpecForVal(optIntraAssemblyInfo:IlxGenIntraAssemblyInfo option, isInteractive, g, ilTyForProperty, vspec:Val, nm, m, cloc, ilTy, ilGetterMethRef) = 
      assert vspec.IsCompiledAsTopLevel
      let generate() = GenFieldSpecForStaticField (isInteractive, g, ilTyForProperty, vspec, nm, m, cloc, ilTy)
      match optIntraAssemblyInfo with 
      | None -> generate()
      | Some intraAssemblyInfo -> 
          if vspec.IsMutable && vspec.IsCompiledAsTopLevel && isStructTy g vspec.Type then
              let ok, res = intraAssemblyInfo.StaticFieldInfo.TryGetValue ilGetterMethRef
              if ok then 
                  res 
              else 
                  let res = generate()
                  intraAssemblyInfo.StaticFieldInfo.[ilGetterMethRef] <- res
                  res
          else 
              generate()
  
  let IsValCompiledAsMethod g (v:Val) =
      match v.ValReprInfo with 
      | None -> false
      | Some topValInfo -> 
          not (isUnitTy g v.Type && not v.IsMemberOrModuleBinding && not v.IsMutable) &&
          not v.IsCompiledAsStaticPropertyWithoutField  &&
          match GetTopValTypeInFSharpForm g topValInfo v.Type v.Range with 
          | [],[],_,_ when not v.IsMember -> false 
          | _ -> true
  
  // This called via 2 routes.
  // (a) ComputeAndAddStorageForLocalTopVal
  // (b) ComputeStorageForNonLocalTopVal
  //
  /// This function decides the storage for the val.
  /// The decision is based on arityInfo.
  let ComputeStorageForTopVal (amap, g, optIntraAssemblyInfo:IlxGenIntraAssemblyInfo option, isInteractive, optShadowLocal, vref:ValRef, cloc) =
  
    if isUnitTy g vref.Type  && not vref.IsMemberOrModuleBinding && not vref.IsMutable then  
      Null   
    else
      let topValInfo = 
          match vref.ValReprInfo with 
          | None -> error(InternalError("ComputeStorageForTopVal: no arity found for " + showL(valRefL vref),vref.Range))
          | Some a -> a
          
      let m = vref.Range
      let nm = vref.CompiledName 
  
      if vref.Deref.IsCompiledAsStaticPropertyWithoutField then 
          let nm = "get_"+nm 
          let tyenvUnderTypars = TypeReprEnv.ForTypars []
          let ilRetTy = GenTypeAux amap m tyenvUnderTypars vref.Type
          let typ = mkILTyForCompLoc cloc
          let mspec = mkILStaticMethSpecInTy (typ, nm, [], ilRetTy, [])
      
          StaticProperty (mspec, optShadowLocal)
      else 
  
          // Determine when a static field is required.
          //
          // REVIEW: This call to GetTopValTypeInFSharpForm is only needed to determine if this is a (type) function or a value
          // We should just look at the arity
          match GetTopValTypeInFSharpForm g topValInfo vref.Type vref.Range with 
          | [],[], returnTy,_ when not vref.IsMember ->
              // Mutable and literal static fields must have stable names and live in the "public" location 
              // See notes on GenFieldSpecForStaticField above. 
              let vspec = vref.Deref
              let ilTy = GenTypeAux amap m TypeReprEnv.Empty returnTy (* TypeReprEnv.Empty ok: not a field in a generic class *)
              let ilTyForProperty = mkILTyForCompLoc cloc
              let attribs = vspec.Attribs
              let hasLiteralAttr = HasFSharpAttribute g g.attrib_LiteralAttribute attribs
  
              let ilTypeRefForProperty = ilTyForProperty.TypeRef
              let ilGetterMethRef = mkILMethRef (ilTypeRefForProperty, ILCallingConv.Static, "get_"+nm, 0, [], ilTy)
              let ilSetterMethRef = mkILMethRef (ilTypeRefForProperty, ILCallingConv.Static, "set_"+nm, 0, [ilTy], ILType.Void)
  
              let fspec = ComputeFieldSpecForVal(optIntraAssemblyInfo, isInteractive, g, ilTyForProperty, vspec, nm, m, cloc, ilTy, ilGetterMethRef) 
  
              StaticField (fspec, vref, hasLiteralAttr, ilTyForProperty, nm, ilTy, ilGetterMethRef, ilSetterMethRef, optShadowLocal)
                
          | _ -> 
              match vref.MemberInfo with 
              | Some memberInfo when not vref.IsExtensionMember -> 
                  let mspec,_,_,paramInfos,retInfo = GetMethodSpecForMemberVal amap g memberInfo vref
                  Method (topValInfo, vref, mspec, m, paramInfos, retInfo) 
              | _ -> 
                  let (tps, curriedArgInfos, returnTy, retInfo) = GetTopValTypeInCompiledForm g topValInfo vref.Type m 
                  let tyenvUnderTypars = TypeReprEnv.ForTypars tps
                  let (methodArgTys,paramInfos) = curriedArgInfos |> List.concat |> List.unzip 
                  let ilMethodArgTys = GenParamTypesAux amap m tyenvUnderTypars methodArgTys
                  let ilRetTy = GenReturnTypeAux amap m tyenvUnderTypars returnTy
                  let ilLocTy = mkILTyForCompLoc cloc
                  let ilMethodInst = GenTypeArgsAux amap m tyenvUnderTypars (List.map mkTyparTy tps)
                  let mspec = mkILStaticMethSpecInTy (ilLocTy, nm, ilMethodArgTys, ilRetTy, ilMethodInst)
                  Method (topValInfo, vref, mspec, m, paramInfos, retInfo)
  
  let ComputeAndAddStorageForLocalTopVal (amap, g, intraAssemblyFieldTable, isInteractive, optShadowLocal)  cloc (v:Val) eenv =
      let storage = ComputeStorageForTopVal (amap, g, Some intraAssemblyFieldTable, isInteractive, optShadowLocal, mkLocalValRef v, cloc)
      AddStorageForVal g (v,notlazy storage) eenv
  
  let ComputeStorageForNonLocalTopVal amap g cloc modref (v:Val) =
      match v.ValReprInfo with 
      | None -> error(InternalError("ComputeStorageForNonLocalTopVal, expected an arity for " + v.LogicalName,v.Range))
      | Some _ -> ComputeStorageForTopVal (amap, g, None, false, NoShadowLocal, mkNestedValRef modref v, cloc)
  
  let rec ComputeStorageForNonLocalModuleOrNamespaceRef amap g cloc acc (modref:ModuleOrNamespaceRef) (modul:ModuleOrNamespace)  = 
      let acc = 
          (acc, modul.ModuleOrNamespaceType.ModuleAndNamespaceDefinitions) ||> List.fold (fun acc smodul -> 
              ComputeStorageForNonLocalModuleOrNamespaceRef amap g (CompLocForSubModuleOrNamespace cloc smodul) acc (modref.NestedTyconRef smodul) smodul) 
  
      let acc = 
          (acc, modul.ModuleOrNamespaceType.AllValsAndMembers) ||> Seq.fold (fun acc v -> 
              AddStorageForVal g (v, lazy (ComputeStorageForNonLocalTopVal amap g cloc modref v)) acc) 
      acc
  
  let ComputeStorageForExternalCcu amap g  eenv (ccu:CcuThunk) = 
      if not ccu.IsFSharp then eenv else
      let cloc = CompLocForCcu ccu
      let eenv = 
         List.foldBack
             (fun smodul acc -> 
                 let cloc = CompLocForSubModuleOrNamespace cloc smodul
                 let modref =  mkNonLocalCcuRootEntityRef ccu smodul
                 ComputeStorageForNonLocalModuleOrNamespaceRef amap g cloc acc modref smodul)
             ccu.RootModulesAndNamespaces
             eenv
      let eenv = 
          let eref = ERefNonLocalPreResolved ccu.Contents (mkNonLocalEntityRef ccu [| |])
          (eenv, ccu.Contents.ModuleOrNamespaceType.AllValsAndMembers) ||> Seq.fold (fun acc v -> 
              AddStorageForVal g (v, lazy (ComputeStorageForNonLocalTopVal amap g cloc eref v)) acc) 
      eenv
      
  let rec AddBindingsForLocalModuleType allocVal cloc eenv (mty:ModuleOrNamespaceType) = 
      let eenv = List.fold (fun eenv submodul -> AddBindingsForLocalModuleType allocVal (CompLocForSubModuleOrNamespace cloc submodul) eenv submodul.ModuleOrNamespaceType) eenv mty.ModuleAndNamespaceDefinitions 
      let eenv = Seq.fold (fun eenv v -> allocVal cloc v eenv) eenv mty.AllValsAndMembers 
      eenv 
  
  let AddExternalCcusToIlxGenEnv amap g eenv ccus = List.fold (ComputeStorageForExternalCcu amap g) eenv ccus
  
  let AddBindingsForTycon allocVal (cloc:CompileLocation) (tycon:Tycon) eenv  =
      let unrealizedSlots = 
          if tycon.IsFSharpObjectModelTycon
          then tycon.FSharpObjectModelTypeInfo.fsobjmodel_vslots 
          else []
      (eenv,unrealizedSlots) ||> List.fold (fun eenv vref -> allocVal cloc vref.Deref eenv) 
  
  let rec AddBindingsForModuleDefs allocVal (cloc:CompileLocation) eenv  mdefs = 
      List.fold (AddBindingsForModuleDef allocVal cloc) eenv mdefs
  
  and AddBindingsForModuleDef allocVal cloc eenv x = 
      match x with 
      | TMDefRec(_isRec,tycons,mbinds,_) -> 
          (* Virtual don't have 'let' bindings and must be added to the environment *)
          let eenv = List.foldBack (AddBindingsForTycon allocVal cloc) tycons eenv
          let eenv = List.foldBack (AddBindingsForModule allocVal cloc) mbinds eenv
          eenv
      | TMDefLet(bind,_) -> 
          allocVal cloc bind.Var eenv
      | TMDefDo _ -> 
          eenv
      | TMAbstract(ModuleOrNamespaceExprWithSig(mtyp,_,_)) -> 
          AddBindingsForLocalModuleType allocVal cloc eenv  mtyp
      | TMDefs(mdefs) -> 
          AddBindingsForModuleDefs allocVal cloc eenv  mdefs 
  
  and AddBindingsForModule allocVal cloc x eenv = 
      match x with 
      | ModuleOrNamespaceBinding.Binding bind -> 
          allocVal cloc bind.Var eenv
      | ModuleOrNamespaceBinding.Module (mspec, mdef) -> 
          let cloc = 
              if mspec.IsNamespace then cloc 
              else CompLocForFixedModule cloc.clocQualifiedNameOfFile cloc.clocTopImplQualifiedName mspec
          
          AddBindingsForModuleDef allocVal cloc eenv mdef
  
  and AddBindingsForModuleTopVals _g allocVal _cloc eenv vs = 
      List.foldBack allocVal vs eenv
  
  
  // Put the partial results for a generated fragment (i.e. a part of a CCU generated by FSI) 
  // into the stored results for the whole CCU.  
  // isIncrementalFragment = true -->  "typed input" 
  // isIncrementalFragment = false -->  "#load" 
  let AddIncrementalLocalAssemblyFragmentToIlxGenEnv (amap:ImportMap, isIncrementalFragment, g, ccu, fragName, intraAssemblyInfo, eenv, typedImplFiles) = 
      let cloc = CompLocForFragment fragName ccu
      let allocVal = ComputeAndAddStorageForLocalTopVal (amap, g, intraAssemblyInfo, true, NoShadowLocal)
      (eenv, typedImplFiles) ||> List.fold (fun eenv (TImplFile(qname, _, mexpr, _, _, _)) -> 
          let cloc = { cloc with clocTopImplQualifiedName = qname.Text }
          if isIncrementalFragment then 
              match mexpr with
              | ModuleOrNamespaceExprWithSig(_,mdef,_) -> AddBindingsForModuleDef allocVal cloc eenv mdef
              (* | ModuleOrNamespaceExprWithSig(mtyp,_,m) -> error(Error("don't expect inner defs to have a constraint",m)) *)
          else
              AddBindingsForLocalModuleType allocVal cloc eenv mexpr.Type) 
  
  
  /// Record the types of the things on the evaluation stack. 
  /// Used for the few times we have to flush the IL evaluation stack and to compute maxStack. 
  
negative.code:             match defaultTargetOpt with 
              | None -> rest.Head.CaseTree
              | Some tg -> tg
          let cuspec = GenUnionSpec cenv.amap m eenv.tyenv c.TyconRef tyargs
          let idx = c.Index
          let avoidHelpers = entityRefInThisAssembly cenv.g.compilingFslib c.TyconRef
          GenDecisionTreeTest cenv eenv.cloc cgbuf stackAtTargets e (Some (pop 1, Push [cenv.g.ilg.typ_Bool], Choice1Of2 (avoidHelpers, cuspec, idx))) eenv successTree failureTree targets repeatSP targetInfos sequel
  