Merge pull request #6676 from roc-lang/ok-err

Allow the names `Ok` and `Err` as type aliases
This commit is contained in:
Richard Feldman 2024-04-27 06:49:46 -04:00 committed by GitHub
commit f7716188a1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 218 additions and 96 deletions

View file

@ -3395,6 +3395,7 @@ fn finish(
LoadedModule {
module_id: state.root_id,
filename: state.root_path,
interns,
solved,
can_problems: state.module_cache.can_problems,

View file

@ -30,6 +30,7 @@ use std::time::{Duration, Instant};
#[derive(Debug)]
pub struct LoadedModule {
pub module_id: ModuleId,
pub filename: PathBuf,
pub interns: Interns,
pub solved: Solved<Subs>,
pub can_problems: MutMap<ModuleId, Vec<roc_problem::can::Problem>>,
@ -54,6 +55,13 @@ pub struct LoadedModule {
}
impl LoadedModule {
/// Infer the filename for the given ModuleId, based on this root module's filename.
pub fn filename(&self, module_id: ModuleId) -> PathBuf {
let module_name = self.interns.module_name(module_id);
module_name.filename(&self.filename)
}
pub fn total_problems(&self) -> usize {
let mut total = 0;

View file

@ -989,8 +989,8 @@ fn issue_2863_module_type_does_not_exist() {
Did you mean one of these?
Decoding
Dict
Result
Dict
DecodeError
"
)