-
Notifications
You must be signed in to change notification settings - Fork 852
Closed as not planned
Copy link
Labels
Milestone
Description
When opening a namespace that contains a type annotated with [<AutoOpen>], the open is identified as being unused even when the static members of the type are referenced.
Here is a test that triggers the diagnostic: main...joprice:fsharp:autoOpenType
From a quick inspection of the code, I would guess this has to do with this guard, which only checks for declarations in namespaces and modules, but not static type members:
| | Some entity when entity.IsNamespace || entity.IsFSharpModule -> |
Expected behavior
Unused open analysis should behave with respect to [<AutoOpen>] for types as it does for modules.
Actual behavior
The open is marked as unused, even though removing it causes the file to fail to compile.
Known workarounds
Fully qualify the member access.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
New