question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Code using records causes multiemit warning

See original GitHub issue

The following two interactions in F# Interactive cause a multi-emit warning: Run:

artifacts\bin\fsi\Release\net472\fsi.exe --multiemit

then

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

then

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

Gives:

stdin(3,1): warning FS2303: 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.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
KevinRansomcommented, Jan 6, 2023

Here: This is what we currently ship: image

This includes my fix: note the deprecation warning has gone away, as has the 30 execution limits image

0reactions
knoctecommented, Jan 9, 2023

Thanks @KevinRansom , but actually I’ve realised that this initial bug report talked about records while I discovered it when using DUs; so I should have posted my comment in this other bug: https://github.com/dotnet/fsharp/issues/14216 (which now you might want to mark as closed).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Records with different fields for its constructors can cause a ...
Problem with warning is that if you know which constructor you have by pattern matching then you would receive false warning: f x@(ExecFail ......
Read more >
Use C# 9 records and init-only properties in ReSharper ...
Because init-only properties are immutable by default, they are only mutable in the constructor and initializer. A quick-fix makes it easy to ...
Read more >
C# 9.0 on the record - .NET Blog
It is an error to call them from anywhere outside of the top level statement section. Improved pattern matching. Several new kinds of...
Read more >
How to make multiple versions of the same record, with F# ...
So I would like to figure out if there is a way to make a record I can extend but that contains a...
Read more >
Send different status codes with payload
REST service - Send different status codes with payload. The resource method can return a subtype of the http:StatusCodeResponse record type with a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found