Error FS1113 when creating a class with a class scope self-identifier and an inline member #17899
Labels
Area-Compiler-Checking
Type checking, attributes and all aspects of logic checking
Bug
Impact-Low
(Internal MS Team use only) Describes an issue with limited impact on existing code.
Milestone
Repro steps
The following code can easily reproduce the error:
It also happens when the self-identifier is the same:
And even when using '_' for the member-scope self-identifier:
Expected behavior
Successful build
Actual behavior
The build fails with the following error: "Error FS1113 : The value 'test' was marked inline but its implementation makes use of an internal or private function which is not sufficiently accessible"
Known workarounds
Either make the inline function external and receive the instance as an argument or rework every 'let' that needs the class-scope self-identifier to be a member that uses a function-scoped self-identifier instead.
Related information
I needed an inline function for a member constraint in my real use case. It worked perfectly until I added the self-identifier for use in some other function.
Windows 10
.NET 8.0
Rider
The text was updated successfully, but these errors were encountered: