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

@ -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 {