The docs say:
F# gives special status to non-virtual instance member properties compatible with type IDelegateEvent, generating approriate .NET metadata to make the member appear to other .NET languages as a .NET event.
But the behavior of IDelegateEvent and IEvent appears to be the same with or without the CLIEvent attribute.
I’m using 1.9.7.8.
IEvent inherits from IDelegateEvent, but puts an additional constraint on the type of delegate allowed (forcing it to return unit). IEvent also inherits from IObservable. Unless you want to have an event with a weird type, there’s no reason to rely on the base IDelegateEvent interface instead of the more common IEvent.
What do you mean when you say that
[<CLIEvent>]doesn’t make a difference? In FSI there is a bug which prevents events from being generated correctly on the type (e.g. as seen viaType.GetEvents()), but events are generated correctly when the code is compiled. Even is FSI you should see the add_ and remove_ methods being generated when you apply the[<CLIEvent>]attribute, though.