fsprojects / FSharp.Formatting

F# tools for generating documentation (Markdown processor and F# code formatter)
https://fsprojects.github.io/FSharp.Formatting/
Other
462 stars 155 forks source link

v15.0.0 gives --multiemit warnings when accessing types defined in prior snippets #740

Closed nhirschey closed 1 year ago

nhirschey commented 2 years ago

It looks like changes for fsi script debugging in .net6.0 (https://github.com/dotnet/fsharp/pull/12722) are causing multi-emit warnings in v15 versions of fsdocs-tool.

To reproduce, I create a blank docs folder and add index.fsx with this:


type Test = { A: int; B: string }

let list = [{ A = 1; B = "a" }; { A = 2; B = "b" }; { A = 3; B = "c" }]
[ for x in list do x.A ]

(***include-fsi-output***)

[ for x in list do x ]
(***include-fsi-output***)

[ for x in list do x.A ]
(***include-fsi-output***)

When I run dotnet fsdocs watch --eval I get this below. Note the warning in the last snippet, with full text

input.fsx (1,1)-(1,25) interactive warning Accessing the internal type, method or field 'A@' from a previous evaluation in F# Interactive is deprecated and may cause subsequent access errors. To enable the legacy generation of a single dynamic assembly that can access internals, use the '--multiemit-' option."

image

Tools info

{
  "version": 1,
  "isRoot": true,
  "tools": {
    "fsdocs-tool": {
      "version": "15.0.0",
      "commands": [
        "fsdocs"
      ]
    }
  }
}
dsyme commented 2 years ago

Thank you, tbh this may indicate a bug in multi-emit in F# Interactive itself, I'll look into it.

dsyme commented 2 years ago

Bug recorded here: https://github.com/dotnet/fsharp/issues/12886

nhirschey commented 1 year ago

This issue about multi-emit warnings is fixed. I've confirmed in fsdocs version 17.3.0

image