mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 16:21:11 +00:00
dig into the lambda set to find more lambda sets
This commit is contained in:
parent
bedca00850
commit
53db40e2f4
2 changed files with 14 additions and 6 deletions
|
@ -117,11 +117,11 @@ pub enum ExecutionMode {
|
||||||
|
|
||||||
impl ExecutionMode {
|
impl ExecutionMode {
|
||||||
fn goal_phase(&self) -> Phase {
|
fn goal_phase(&self) -> Phase {
|
||||||
|
use ExecutionMode::*;
|
||||||
|
|
||||||
match self {
|
match self {
|
||||||
ExecutionMode::Executable => Phase::MakeSpecializations,
|
Executable => Phase::MakeSpecializations,
|
||||||
ExecutionMode::Check | ExecutionMode::ExecutableIfCheck | ExecutionMode::Test => {
|
Check | ExecutableIfCheck | Test => Phase::SolveTypes,
|
||||||
Phase::SolveTypes
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -907,6 +907,9 @@ impl<'a> Env<'a> {
|
||||||
FlatType::Func(_, lambda_set_var, _) => {
|
FlatType::Func(_, lambda_set_var, _) => {
|
||||||
result.insert(*lambda_set_var, lambda_set_id);
|
result.insert(*lambda_set_var, lambda_set_id);
|
||||||
lambda_set_id = lambda_set_id.next();
|
lambda_set_id = lambda_set_id.next();
|
||||||
|
|
||||||
|
// the lambda set itself can contain more lambda sets
|
||||||
|
stack.push(*lambda_set_var);
|
||||||
}
|
}
|
||||||
FlatType::Record(_, _) => todo!(),
|
FlatType::Record(_, _) => todo!(),
|
||||||
FlatType::Tuple(_, _) => todo!(),
|
FlatType::Tuple(_, _) => todo!(),
|
||||||
|
@ -934,8 +937,13 @@ impl<'a> Env<'a> {
|
||||||
Content::Alias(_, _, actual, _) => {
|
Content::Alias(_, _, actual, _) => {
|
||||||
stack.push(*actual);
|
stack.push(*actual);
|
||||||
}
|
}
|
||||||
Content::LambdaSet(_) => {
|
Content::LambdaSet(lambda_set) => {
|
||||||
unreachable!("should be caught FlatType::Func above");
|
// the lambda set itself should already be caught by Func above, but the
|
||||||
|
// capture can itself contain more lambda sets
|
||||||
|
for index in lambda_set.solved.variables() {
|
||||||
|
let subs_slice = self.subs.variable_slices[index.index as usize];
|
||||||
|
stack.extend(self.subs.variables[subs_slice.indices()].iter());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue