mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 15:21:12 +00:00
Add builtin defs in load::file
This commit is contained in:
parent
3162d2fb5f
commit
5f73a0b7ca
1 changed files with 11 additions and 1 deletions
|
@ -1349,7 +1349,17 @@ fn parse_and_constrain<'a>(
|
||||||
);
|
);
|
||||||
let canonicalize_end = SystemTime::now();
|
let canonicalize_end = SystemTime::now();
|
||||||
let (module, declarations, ident_ids, constraint, problems) = match canonicalized {
|
let (module, declarations, ident_ids, constraint, problems) = match canonicalized {
|
||||||
Ok(module_output) => {
|
Ok(mut module_output) => {
|
||||||
|
// Add builtin defs (e.g. List.get) to the module's defs
|
||||||
|
let builtin_defs = roc_can::builtins::builtin_defs(&mut var_store);
|
||||||
|
let references = &module_output.references;
|
||||||
|
|
||||||
|
for (symbol, def) in builtin_defs {
|
||||||
|
if references.contains(&symbol) {
|
||||||
|
module_output.declarations.push(Declaration::Builtin(def));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let constraint = constrain_module(&module_output, module_id, mode, &mut var_store);
|
let constraint = constrain_module(&module_output, module_id, mode, &mut var_store);
|
||||||
|
|
||||||
// Now that we're done with parsing, canonicalization, and constraint gen,
|
// Now that we're done with parsing, canonicalization, and constraint gen,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue