Skip to content

Commit

Permalink
feat: handle methodmap enums
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarrus1 committed Mar 7, 2024
1 parent 0875ba3 commit 1619ae6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions crates/hir-def/src/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,14 @@ impl Resolver {
}
},
_ => {
// Handle enum methodmaps by returning the methodmap id in priority if it exists
if let Some((FileDefId::MethodmapId(it), file_id)) = entries
.iter()
.find(|(entry, _)| matches!(entry, FileDefId::MethodmapId(_)))
{
return Some(ValueNs::MethodmapId(InFile::new(*file_id, *it)));
}

let mut fn_ids: SmallVec<[InFile<FunctionId>; 1]> = SmallVec::new();
for entry in entries {
if let (FileDefId::FunctionId(it), file_id) = entry {
Expand Down

0 comments on commit 1619ae6

Please sign in to comment.