dotnet / dotnet/fsharp

Some user defined symbols started to get CompilerGeneratedAttribute

Open
#15,352 0 comments 1 reaction 1 assignee Claimed by @KevinRansom View on GitHub
Area-Compiler-CodeGen Bug Impact-Low
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 22h
Merged PRs (30d)
144

Description

In this bug report : @auduchinok provided some code that added a DebuggerNonUserCode attribute for user provided code.

https://github.com/dotnet/fsharp/issues/15298, that bug is fixed in the latest retail release of the compiler. However, while reviewing the bug there is also a CompilerGeneratedAttribute for the user provided code. This attribute is probably misleading and should not be produced here. I checked back and this is not a recent introduction, it has been in the compiler at lease since: dotnet sdk 3,0

````
type T() =
let f x = x + 1
````
IL
````
.method assembly hidebysig
instance int32 f (
int32 x
) cil managed
{
.custom instance void [netstandard]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = (
01 00 00 00
)
// Method begins at RVA 0x205c
// Header size: 1
// Code size: 4 (0x4)
.maxstack 8

// return x + 1;
IL_0000: ldarg.1
IL_0001: ldc.i4.1
IL_0002: add
IL_0003: ret
} // end of method T::f
````

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.