Consuming a CLIEvent uses hidden closures, disallowing `base.Event`
Open
Area-Compiler-Checking
Area-Compiler-Checking-Accessibility
Feature Request
- Dominant language
- F#
- Stars
- 4.3k
- Forks
- 876
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 131
Description
Consuming an event creates a closure, requiring a `as self` reference. This doesn't seem necessary.
```fsharp
type A() =
[]
member val Event =
(new DelegateEvent()).Publish
type B() =
inherit A()
do base.Event.Add ignore // Error: 'base' values may only be used to make direct calls...
```
Even `let x = base.Event` is not allowed.
NOTE: the workaround is to use the implicit `add_Event` explicitly:
```fsharp
open System
type A() =
[]
member val Event =
(new DelegateEvent()).Publish
type B() =
inherit A()
do base.add_Event (fun _ _ -> ())
```
Contributor guide
Assessment
This issue has not been assessed yet.