mirror of
https://github.com/roc-lang/roc.git
synced 2024-09-22 08:17:40 +03:00
Old implementations can be overwritten before solving
This commit is contained in:
parent
7298705db7
commit
bd5f5ed735
@ -504,8 +504,12 @@ impl IAbilitiesStore<Pending> {
|
||||
|
||||
let old_declared_impl = self.declared_implementations.insert(impl_key, member_impl);
|
||||
debug_assert!(
|
||||
old_declared_impl.is_none(),
|
||||
"Replacing existing declared impl!"
|
||||
old_declared_impl.is_none() ||
|
||||
// Can happen between we import declared implementations during canonicalization, but
|
||||
// implementation information only after solving
|
||||
old_declared_impl.unwrap() == member_impl,
|
||||
"Replacing existing declared impl: {:?}",
|
||||
(impl_key, old_declared_impl)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -345,6 +345,9 @@ fn start_phase<'a>(
|
||||
)
|
||||
});
|
||||
|
||||
// Add the declared abilities from the modules we import;
|
||||
// we may not know all their types yet since type-solving happens in
|
||||
// parallel, but we'll fill that in during type-checking our module.
|
||||
abilities_store
|
||||
.union(import_store.closure_from_imported(exposed_symbols));
|
||||
}
|
||||
@ -4335,6 +4338,9 @@ pub fn add_imports(
|
||||
import_variables.push(list_len_type);
|
||||
}
|
||||
|
||||
// Fill in the implementation information of the abilities from the modules we import, which we
|
||||
// now know because all imported modules should be solved by now.
|
||||
//
|
||||
// TODO: see if we can reduce the amount of specializations we need to import.
|
||||
// One idea is to just always assume external modules fulfill their specialization obligations
|
||||
// and save lambda set resolution for mono.
|
||||
|
Loading…
Reference in New Issue
Block a user