diff options
Diffstat (limited to 'crates/ra_hir')
-rw-r--r-- | crates/ra_hir/src/code_model.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 3c56f39c1..3936f5aaa 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs | |||
@@ -990,9 +990,10 @@ impl TypeParam { | |||
990 | } | 990 | } |
991 | } | 991 | } |
992 | 992 | ||
993 | pub fn default(self, db: &dyn HirDatabase) -> Option<TypeRef> { | 993 | pub fn default(self, db: &dyn HirDatabase) -> Option<Ty> { |
994 | let params = db.generic_params(self.id.parent); | 994 | let params = db.generic_defaults(self.id.parent); |
995 | params.types[self.id.local_id].default.clone() | 995 | let local_idx: u32 = self.id.local_id.into_raw().into(); |
996 | params.get(local_idx as usize).map(|d| d.clone()) | ||
996 | } | 997 | } |
997 | } | 998 | } |
998 | 999 | ||