Skip to content

Commit

Permalink
Implement eprintf and eprintfn
Browse files Browse the repository at this point in the history
Closes #1616.
  • Loading branch information
inosik authored and alfonsogarciacaro committed Oct 27, 2018
1 parent 17aea42 commit e276b90
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/dotnet/Fable.Compiler/Transforms/Replacements.fs
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,9 @@ let fsFormat (com: ICompiler) (ctx: Context) r t (i: CallInfo) (thisArg: Expr op
Helper.CoreCall("String", "toText", t, args, i.SignatureArgTypes, ?loc=r) |> Some
| "PrintFormatLine", _, _ ->
Helper.CoreCall("String", "toConsole", t, args, i.SignatureArgTypes, ?loc=r) |> Some
| ("PrintFormatToError"|"PrintFormatLineToError"), _, _ ->
// addWarning com ctx.FileName r "eprintf will behave as eprintfn"
Helper.CoreCall("String", "toConsoleError", t, args, i.SignatureArgTypes, ?loc=r) |> Some
| ("PrintFormatToTextWriter"|"PrintFormatLineToTextWriter"), _, _::args ->
// addWarning com ctx.FileName r "fprintfn will behave as printfn"
Helper.CoreCall("String", "toConsole", t, args, i.SignatureArgTypes, ?loc=r) |> Some
Expand Down Expand Up @@ -1079,6 +1082,8 @@ let operators (com: ICompiler) (ctx: Context) r t (i: CallInfo) (thisArg: Expr o
| ("PrintFormatToString" // sprintf
| "PrintFormatToStringThen" // Printf.ksprintf
| "PrintFormat" | "PrintFormatLine" // printf / printfn
| "PrintFormatToError" // eprintf
| "PrintFormatLineToError" // eprintfn
| "PrintFormatThen" // Printf.kprintf
| "PrintFormatToStringThenFail" // Printf.failwithf
| "PrintFormatToStringBuilder" // bprintf
Expand Down

0 comments on commit e276b90

Please sign in to comment.