-
Notifications
You must be signed in to change notification settings - Fork 845
Description
During using Code Lens I noticed in some cases multiple annotations which was obviously a bug. Cause of such were auto-generated methods / fields by the compiler which we're all on the same line (because they are virtual but need some kind of placement). To fix this I tried filtering each FSharpMemberOfFunctionOrValue element out which func.IsCompilerGenerated was true. However I noticed that several methods were not flagged although they are compiler generated.
Example:
type Foo() =
let foo = new Event<int>()
member __.bar1 =
foo.Publish
[<CLIEvent>]
member __.bar2 =
foo.Publish The compiler generates here getter and setter for both members but does not flag them as compiler generated. Also the generated methods are not flagged as event neither as getter or setter method for events (e.g. IsEventAddMethodor IsEventRemoveMethod) which I think is wrong too.
Repro Steps
- Create a new F# project
- Add the F# Compiler Service package to it
- Iterate over func declarations of the example code below (use the checker)
- Print out whether methods are compiler generated
Expected behavior
Methods which are compiler generated should have the flag IsCompilerGenerated set to true.
Moreover relevant flags like IsEventAddMethod should be set to true too for events.
Here a text file which contains the output for the remove method of bar2 from the example:
EventAutogeneratedBug.txt
Metadata
Metadata
Assignees
Labels
Type
Projects
Status