Diagnose unresolved field accesses

This commit is contained in:
Lukas Wirth 2023-03-03 19:32:18 +01:00
parent 3c7a0aa00e
commit 78b2dd813a
7 changed files with 273 additions and 94 deletions

View file

@ -48,6 +48,7 @@ diagnostics![
TypeMismatch,
UnimplementedBuiltinMacro,
UnresolvedExternCrate,
UnresolvedField,
UnresolvedImport,
UnresolvedMacroCall,
UnresolvedModule,
@ -137,6 +138,14 @@ pub struct ExpectedFunction {
pub found: Type,
}
#[derive(Debug)]
pub struct UnresolvedField {
pub expr: InFile<AstPtr<ast::Expr>>,
pub receiver: Type,
pub name: Name,
pub method_with_same_name_exists: bool,
}
#[derive(Debug)]
pub struct PrivateField {
pub expr: InFile<AstPtr<ast::Expr>>,