mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-18 09:39:47 +00:00
Allow type error config in uitest
This commit is contained in:
parent
f33651bf6a
commit
677d19d825
2 changed files with 3 additions and 1 deletions
|
@ -254,6 +254,7 @@ fn parse_queries(src: &str, line_info: &LineInfo) -> Vec<TypeQuery> {
|
||||||
|
|
||||||
#[derive(Default, Clone, Copy)]
|
#[derive(Default, Clone, Copy)]
|
||||||
pub struct InferOptions {
|
pub struct InferOptions {
|
||||||
|
pub allow_errors: bool,
|
||||||
pub print_can_decls: bool,
|
pub print_can_decls: bool,
|
||||||
pub print_only_under_alias: bool,
|
pub print_only_under_alias: bool,
|
||||||
pub no_promote: bool,
|
pub no_promote: bool,
|
||||||
|
@ -376,7 +377,7 @@ pub fn infer_queries<'a>(
|
||||||
if !can_problems.is_empty() && !allow_can_errors {
|
if !can_problems.is_empty() && !allow_can_errors {
|
||||||
return Err(format!("Canonicalization problems: {can_problems}",).into());
|
return Err(format!("Canonicalization problems: {can_problems}",).into());
|
||||||
}
|
}
|
||||||
if !type_problems.is_empty() {
|
if !type_problems.is_empty() && !options.allow_errors {
|
||||||
return Err(format!("Type problems: {type_problems}",).into());
|
return Err(format!("Type problems: {type_problems}",).into());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -254,6 +254,7 @@ impl<'a> TestCase<'a> {
|
||||||
for infer_opt in found_infer_opts {
|
for infer_opt in found_infer_opts {
|
||||||
let opt = infer_opt.name("opt").unwrap().as_str();
|
let opt = infer_opt.name("opt").unwrap().as_str();
|
||||||
match opt.trim() {
|
match opt.trim() {
|
||||||
|
"allow_errors" => infer_opts.allow_errors = true,
|
||||||
"print_only_under_alias" => infer_opts.print_only_under_alias = true,
|
"print_only_under_alias" => infer_opts.print_only_under_alias = true,
|
||||||
other => return Err(format!("unknown infer option: {other:?}").into()),
|
other => return Err(format!("unknown infer option: {other:?}").into()),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue