-
Notifications
You must be signed in to change notification settings - Fork 834
Labels
Area-Compiler-CodeGenIlxGen, ilwrite and things at the backendIlxGen, ilwrite and things at the backendBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.(Internal MS Team use only) Describes an issue with limited impact on existing code.
Milestone
Description
Repro steps
-
Create a new test project
dotnet new xunit -lang f# -
Add the following code:
open System
type DelegateWithOptionalParam = delegate of ?opt:string -> unit
let instanceOfDelegate = DelegateWithOptionalParam(ignore)
let ``Invoke delegate`` () =
instanceOfDelegate.Invoke(opt="")
Expected behavior
The code compiles.
Actual behavior
FSC : error FS2014: A problem occurred writing the binary '/Users/mathieu/src/tmp/fs_compiler_crash/obj/Debug/netcoreapp2.1/fs_compiler_crash.dll': Error in pass3 for type Tests, error: Error in GetMethodRefAsMethodDefIdx for mref = ("Invoke", "DelegateWithOptionalParam"), error: Exception of type 'Microsoft.FSharp.Compiler.AbstractIL.ILBinaryWriter+MethodDefNotFound' was thrown. [/Users/mathieu/src/tmp/fs_compiler_crash/fs_compiler_crash.fsproj]
Known workarounds
This pattern is perhaps not that common, so might not be used that often.
Related information
Provide any related information
- Operating system: Mac OS X 10.13.5
- .NET Runtime: CoreCLR 2.1.300
- Indications of severity: Low
ijklam
Metadata
Metadata
Assignees
Labels
Area-Compiler-CodeGenIlxGen, ilwrite and things at the backendIlxGen, ilwrite and things at the backendBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.(Internal MS Team use only) Describes an issue with limited impact on existing code.
Type
Projects
Status
New