mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 16:44:33 +00:00
Ignore underscore-prefixed fields in record builders
This commit is contained in:
parent
13f60cde09
commit
cb8040f629
16 changed files with 336 additions and 140 deletions
|
@ -545,7 +545,7 @@ fn to_expr_report<'a>(
|
|||
to_record_report(alloc, lines, filename, erecord, *pos, start)
|
||||
}
|
||||
|
||||
EExpr::OptionalValueInRecordBuilder(region) => {
|
||||
EExpr::OptionalValueInOldRecordBuilder(region) => {
|
||||
let surroundings = Region::new(start, region.end());
|
||||
let region = lines.convert_region(*region);
|
||||
|
||||
|
@ -565,7 +565,7 @@ fn to_expr_report<'a>(
|
|||
}
|
||||
}
|
||||
|
||||
EExpr::RecordUpdateAccumulator(region) => {
|
||||
EExpr::RecordUpdateOldBuilderField(region) => {
|
||||
let surroundings = Region::new(start, region.end());
|
||||
let region = lines.convert_region(*region);
|
||||
|
||||
|
@ -1580,6 +1580,25 @@ fn to_import_report<'a>(
|
|||
severity,
|
||||
}
|
||||
}
|
||||
Params(EImportParams::RecordIgnoredFieldFound(region), _) => {
|
||||
let surroundings = Region::new(start, region.end());
|
||||
let region = lines.convert_region(*region);
|
||||
|
||||
let doc = alloc.stack([
|
||||
alloc.reflow("I was partway through parsing module params, but I got stuck here:"),
|
||||
alloc.region_with_subregion(lines.convert_region(surroundings), region, severity),
|
||||
alloc.reflow(
|
||||
"This is an ignored record field, but those are not allowed in module params.",
|
||||
),
|
||||
]);
|
||||
|
||||
Report {
|
||||
filename,
|
||||
doc,
|
||||
title: "IGNORED RECORD FIELD IN MODULE PARAMS".to_string(),
|
||||
severity,
|
||||
}
|
||||
}
|
||||
Params(EImportParams::RecordUpdateFound(region), _) => {
|
||||
let surroundings = Region::new(start, region.end());
|
||||
let region = lines.convert_region(*region);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue