mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 22:09:09 +00:00
Report missing params
This commit is contained in:
parent
bc6a84a215
commit
922b1c44ef
16 changed files with 286 additions and 93 deletions
|
@ -1313,7 +1313,6 @@ pub fn can_problem<'b>(
|
|||
doc = report.doc;
|
||||
title = report.title;
|
||||
}
|
||||
Problem::MissingParams { .. } => todo!("agus"),
|
||||
Problem::UnexpectedParams { module_id, region } => {
|
||||
doc = alloc.stack([
|
||||
alloc.reflow("This import specifies module params:"),
|
||||
|
|
|
@ -247,6 +247,32 @@ pub fn type_problem<'b>(
|
|||
severity,
|
||||
})
|
||||
}
|
||||
MissingImportParams {
|
||||
module_id,
|
||||
region,
|
||||
expected,
|
||||
} => {
|
||||
let stack = [
|
||||
alloc.reflow("This import specifies no module params:"),
|
||||
alloc.region(lines.convert_region(region), severity),
|
||||
alloc.concat([
|
||||
alloc.reflow("However, "),
|
||||
alloc.module(module_id),
|
||||
alloc.reflow(" expects the following to be provided:"),
|
||||
]),
|
||||
alloc.type_block(error_type_to_doc(alloc, expected)),
|
||||
alloc.reflow("You can provide params after the module name, like:"),
|
||||
alloc
|
||||
.parser_suggestion("import Menu { echo, read }")
|
||||
.indent(4),
|
||||
];
|
||||
Some(Report {
|
||||
title: "MISSING PARAMS".to_string(),
|
||||
filename,
|
||||
doc: alloc.stack(stack),
|
||||
severity,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue