anchor.diff:          
           let ctx, bindings =
               ((ctx, []), foldArgs [] (inExpr.Args, args)) ||> List.fold (fun (ctx, bindings) (argId, arg) ->
  -                let argId = resolveInlinedIdent ctx info argId
  +                let argId = resolveInlineIdent ctx info argId
                   // Change type and mark argId as compiler-generated so Fable also
                   // tries to inline it in DEBUG mode (some patterns depend on this)
                   let argId = { argId with Type = arg.Type; IsCompilerGenerated = true }
  
positive.code:                 ctx.UsedNamesInDeclarationScope.Add(resolvedName) |> ignore
                  info.ResolvedIdents.Add(ident.Name, resolvedName)
                  resolvedName
          { ident with Name = sanitizedName; Type = resolveInlinedGenArg ctx ident.Type }
      else ident
  
  let resolveInlinedCallInfo com ctx info (callInfo: Fable.CallInfo) =
      { callInfo with
            ThisArg = Option.map (resolveInlinedExpr com ctx info) callInfo.ThisArg
            Args = List.map (resolveInlinedExpr com ctx info) callInfo.Args
            GenericArgs = List.map (resolveInlinedGenArg ctx) callInfo.GenericArgs }
  
  let resolveInlinedExpr (com: IFableCompiler) ctx info expr =
      // TODO: At this point we should probably deal with all cases instead of using visitFromOutsideIn
      expr |> visitFromOutsideIn (function
          // Resolve bindings
          | Fable.Let(i, v, b) ->
              let i = resolveInlinedIdent ctx info i
              let v = resolveInlinedExpr com ctx info v
              let ctx = { ctx with Scope = (None, i, Some v)::ctx.Scope }
              Fable.Let(i, v, resolveInlinedExpr com ctx info b) |> Some
  
          | Fable.LetRec(bindings, b) ->
              let ctx, bindings =
                  ((ctx, bindings), bindings) ||> List.fold(fun (ctx, bindings) (i, e) ->
                      let i = resolveInlinedIdent ctx info i
                      let e = resolveInlinedExpr com ctx info e
                      { ctx with Scope = (None, i, Some e)::ctx.Scope }, (i, e)::bindings)
              Fable.LetRec(List.rev bindings, resolveInlinedExpr com ctx info b) |> Some
  
          // Resolve idents and gen args in other expressions
          | Fable.Call(callee, callInfo, typ, r) ->
              let callInfo = resolveInlinedCallInfo com ctx info callInfo
              Fable.Call(resolveInlinedExpr com ctx info callee, callInfo, resolveInlinedGenArg ctx typ, r) |> Some
          | Fable.Emit(emitInfo, typ, r) ->
              let emitInfo = { emitInfo with CallInfo = resolveInlinedCallInfo com ctx info emitInfo.CallInfo }
              Fable.Emit(emitInfo, resolveInlinedGenArg ctx typ, r) |> Some
          | Fable.IdentExpr i -> Fable.IdentExpr(resolveInlinedIdent ctx info i) |> Some
          | Fable.Lambda(arg, b, n) -> Fable.Lambda(resolveInlinedIdent ctx info arg, resolveInlinedExpr com ctx info b, n) |> Some
          | Fable.Delegate(args, b, n) -> Fable.Delegate(List.map (resolveInlinedIdent ctx info) args, resolveInlinedExpr com ctx info b, n) |> Some
          | Fable.DecisionTree(e, targets) -> Fable.DecisionTree(resolveInlinedExpr com ctx info e, targets |> List.map(fun (idents, e) -> List.map (resolveInlinedIdent ctx info) idents, resolveInlinedExpr com ctx info e)) |> Some
          | Fable.ForLoop(i, s, l, b, u, r) -> Fable.ForLoop(resolveInlinedIdent ctx info i, resolveInlinedExpr com ctx info s, resolveInlinedExpr com ctx info l, resolveInlinedExpr com ctx info b, u, r) |> Some
          | Fable.TryCatch(b, c, d, r) -> Fable.TryCatch(resolveInlinedExpr com ctx info b, (c |> Option.map (fun (i, e) -> resolveInlinedIdent ctx info i, resolveInlinedExpr com ctx info e)), (d |> Option.map (resolveInlinedExpr com ctx info)), r) |> Some
          | Fable.ObjectExpr(members, t, baseCall) ->
              let members = members |> List.map (fun m ->
                  { m with Args = List.map (fun a -> { a with Ident = resolveInlinedIdent ctx info a.Ident }) m.Args
                           Body = resolveInlinedExpr com ctx info m.Body })
              Fable.ObjectExpr(members, resolveInlinedGenArg ctx t, baseCall |> Option.map (resolveInlinedExpr com ctx info)) |> Some
  
          // Resolve imports. TODO: add test
          | Fable.Import(importInfo, t, r) as e ->
              if Path.isRelativePath importInfo.Path then
                  // If it happens we're importing a member in the current file
                  // use IdentExpr instead of Import
                  let isImportToSameFile =
                      info.FileName = com.CurrentFile && (
                          let dirName, info = Path.GetDirectoryAndFileNames(importInfo.Path)
                          dirName = "." && info = Path.GetFileName(com.CurrentFile)
                      )
                  if isImportToSameFile then
                      Fable.IdentExpr { makeTypedIdent t importInfo.Selector with Range = r }
                  else
                      let path = fixImportedRelativePath com importInfo.Path info.FileName
                      Fable.Import({ importInfo with Path = path }, t, r)
              else e
              |> Some
  
          // Resolve type info
          | Fable.Value(Fable.TypeInfo(t, d), r) ->
              let t = resolveInlinedGenArg ctx t
              Fable.Value(Fable.TypeInfo(t, d), r) |> Some
  
          // Resolve the unresolved
          | Fable.Unresolved(e, t, r) ->
              match e with
              | Fable.UnresolvedTraitCall(sourceTypes, traitName, isInstance, argTypes, argExprs) ->
                  let t = resolveInlinedGenArg ctx t
                  let argTypes = argTypes |> List.map (resolveInlinedGenArg ctx)
                  let argExprs = argExprs |> List.map (resolveInlinedExpr com ctx info)
  
                  match tryFindWitness ctx argTypes isInstance traitName with
                  | None ->
                     let sourceTypes = sourceTypes |> List.map (resolveInlinedGenArg ctx)
                     transformTraitCall com ctx r t sourceTypes traitName isInstance argTypes argExprs |> Some
                  | Some w ->
                      let callee = resolveInlinedExpr com ctx { info with FileName = w.FileName } w.Expr
                      let callInfo = makeCallInfo None argExprs argTypes
                      makeCall r t callInfo callee |> Some            
  
              | Fable.UnresolvedInlineCall(membUniqueName, witnesses, callee, callInfo) ->
                  let t = resolveInlinedGenArg ctx t
                  let callee = callee |> Option.map (resolveInlinedExpr com ctx info)
                  let callInfo = resolveInlinedCallInfo com ctx info callInfo
                  let ctx = { ctx with Witnesses = witnesses @ ctx.Witnesses }
                  inlineExpr com ctx r t callee callInfo membUniqueName |> Some
                  
              | Fable.UnresolvedReplaceCall(thisArg, args, callInfo, attachedCall) ->
                  let resolveArg arg =
                      let arg = resolveInlinedExpr com ctx info arg
                      let t = arg.Type
                      let t' = resolveInlinedGenArg ctx t
                      if t <> t' then Fable.TypeCast(arg, t') else arg
  
                  let typ = resolveInlinedGenArg ctx t
                  let thisArg = thisArg |> Option.map resolveArg
                  let args = args |> List.map resolveArg
                  let callInfo = { callInfo with GenericArgs = callInfo.GenericArgs |> List.map (resolveInlinedGenArg ctx) }
                  match com.TryReplace(ctx, r, typ, callInfo, thisArg, args) with
                  | Some e -> Some e
                  | None when callInfo.IsInterface ->
                      match attachedCall with
                      | Some e -> resolveInlinedExpr com ctx info e |> Some
                      | None ->
                          "Unexpected, missing attached call in unresolved replace call"
                          |> addErrorAndReturnNull com ctx.InlinePath r
                          |> Some
                  | None -> failReplace com ctx r callInfo |> Some
  
          | _ -> None)
  
  type FableCompiler(com: Compiler) =
      let attachedMembers = Dictionary<string, _>()
  
negative.code:         | _, None -> ""
      getRootModuleInner None declarations
  
  let resolveInlineType (ctx: Context) = function
      | Fable.GenericParam(name,_) as v ->
          match Map.tryFind name ctx.GenericArgs with
          | Some v -> v
          | None -> v
      | t -> t.MapGenerics(resolveInlineType ctx)
  
  type InlineExprInfo = {
      FileName: string
  