mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-18 01:29:47 +00:00
Merge pull request #3498 from rtfeldman/no-line-numbers-in-runtime-error-function
Remove compiler-file/line-dependent runtime error messages
This commit is contained in:
commit
d889f1fda9
2 changed files with 18 additions and 27 deletions
|
@ -80,18 +80,15 @@ macro_rules! return_on_layout_error_help {
|
||||||
($env:expr, $error:expr, $context_msg:expr) => {{
|
($env:expr, $error:expr, $context_msg:expr) => {{
|
||||||
match $error {
|
match $error {
|
||||||
LayoutProblem::UnresolvedTypeVar(_) => {
|
LayoutProblem::UnresolvedTypeVar(_) => {
|
||||||
return Stmt::RuntimeError($env.arena.alloc(format!(
|
return Stmt::RuntimeError(
|
||||||
"UnresolvedTypeVar {} at {}",
|
$env.arena
|
||||||
file!(),
|
.alloc(format!("UnresolvedTypeVar: {}", $context_msg,)),
|
||||||
$context_msg,
|
);
|
||||||
)));
|
|
||||||
}
|
}
|
||||||
LayoutProblem::Erroneous => {
|
LayoutProblem::Erroneous => {
|
||||||
return Stmt::RuntimeError($env.arena.alloc(format!(
|
return Stmt::RuntimeError(
|
||||||
"Erroneous {} at {}",
|
$env.arena.alloc(format!("Erroneous: {}", $context_msg,)),
|
||||||
file!(),
|
);
|
||||||
$context_msg,
|
|
||||||
)));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}};
|
}};
|
||||||
|
@ -4598,12 +4595,10 @@ pub fn with_hole<'a>(
|
||||||
);
|
);
|
||||||
|
|
||||||
if let Err(runtime_error) = inserted {
|
if let Err(runtime_error) = inserted {
|
||||||
return Stmt::RuntimeError(env.arena.alloc(format!(
|
return Stmt::RuntimeError(
|
||||||
"RuntimeError {} line {} {:?}",
|
env.arena
|
||||||
file!(),
|
.alloc(format!("RuntimeError: {:?}", runtime_error,)),
|
||||||
line!(),
|
);
|
||||||
runtime_error,
|
|
||||||
)));
|
|
||||||
} else {
|
} else {
|
||||||
drop(inserted);
|
drop(inserted);
|
||||||
}
|
}
|
||||||
|
@ -5321,16 +5316,14 @@ fn convert_tag_union<'a>(
|
||||||
Ok(cached) => cached,
|
Ok(cached) => cached,
|
||||||
Err(LayoutProblem::UnresolvedTypeVar(_)) => {
|
Err(LayoutProblem::UnresolvedTypeVar(_)) => {
|
||||||
return Stmt::RuntimeError(env.arena.alloc(format!(
|
return Stmt::RuntimeError(env.arena.alloc(format!(
|
||||||
"UnresolvedTypeVar {} line {}",
|
"Unresolved type variable for tag {}",
|
||||||
file!(),
|
tag_name.0.as_str()
|
||||||
line!()
|
|
||||||
)))
|
)))
|
||||||
}
|
}
|
||||||
Err(LayoutProblem::Erroneous) => {
|
Err(LayoutProblem::Erroneous) => {
|
||||||
return Stmt::RuntimeError(env.arena.alloc(format!(
|
return Stmt::RuntimeError(env.arena.alloc(format!(
|
||||||
"Erroneous {} line {}",
|
"Tag {} was part of a type error!",
|
||||||
file!(),
|
tag_name.0.as_str()
|
||||||
line!()
|
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -5613,9 +5606,7 @@ fn tag_union_to_function<'a>(
|
||||||
}
|
}
|
||||||
|
|
||||||
Err(runtime_error) => Stmt::RuntimeError(env.arena.alloc(format!(
|
Err(runtime_error) => Stmt::RuntimeError(env.arena.alloc(format!(
|
||||||
"RuntimeError {} line {} {:?}",
|
"Could not produce tag function due to a runtime error: {:?}",
|
||||||
file!(),
|
|
||||||
line!(),
|
|
||||||
runtime_error,
|
runtime_error,
|
||||||
))),
|
))),
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
procedure List.5 (#Attr.2, #Attr.3):
|
procedure List.5 (#Attr.2, #Attr.3):
|
||||||
Error UnresolvedTypeVar crates/compiler/mono/src/ir.rs at match_on_closure_argument
|
Error UnresolvedTypeVar: match_on_closure_argument
|
||||||
|
|
||||||
procedure Test.0 ():
|
procedure Test.0 ():
|
||||||
let Test.1 : List [] = Array [];
|
let Test.1 : List [] = Array [];
|
||||||
Error UnresolvedTypeVar crates/compiler/mono/src/ir.rs at Expr::Closure
|
Error UnresolvedTypeVar: Expr::Closure
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue