-
Notifications
You must be signed in to change notification settings - Fork 838
Closed
Labels
Area-Compiler-CodeGenIlxGen, ilwrite and things at the backendIlxGen, ilwrite and things at the backendBugImpact-High(Internal MS Team use only) Describes an issue with extreme impact on existing code.(Internal MS Team use only) Describes an issue with extreme impact on existing code.
Description
We've faced an issue that internal function get inlined in the public one and this in turn leads to MethodAccessException on caller side.
Repro steps
Repro zip is attached. just run MethodAccessBug console application in Release mode (not reproduced in Debug)
Expected behavior
Call to internal function is not inlined an no exception is thrown
Actual behavior
Call to internal function is inlined an exception is thrown
Unhandled exception. System.MethodAccessException: Attempt by method '<StartupCode$MethodAccessBug>.$Program.main@()' to access method 'InternalLib.InternalModule.doSmth()' failed.
at <StartupCode$MethodAccessBug>.$Program.main@() in C:\Temp\MethodAccessBug\MethodAccessBug\Program.fs:line 3
Known workarounds
Decorate public method with
[<MethodImpl(MethodImplOptions.NoInlining)>]or with
[<NoCompilerInlining>]Related information
- Windows 11
- .NET 7
RahimovIR and Liminiens
Metadata
Metadata
Assignees
Labels
Area-Compiler-CodeGenIlxGen, ilwrite and things at the backendIlxGen, ilwrite and things at the backendBugImpact-High(Internal MS Team use only) Describes an issue with extreme impact on existing code.(Internal MS Team use only) Describes an issue with extreme impact on existing code.
Type
Projects
Status
Done