Diagnose call expression on non-callable things

This commit is contained in:
Lukas Wirth 2023-03-03 18:04:24 +01:00
parent 3ba876a4a6
commit 3c7a0aa00e
6 changed files with 83 additions and 14 deletions

View file

@ -31,6 +31,7 @@ macro_rules! diagnostics {
diagnostics![
BreakOutsideOfLoop,
ExpectedFunction,
InactiveCode,
IncorrectCase,
InvalidDeriveTarget,
@ -130,6 +131,12 @@ pub struct PrivateAssocItem {
pub item: AssocItem,
}
#[derive(Debug)]
pub struct ExpectedFunction {
pub call: InFile<AstPtr<ast::Expr>>,
pub found: Type,
}
#[derive(Debug)]
pub struct PrivateField {
pub expr: InFile<AstPtr<ast::Expr>>,