Open auduchinok opened 6 years ago
Agreed
this is also the case with val
declarations.
In my current case this is especially unfortunate because I wanted to do this but that doesn't work :|
type Foo =
struct
[<CompiledName("type")>]
val mutable ``type``: int
end
Side note, this is at least the case for me looking at the IL output via sharplab.io
Well, it appears that the reflection does return the correct name. However the actual IL name is not the same. Is this by design?
// Fields
.field public valuetype [System.Private.CoreLib]System.Int32 'type'
.custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompiledNameAttribute::.ctor(class [System.Private.CoreLib]System.String) = (
01 00 04 74 79 70 65 00 00
)
When getting
CompiledName
for a symbol representing theFoo1
property the result isget_Foo1
(i.e. name of an accessor without applyingCompiledNameAttribute
) while I think it should beBar
instead (to be consistent with the attribute). There're separate symbols for accessors (when available) and they have improper names too (e.g.get_Foo1
,set_Foo1
).When getting
CompiledName
forFoo2
property the result isset_Foo2
and I expect it to be justFoo2
.