From ccd526837459724211c8281926aa86522b2506d5 Mon Sep 17 00:00:00 2001 From: Fedor Sakharov Date: Thu, 14 May 2020 13:53:45 +0300 Subject: Ty -> Type --- crates/ra_hir/src/code_model.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'crates') diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index cdbf475b3..840cfdfc8 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs @@ -990,10 +990,15 @@ impl TypeParam { } } - pub fn default(self, db: &dyn HirDatabase) -> Option { + pub fn default(self, db: &dyn HirDatabase) -> Option { let params = db.generic_defaults(self.id.parent); let local_idx = hir_ty::param_idx(db, self.id)?; - params.get(local_idx).map(|d| d.clone()) + let resolver = self.id.parent.resolver(db.upcast()); + let environment = TraitEnvironment::lower(db, &resolver); + params.get(local_idx).cloned().map(|ty| Type { + krate: self.id.parent.module(db.upcast()).krate, + ty: InEnvironment { value: ty, environment }, + }) } } -- cgit v1.2.3