Files
orchid/src/error/visibility_mismatch.rs
Lawrence Bethlenfalvy 0b887ced70 Converted Interner to work with Rc-s
- Interner no longer contains unsafe code
- Tokens now hold a reference to the value they represent directly

This will enable many future improvements
2023-08-19 14:03:05 +01:00

29 lines
807 B
Rust

use std::rc::Rc;
use super::project_error::ProjectError;
use crate::representations::location::Location;
use crate::{Interner, VName};
/// Multiple occurences of the same namespace with different visibility
#[derive(Debug)]
pub struct VisibilityMismatch {
/// The namespace with ambiguous visibility
pub namespace: VName,
/// The file containing the namespace
pub file: Rc<Vec<String>>,
}
impl ProjectError for VisibilityMismatch {
fn description(&self) -> &str {
"Some occurences of a namespace are exported but others are not"
}
fn message(&self) -> String {
format!(
"{} is opened multiple times with different visibilities",
Interner::extern_all(&self.namespace).join("::")
)
}
fn one_position(&self) -> Location {
Location::File(self.file.clone())
}
}