Explicit builtin import warning

We will now show a warning if a builtin is imported explicitly,
since this is unncessary.

We will not show the warning if they expose functions from the builtin:

	import Dict exposing [isEmpty]

However, we will show a special warning if they expose types from it:

	import Dict exposing [Dict, isEmpty]
This commit is contained in:
Agus Zubiaga 2024-04-14 10:46:37 -03:00
parent 3217e5a3f0
commit 979aff8bf7
No known key found for this signature in database
6 changed files with 144 additions and 8 deletions

View file

@ -4921,8 +4921,6 @@ mod test_reporting {
r#"
app "dict" imports [ Dict ] provides [main] to "./platform"
import Dict
myDict : Dict.Dict Num.I64 Str
myDict = Dict.insert (Dict.empty {}) "foo" 42
@ -4934,8 +4932,8 @@ mod test_reporting {
Something is off with the body of the `myDict` definition:
5 myDict : Dict.Dict Num.I64 Str
6 myDict = Dict.insert (Dict.empty {}) "foo" 42
3 myDict : Dict.Dict Num.I64 Str
4 myDict = Dict.insert (Dict.empty {}) "foo" 42
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This `insert` call produces:
@ -4952,7 +4950,7 @@ mod test_reporting {
alias_type_diff,
indoc!(
r#"
app "test" imports [Set.{ Set }] provides [main] to "./platform"
app "test" imports [] provides [main] to "./platform"
HSet a : Set a