mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 00:24:34 +00:00
Move unexpected params warning to solve
This commit is contained in:
parent
63e722f61d
commit
0cbb352a89
18 changed files with 115 additions and 169 deletions
|
@ -64,7 +64,6 @@ const ABILITY_IMPLEMENTATION_NOT_IDENTIFIER: &str = "ABILITY IMPLEMENTATION NOT
|
|||
const DUPLICATE_IMPLEMENTATION: &str = "DUPLICATE IMPLEMENTATION";
|
||||
const UNNECESSARY_IMPLEMENTATIONS: &str = "UNNECESSARY IMPLEMENTATIONS";
|
||||
const INCOMPLETE_ABILITY_IMPLEMENTATION: &str = "INCOMPLETE ABILITY IMPLEMENTATION";
|
||||
const UNEXPECTED_PARAMS: &str = "UNEXPECTED PARAMS";
|
||||
|
||||
pub fn can_problem<'b>(
|
||||
alloc: &'b RocDocAllocator<'b>,
|
||||
|
@ -1313,20 +1312,6 @@ pub fn can_problem<'b>(
|
|||
doc = report.doc;
|
||||
title = report.title;
|
||||
}
|
||||
Problem::UnexpectedParams { module_id, region } => {
|
||||
doc = alloc.stack([
|
||||
alloc.reflow("This import specifies module params:"),
|
||||
alloc.region(lines.convert_region(region), severity),
|
||||
alloc.concat([
|
||||
alloc.reflow("However, "),
|
||||
alloc.module(module_id),
|
||||
alloc.reflow(
|
||||
" does not expect any. Did you intend to import a different module?",
|
||||
),
|
||||
]),
|
||||
]);
|
||||
title = UNEXPECTED_PARAMS.to_string();
|
||||
}
|
||||
};
|
||||
|
||||
Report {
|
||||
|
|
|
@ -247,6 +247,26 @@ pub fn type_problem<'b>(
|
|||
severity,
|
||||
})
|
||||
}
|
||||
UnexpectedImportParams(region, module_id) => {
|
||||
let stack = [
|
||||
alloc.reflow("This import specifies module params:"),
|
||||
alloc.region(lines.convert_region(region), severity),
|
||||
alloc.concat([
|
||||
alloc.reflow("However, "),
|
||||
alloc.module(module_id),
|
||||
alloc.reflow(
|
||||
" does not expect any. Did you intend to import a different module?",
|
||||
),
|
||||
]),
|
||||
];
|
||||
|
||||
Some(Report {
|
||||
title: "UNEXPECTED PARAMS".to_string(),
|
||||
filename,
|
||||
doc: alloc.stack(stack),
|
||||
severity,
|
||||
})
|
||||
}
|
||||
MissingImportParams(region, module_id, expected) => {
|
||||
let stack = [
|
||||
alloc.reflow("This import specifies no module params:"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue