mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 16:21:11 +00:00
Merge pull request #1609 from rtfeldman/type-error-does-not-generate-function
Type error does not generate function
This commit is contained in:
commit
d15f7480dc
4 changed files with 66 additions and 6 deletions
|
@ -46,7 +46,14 @@ pub fn infer_borrow<'a>(
|
|||
// component (in top-sorted order, from primitives (std-lib) to main)
|
||||
|
||||
let successor_map = &make_successor_mapping(arena, procs);
|
||||
let successors = move |key: &Symbol| successor_map[key].iter().copied();
|
||||
let successors = move |key: &Symbol| {
|
||||
let slice = match successor_map.get(key) {
|
||||
None => &[] as &[_],
|
||||
Some(s) => s.as_slice(),
|
||||
};
|
||||
|
||||
slice.iter().copied()
|
||||
};
|
||||
|
||||
let mut symbols = Vec::with_capacity_in(procs.len(), arena);
|
||||
symbols.extend(procs.keys().map(|x| x.0));
|
||||
|
@ -217,7 +224,10 @@ impl<'a> DeclarationToIndex<'a> {
|
|||
}
|
||||
}
|
||||
}
|
||||
unreachable!("symbol/layout combo must be in DeclarationToIndex")
|
||||
unreachable!(
|
||||
"symbol/layout {:?} {:?} combo must be in DeclarationToIndex",
|
||||
needle_symbol, needle_layout
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue