fsharp icon indicating copy to clipboard operation
fsharp copied to clipboard

Fix 16105 - Release inline optimization leads to MethodAccessException if used with assembly:InternalsVisibleTo attribute

Open KevinRansom opened this issue 1 year ago • 1 comments

Fixes #16105

When doing cross assembly optimisation, the FSharp optimiser incorrectly inlines function calls from a second assembly that contain internal method calls to a third assembly assembly, with internals visible to.

The fix is to spot that the method call to an internal member in an external assembly is about to happen, and to not inline it.

This adds a couple of test cases, one for calling an internal Api with friends visible to. Also one calling a public member to ensure inlining still happens properly.

Also renames and moves a few test cases to ensure that when testing, file paths doesn't spill over the max path length.

KevinRansom avatar Feb 20 '24 11:02 KevinRansom

:heavy_exclamation_mark: Release notes required


:white_check_mark: Found changes and release notes in following paths:

Change path Release notes path Description
src/Compiler docs/release-notes/.FSharp.Compiler.Service/8.0.300.md

github-actions[bot] avatar Feb 20 '24 11:02 github-actions[bot]

/azp run

psfinaki avatar Feb 27 '24 11:02 psfinaki

Azure Pipelines successfully started running 2 pipeline(s).

azure-pipelines[bot] avatar Feb 27 '24 11:02 azure-pipelines[bot]