mirror of
https://github.com/roc-lang/roc.git
synced 2025-11-25 05:33:14 +00:00
Merge remote-tracking branch 'origin/trunk' into fix-comments
This commit is contained in:
commit
c09fd5ea91
3 changed files with 11 additions and 10 deletions
|
|
@ -8958,6 +8958,7 @@ where
|
|||
ToLowLevelCall: Fn(ToLowLevelCallArguments<'a>) -> Call<'a> + Copy,
|
||||
{
|
||||
match lambda_set.runtime_representation() {
|
||||
Layout::VOID => empty_lambda_set_error(),
|
||||
Layout::Union(union_layout) => {
|
||||
let closure_tag_id_symbol = env.unique_symbol();
|
||||
|
||||
|
|
@ -9117,6 +9118,11 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
fn empty_lambda_set_error() -> Stmt<'static> {
|
||||
let msg = "a Lambda Set is empty. Most likely there is a type error in your program.";
|
||||
Stmt::RuntimeError(msg)
|
||||
}
|
||||
|
||||
/// Use the lambda set to figure out how to make a call-by-name
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
fn match_on_lambda_set<'a>(
|
||||
|
|
@ -9131,6 +9137,7 @@ fn match_on_lambda_set<'a>(
|
|||
hole: &'a Stmt<'a>,
|
||||
) -> Stmt<'a> {
|
||||
match lambda_set.runtime_representation() {
|
||||
Layout::VOID => empty_lambda_set_error(),
|
||||
Layout::Union(union_layout) => {
|
||||
let closure_tag_id_symbol = env.unique_symbol();
|
||||
|
||||
|
|
@ -9260,9 +9267,7 @@ fn union_lambda_set_to_switch<'a>(
|
|||
// there is really nothing we can do here. We generate a runtime error here which allows
|
||||
// code gen to proceed. We then assume that we hit another (more descriptive) error before
|
||||
// hitting this one
|
||||
|
||||
let msg = "a Lambda Set isempty. Most likely there is a type error in your program.";
|
||||
return Stmt::RuntimeError(msg);
|
||||
return empty_lambda_set_error();
|
||||
}
|
||||
|
||||
let join_point_id = JoinPointId(env.unique_symbol());
|
||||
|
|
|
|||
|
|
@ -5,14 +5,10 @@ procedure List.5 (#Attr.2, #Attr.3):
|
|||
|
||||
procedure Test.2 (Test.3):
|
||||
let Test.7 : {} = Struct {};
|
||||
let Test.6 : {} = CallByName Test.8 Test.7;
|
||||
ret Test.6;
|
||||
|
||||
procedure Test.8 (Test.9):
|
||||
Error The `#UserApp.IdentId(8)` function could not be generated, likely due to a type error.
|
||||
Error a Lambda Set is empty. Most likely there is a type error in your program.
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.1 : List {} = Array [];
|
||||
let Test.1 : List [] = Array [];
|
||||
let Test.5 : {} = Struct {};
|
||||
let Test.4 : List {} = CallByName List.5 Test.1 Test.5;
|
||||
ret Test.4;
|
||||
|
|
|
|||
|
|
@ -2,5 +2,5 @@ procedure List.5 (#Attr.2, #Attr.3):
|
|||
Error UnresolvedTypeVar crates/compiler/mono/src/ir.rs line 5035
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.1 : List {} = Array [];
|
||||
let Test.1 : List [] = Array [];
|
||||
Error UnresolvedTypeVar crates/compiler/mono/src/ir.rs line 4562
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue