internal: Treat the self param as different from patterns when lowering

This commit is contained in:
Lukas Wirth 2024-03-06 15:57:05 +01:00
parent 0931361b8f
commit 458f4a2960
18 changed files with 256 additions and 144 deletions

View file

@ -219,11 +219,10 @@ impl SourceAnalyzer {
pub(crate) fn type_of_self(
&self,
db: &dyn HirDatabase,
param: &ast::SelfParam,
_param: &ast::SelfParam,
) -> Option<Type> {
let src = InFile { file_id: self.file_id, value: param };
let pat_id = self.body_source_map()?.node_self_param(src)?;
let ty = self.infer.as_ref()?[pat_id].clone();
let binding = self.body()?.self_param?;
let ty = self.infer.as_ref()?[binding].clone();
Some(Type::new_with_resolver(db, &self.resolver, ty))
}