Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement method calls #577

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

baszalmstra
Copy link
Collaborator

Adds syntax for method calls and infers return types and argument types.

@baszalmstra baszalmstra requested a review from Wodann December 1, 2024 13:51
Copy link

codecov bot commented Dec 1, 2024

Codecov Report

Attention: Patch coverage is 89.65517% with 45 lines in your changes missing coverage. Please review.

Project coverage is 87.87%. Comparing base (ba2a7b2) to head (12c3b31).

Files with missing lines Patch % Lines
crates/mun_hir/src/ty/infer.rs 91.20% 16 Missing ⚠️
crates/mun_hir/src/diagnostics.rs 66.66% 6 Missing ⚠️
crates/mun_hir/src/method_resolution.rs 75.00% 6 Missing ⚠️
crates/mun_syntax/src/parsing/grammar/adt.rs 50.00% 6 Missing ⚠️
crates/mun_syntax/src/ast/generated.rs 80.95% 4 Missing ⚠️
crates/mun_hir/src/expr.rs 90.90% 2 Missing ⚠️
...mun_hir/src/expr/validator/uninitialized_access.rs 60.00% 2 Missing ⚠️
...ates/mun_syntax/src/parsing/grammar/expressions.rs 83.33% 2 Missing ⚠️
crates/mun_codegen/src/ir/body.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #577      +/-   ##
==========================================
+ Coverage   87.61%   87.87%   +0.25%     
==========================================
  Files         271      271              
  Lines       31453    31898     +445     
==========================================
+ Hits        27559    28029     +470     
+ Misses       3894     3869      -25     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@Wodann Wodann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall. Just some minor comments.

}

/// Filter methods based on the specified lookup mode.
pub fn with_association_opt(self, association: Option<AssociationMode>) -> Self {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't it make more sense to have without_association, as the Some case is already covered by with_association?

@@ -362,6 +403,8 @@ impl<'db> MethodResolutionCtx<'db> {
}
}

// Check if the function
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partial comment?

id: *expr,
found: receiver_ty,
});
match self.lookup_field(receiver_ty.clone(), name) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if let Some(..) = ..?

)
.map_or_else(identity, Some);

//
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leftover comment?

crates/mun_hir/src/ty/infer.rs Outdated Show resolved Hide resolved
crates/mun_hir/src/ty/infer.rs Outdated Show resolved Hide resolved
crates/mun_hir/src/ty/infer.rs Outdated Show resolved Hide resolved
crates/mun_hir/src/ty/infer.rs Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants