dotnet / dotnet/fsharp

Unused opens/values false positives with type check errors

Open
#16,415 0 comments 1 reaction 0 assignees View on GitHub
Area-Compiler-Checking Area-LangService-UnusedOpens Bug Impact-Low
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 22h
Merged PRs (30d)
144

Description

![devenv_J7wO1K7nma](https://github.com/dotnet/fsharp/assets/5063478/6a696416-6aec-4ad4-9e06-94437929ade3)

The type checker sometimes exits early and doesn't dive into inner expressions after it has encountered an error (probably to avoid a potential cascade of unhelpful error messages). Unused opens/values analysis then works with incomplete data. I suggest we suspend this analysis if the document contains any errors.

**Expected behavior**

`System` and `args` are greyed out.

**Actual behavior**

`System` and `args` are not shown as unused.

**Related information**

VS 17.9.0 Preview 1.0

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.