Diagnose private field accesses

This commit is contained in:
Lukas Wirth 2022-12-31 14:20:59 +01:00
parent ec125fe46a
commit e3d144d17f
6 changed files with 86 additions and 11 deletions

View file

@ -208,6 +208,7 @@ pub(crate) type InferResult<T> = Result<InferOk<T>, TypeError>;
#[derive(Debug, PartialEq, Eq, Clone)]
pub enum InferenceDiagnostic {
NoSuchField { expr: ExprId },
PrivateField { expr: ExprId, field: FieldId },
BreakOutsideOfLoop { expr: ExprId, is_break: bool },
MismatchedArgCount { call_expr: ExprId, expected: usize, found: usize },
}