mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
lookup symbols when coming from Defs
This commit is contained in:
parent
db09d49cd7
commit
1e41aac0f2
2 changed files with 5 additions and 2 deletions
|
@ -10,6 +10,7 @@ use crate::annotation::IntroducedVariables;
|
|||
use crate::annotation::OwnedNamedOrAble;
|
||||
use crate::derive;
|
||||
use crate::env::Env;
|
||||
use crate::expr::get_lookup_symbols;
|
||||
use crate::expr::AccessorData;
|
||||
use crate::expr::AnnotatedMark;
|
||||
use crate::expr::ClosureData;
|
||||
|
@ -2395,10 +2396,12 @@ fn decl_to_let(decl: Declaration, loc_ret: Loc<Expr>) -> Loc<Expr> {
|
|||
|
||||
for ((expect_region, condition_region), condition) in it {
|
||||
let region = Region::span_across(&expect_region, &loc_ret.region);
|
||||
let lookups_in_cond = get_lookup_symbols(&condition);
|
||||
|
||||
let expr = Expr::Expect {
|
||||
loc_condition: Box::new(Loc::at(condition_region, condition)),
|
||||
loc_continuation: Box::new(loc_ret),
|
||||
lookups_in_cond: vec![],
|
||||
lookups_in_cond,
|
||||
};
|
||||
|
||||
loc_ret = Loc::at(region, expr);
|
||||
|
|
|
@ -2778,7 +2778,7 @@ pub struct DestructureDef {
|
|||
pub pattern_vars: VecMap<Symbol, Variable>,
|
||||
}
|
||||
|
||||
fn get_lookup_symbols(expr: &Expr) -> Vec<ExpectLookup> {
|
||||
pub(crate) fn get_lookup_symbols(expr: &Expr) -> Vec<ExpectLookup> {
|
||||
let mut stack: Vec<&Expr> = vec![expr];
|
||||
let mut lookups: Vec<ExpectLookup> = Vec::new();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue