Update unused warnings for inline imports

Now that imports can be limited to smaller scopes than the entire module,
unused import warnings need to work like unused def warnings.

This commit moves unused import warnings discovery and reporting from load
to canonicalization where we can track their usage per scope.

This also fixes a longstanding bug where unused exposed names from an import
were not reported if they were only used in a qualified manner.
This commit is contained in:
Agus Zubiaga 2024-01-11 18:09:01 -03:00
parent 08e6b79dca
commit 7b3317dbb6
No known key found for this signature in database
18 changed files with 334 additions and 122 deletions

View file

@ -35,7 +35,7 @@ import Bool exposing [Bool, Eq]
import Result exposing [Result]
import List
import Str
import Num exposing [Nat, U64, F32, U32, U8, I8]
import Num exposing [Nat, U64, F32, U32, U8]
import Hash exposing [Hasher, Hash]
import Inspect exposing [Inspect, Inspector, InspectFormatter]

View file

@ -23,7 +23,7 @@ interface Hash
hashUnordered,
] imports []
import Bool exposing [Bool, isEq]
import Bool exposing [Bool]
import List
import Str
import Num exposing [

View file

@ -75,7 +75,7 @@ interface List
import Bool exposing [Bool, Eq]
import Result exposing [Result]
import Num exposing [Nat, Num, Int]
import Num exposing [Nat, Num]
## ## Types
##

View file

@ -28,7 +28,7 @@ interface Set
import List
import Bool exposing [Bool, Eq]
import Dict exposing [Dict]
import Dict
import Num exposing [Nat]
import Hash exposing [Hash, Hasher]
import Inspect exposing [Inspect, Inspector, InspectFormatter]

View file

@ -139,7 +139,7 @@ interface Str
]
imports []
import Bool exposing [Bool, Eq]
import Bool exposing [Bool]
import Result exposing [Result]
import List
import Num exposing [Nat, Num, U8, U16, U32, U64, U128, I8, I16, I32, I64, I128, F32, F64, Dec]

View file

@ -10,11 +10,11 @@ interface TotallyNotJson
import List
import Str
import Result exposing [Result]
import Encode exposing [Encoder, EncoderFormatting, appendWith]
import Result
import Encode exposing [EncoderFormatting, appendWith]
import Decode exposing [DecoderFormatting, DecodeResult]
import Num exposing [U8, U16, U32, U64, U128, I8, I16, I32, I64, I128, F32, F64, Nat, Dec]
import Bool exposing [Bool, Eq]
import Num exposing [U8, U16, U64, F32, F64, Nat, Dec]
import Bool exposing [Bool]
## An opaque type with the `EncoderFormatting` and
## `DecoderFormatting` abilities.