Preserve order of generic args

This commit is contained in:
hkalbasi 2021-12-29 17:05:59 +03:30
parent 9d473a0b9f
commit 4fa8749c44
39 changed files with 714 additions and 427 deletions

View file

@ -282,7 +282,7 @@ impl SourceToDefCtx<'_, '_> {
pub(super) fn type_param_to_def(&mut self, src: InFile<ast::TypeParam>) -> Option<TypeParamId> {
let container: ChildContainer = self.find_generic_param_container(src.syntax())?.into();
let dyn_map = self.cache_for(container, src.file_id);
dyn_map[keys::TYPE_PARAM].get(&src.value).copied()
dyn_map[keys::TYPE_PARAM].get(&src.value).copied().map(|x| x.into())
}
pub(super) fn lifetime_param_to_def(
@ -300,7 +300,7 @@ impl SourceToDefCtx<'_, '_> {
) -> Option<ConstParamId> {
let container: ChildContainer = self.find_generic_param_container(src.syntax())?.into();
let dyn_map = self.cache_for(container, src.file_id);
dyn_map[keys::CONST_PARAM].get(&src.value).copied()
dyn_map[keys::CONST_PARAM].get(&src.value).copied().map(|x| x.into())
}
pub(super) fn generic_param_to_def(