mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 12:18:19 +00:00
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:
parent
3217e5a3f0
commit
979aff8bf7
6 changed files with 144 additions and 8 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue