mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 00:01:16 +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
|
@ -384,6 +384,11 @@ impl ModuleId {
|
|||
.get_name(self)
|
||||
.unwrap_or_else(|| internal_error!("Could not find ModuleIds for {:?}", self))
|
||||
}
|
||||
|
||||
pub fn is_automatically_imported(self) -> bool {
|
||||
// The deprecated TotallyNotJson module is not automatically imported.
|
||||
self.is_builtin() && self != ModuleId::JSON
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for ModuleId {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue