mirror of
https://github.com/HigherOrderCO/Bend.git
synced 2024-08-16 15:20:40 +03:00
Merge remote-tracking branch 'origin/main' into feature/sc-479/update-encodings-to-make-use-of-hvmc-n-ary
This commit is contained in:
commit
c85d01a817
@ -37,4 +37,4 @@ stdext = "0.3.1"
|
||||
walkdir = "2.3.3"
|
||||
|
||||
[profile.test]
|
||||
opt-level = 2
|
||||
opt-level = 2
|
||||
|
@ -69,7 +69,7 @@ impl Info {
|
||||
|
||||
pub fn display(&self, verbose: bool) -> impl Display + '_ {
|
||||
DisplayFn(move |f| {
|
||||
write!(f, "{}", self.errs.iter().map(|err| err.display(verbose)).join("\n"))?;
|
||||
writeln!(f, "{}", self.errs.iter().map(|err| err.display(verbose)).join("\n"))?;
|
||||
|
||||
for (def_name, errs) in &self.errs_with_def {
|
||||
writeln!(f, "In definition '{def_name}':")?;
|
||||
|
@ -1,4 +1,6 @@
|
||||
use std::{collections::HashMap, fmt::Display};
|
||||
use std::fmt::Display;
|
||||
|
||||
use indexmap::IndexMap;
|
||||
|
||||
use crate::term::{Ctx, Name};
|
||||
|
||||
@ -14,7 +16,7 @@ impl Display for TopLevelErr {
|
||||
impl Ctx<'_> {
|
||||
/// Checks if exists shared names from definitions, adts and constructors.
|
||||
pub fn check_shared_names(&mut self) {
|
||||
let mut checked = HashMap::<&Name, usize>::new();
|
||||
let mut checked = IndexMap::<&Name, usize>::new();
|
||||
|
||||
for adt_name in self.book.adts.keys() {
|
||||
*checked.entry(adt_name).or_default() += 1;
|
||||
|
9
tests/golden_tests/compile_file/error_messages.hvm
Normal file
9
tests/golden_tests/compile_file/error_messages.hvm
Normal file
@ -0,0 +1,9 @@
|
||||
data A = (A)
|
||||
data B = (B)
|
||||
|
||||
Foo (C) = *
|
||||
Foo (D) = *
|
||||
|
||||
Foo2 (E) = *
|
||||
|
||||
Main = *
|
11
tests/snapshots/compile_file__error_messages.hvm.snap
Normal file
11
tests/snapshots/compile_file__error_messages.hvm.snap
Normal file
@ -0,0 +1,11 @@
|
||||
---
|
||||
source: tests/golden_tests.rs
|
||||
input_file: tests/golden_tests/compile_file/error_messages.hvm
|
||||
---
|
||||
Duplicated top-level name 'A'.
|
||||
Duplicated top-level name 'B'.
|
||||
In definition 'Foo':
|
||||
Unbound constructor 'C'.
|
||||
Unbound constructor 'D'.
|
||||
In definition 'Foo2':
|
||||
Unbound constructor 'E'.
|
Loading…
Reference in New Issue
Block a user