mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-31 09:07:21 +00:00
Report unrecognized shorthands when loading from the root module
This commit is contained in:
parent
5a1bf2b891
commit
7faff12cbf
7 changed files with 245 additions and 29 deletions
|
@ -463,6 +463,13 @@ impl<'a, T> PackageQualified<'a, T> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn package_shorthand(&self) -> Option<&'a str> {
|
||||
match self {
|
||||
PackageQualified::Unqualified(_) => None,
|
||||
PackageQualified::Qualified(package, _) => Some(package),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn map_module<B>(&self, f: impl FnOnce(&T) -> B) -> PackageQualified<'a, B> {
|
||||
match self {
|
||||
PackageQualified::Unqualified(name) => PackageQualified::Unqualified(f(name)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue