-
Notifications
You must be signed in to change notification settings - Fork 831
Description
Unfortunately I don't have a minimal repro. But in one of my projects, I have this code:
logOpStart "StringToken.setValue" {|
Principal = principal |> SuperuserPrincipal.getUser
Value = value
Token = tokenId
String = string.Id
|}Expected behavior
Compilation succeeds.
Actual behavior
I get this error:
internal error: One of your modules expects the type '<>f__AnonymousType1106283195`4' to be defined within the module being emitted. You may be missing an input file
It seems to come from here:
fsharp/src/Compiler/AbstractIL/ilwrite.fs
Line 685 in 448ab61
| errorR(InternalError("One of your modules expects the type '"+String.concat "." (enc@[n])+"' to be defined within the module being emitted. You may be missing an input file", range0)) |
Known workarounds
Adding another dummy field fixed the issue:
logOpStart "StringToken.setValue" {|
Principal = principal |> SuperuserPrincipal.getUser
Value = value
Token = tokenId
String = string.Id
Dummy = ()
|}Just out of curiosity, I tried replacing logOpStart "StringToken.setValue" with ignore. That caused three errors to show up. I assume all were for this record, because all three error messages were identical to the original one.
Note also that I have many hundreds of places in my code base with similar code, all on the form logOpStart "someString" {| ... |}. But I only get the problem with this one.
Related information
Provide any related information (optional):
- Operating system: Win11
- .NET Runtime kind (.NET Core, .NET Framework, Mono): I guess this is not relevant since this is a compile time error
- Editing Tools (e.g. Visual Studio Version, Visual Studio): Rider 2023.1.2
Metadata
Metadata
Assignees
Labels
Type
Projects
Status