Unapplied record builder error

This commit is contained in:
Agustin Zubiaga 2023-05-08 20:16:38 -03:00
parent 6670fbb1ab
commit d2a57112fd
10 changed files with 82 additions and 11 deletions

View file

@ -2147,6 +2147,18 @@ fn pretty_runtime_error<'b>(
title = "MULTIPLE RECORD BUILDERS";
}
RuntimeError::UnappliedRecordBuilder(region) => {
doc = alloc.stack([
alloc.reflow("This record builder was not applied to a function:"),
alloc.region(lines.convert_region(region)),
alloc.reflow("However, we need a function to construct the record."),
alloc.note(
"Functions must be applied directly. The pipe operator (|>) cannot be used.",
),
]);
title = "UNAPPLIED RECORD BUILDER";
}
}
(doc, title)