mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 15:21:12 +00:00
Merge branch 'trunk' into refcount
This commit is contained in:
commit
695408e74e
4 changed files with 16 additions and 6 deletions
|
@ -202,7 +202,7 @@ pub fn gen(
|
|||
let proc = PartialProc {
|
||||
annotation: def.expr_var,
|
||||
// This is a 0-arity thunk, so it has no arguments.
|
||||
pattern_symbols: bumpalo::collections::Vec::new_in(arena),
|
||||
pattern_symbols: &[],
|
||||
body,
|
||||
};
|
||||
|
||||
|
|
|
@ -1349,7 +1349,17 @@ fn parse_and_constrain<'a>(
|
|||
);
|
||||
let canonicalize_end = SystemTime::now();
|
||||
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);
|
||||
|
||||
// Now that we're done with parsing, canonicalization, and constraint gen,
|
||||
|
|
|
@ -15,7 +15,7 @@ use std::collections::HashMap;
|
|||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub struct PartialProc<'a> {
|
||||
pub annotation: Variable,
|
||||
pub pattern_symbols: Vec<'a, Symbol>,
|
||||
pub pattern_symbols: &'a [Symbol],
|
||||
pub body: roc_can::expr::Expr,
|
||||
}
|
||||
|
||||
|
@ -426,7 +426,7 @@ fn patterns_to_when<'a>(
|
|||
) -> Result<
|
||||
(
|
||||
Vec<'a, Variable>,
|
||||
Vec<'a, Symbol>,
|
||||
&'a [Symbol],
|
||||
Located<roc_can::expr::Expr>,
|
||||
),
|
||||
Located<RuntimeError>,
|
||||
|
@ -483,7 +483,7 @@ fn patterns_to_when<'a>(
|
|||
}
|
||||
|
||||
match body {
|
||||
Ok(body) => Ok((arg_vars, symbols, body)),
|
||||
Ok(body) => Ok((arg_vars, symbols.into_bump_slice(), body)),
|
||||
Err(loc_error) => Err(loc_error),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#[link(name = "roc_app", kind = "static")]
|
||||
extern "C" {
|
||||
#[allow(improper_ctypes)]
|
||||
#[link_name = "$Test.main"]
|
||||
#[link_name = "$main"]
|
||||
fn list_from_roc() -> Box<[i64]>;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue