fsharp / fslang-design

RFCs and docs related to the F# language design process, see https://github.com/fsharp/fslang-suggestions to submit ideas
517 stars 144 forks source link

Update FS-1079-union-properties-visible => members to be created even when union has signature files #763

Closed T-Gro closed 8 months ago

T-Gro commented 8 months ago

Click “Files changed” → “⋯” → “View file” for the rendered RFC.

After the implementation of FS-1079 was merged in, @KevinRansom and I independently observed a failure in the compiler codebase when using a freshly built compiler with preview features on. Important to note, this FS-1079 was not actively used anywhere.

What happened is that unpickling metadata from the built Fsharp.Compiler.Service.dll failed when encountering a combination of:

The usage of that type from a different type meant using type information from the signature file. The resulting error was a general unpickling failure (".. error at node 6652") which only after rebuilding the compiler from scratch lead to the discovery of a union in module rec in .fsi undere that ID.

I believe the fix in https://github.com/dotnet/fsharp/pull/16657 is good, but we must acknowledge that the .fsi files will now expose the .Is* testers even for F# consumers, not just on IL level.