diff options
author | Fedor Sakharov <[email protected]> | 2020-05-13 14:06:42 +0100 |
---|---|---|
committer | Fedor Sakharov <[email protected]> | 2020-05-13 14:07:44 +0100 |
commit | 00f3b6c59ae3df9a7bfb1cd8b694d5f9b6a78be4 (patch) | |
tree | 847a60e19f55dd8da4e819bd1a76b23588fb9f76 /crates/ra_hir | |
parent | 88d3959c33c3b8729cecbe062cff8474516df29f (diff) |
Correctly fill default type parameters
Diffstat (limited to 'crates/ra_hir')
-rw-r--r-- | crates/ra_hir/src/code_model.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index e8e3211fc..3c56f39c1 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs | |||
@@ -989,6 +989,11 @@ impl TypeParam { | |||
989 | ty: InEnvironment { value: ty, environment }, | 989 | ty: InEnvironment { value: ty, environment }, |
990 | } | 990 | } |
991 | } | 991 | } |
992 | |||
993 | pub fn default(self, db: &dyn HirDatabase) -> Option<TypeRef> { | ||
994 | let params = db.generic_params(self.id.parent); | ||
995 | params.types[self.id.local_id].default.clone() | ||
996 | } | ||
992 | } | 997 | } |
993 | 998 | ||
994 | // FIXME: rename from `ImplDef` to `Impl` | 999 | // FIXME: rename from `ImplDef` to `Impl` |