anchor.diff:          let publicName = if isPublic then Some entName else None
           declInfo.AddIgnoredChild ent
           declInfo.AddDeclaration(decl, ?publicName=publicName)
  -        declInfo, ctx
  +        ctx
       elif declInfo.IsIgnoredEntity ent
       then
           declInfo.AddIgnoredChild ent
  -        declInfo, ctx
  +        ctx
       else
  -    let childDecls =
  -        let ctx = { ctx with enclosingModule = EnclosingModule(com.GetEntity ent, isPublicEntity ctx ent) }
  -        transformDeclarations com ctx subDecls
  -    if List.isEmpty childDecls && ent.IsFSharpModule
  -    then
  -        declInfo, ctx
  -    else
  -        // Bind entity name to context to prevent name clashes (it will become a variable in JS)
  -        let ctx, ident = sanitizeEntityName ent |> bindIdentWithExactName com ctx Fable.Any None
  -        declInfo.AddChild(com, ctx, ent, ident.Name, childDecls)
  -        declInfo, ctx
  +        let childDecls =
  +            let ctx = { ctx with enclosingModule = EnclosingModule(com.GetEntity ent, isPublicEntity ctx ent) }
  +            transformDeclarations com ctx subDecls
  +        if List.isEmpty childDecls && ent.IsFSharpModule
  +        then
  +            ctx
  +        else
  +            // Bind entity name to context to prevent name clashes (it will become a variable in JS)
  +            let ctx, ident = sanitizeEntityName ent |> bindIdentWithExactName com ctx Fable.Any None
  +            declInfo.AddChild(com, ctx, ent, ident.Name, childDecls)
  +            ctx
   
   and private transformDeclarations (com: IFableCompiler) ctx decls =
  -    let declInfo, _ =
  -        decls |> List.fold (fun (declInfo: DeclInfo, ctx) decl ->
  -            match decl with
  -            | FSharpImplementationFileDeclaration.Entity (e, sub) ->
  -                transformEntityDecl com ctx declInfo e sub
  -            | FSharpImplementationFileDeclaration.MemberOrFunctionOrValue (meth, args, body) ->
  -                transformMemberDecl com ctx declInfo meth args body
  -            | FSharpImplementationFileDeclaration.InitAction fe ->
  -                let e = com.Transform ctx fe
  -                declInfo.AddDeclaration(Fable.ActionDeclaration (e, makeRangeFrom fe))
  -                declInfo, ctx
  -        ) (DeclInfo(com, ctx.fileName), ctx)
  -    declInfo.GetDeclarations(com, ctx)
  +    let declInfo = DeclInfo(com, ctx.fileName)
  +    (ctx, decls) ||> List.fold (fun ctx decl ->
  +        match decl with
  +        | FSharpImplementationFileDeclaration.Entity (e, sub) ->
  +            transformEntityDecl com ctx declInfo e sub
  +        | FSharpImplementationFileDeclaration.MemberOrFunctionOrValue (meth, args, body) ->
  +            transformMemberDecl com ctx declInfo meth args body
  +        | FSharpImplementationFileDeclaration.InitAction fe ->
  +            let e = com.Transform ctx fe
  +            declInfo.AddDeclaration(Fable.ActionDeclaration (e, makeRangeFrom fe))
  +            ctx)
  +    |> ignore
  +    declInfo.GetDeclarations(com)
   
   let private getRootModuleAndDecls decls =
       let rec getRootModuleAndDecls outerEnt decls =
  
positive.code:         addMethod range import meth args body
      elif declInfo.IsIgnoredMethod meth
      then
          declInfo, ctx
      elif isInline meth
      then
          // Inlining custom type operators is problematic, see #230
  
negative.code:                 | _ -> args
                  |> Seq.collect id |> countRefs body
              com.AddInlineExpr(meth.FullName, (upcast vars, body))
              ctx
      else addMethod range None meth args body
  
  let rec private transformEntityDecl (com: IFableCompiler) ctx (declInfo: DeclInfo)
  