aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/code_model_api.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/code_model_api.rs')
-rw-r--r--crates/ra_hir/src/code_model_api.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/crates/ra_hir/src/code_model_api.rs b/crates/ra_hir/src/code_model_api.rs
index 26ebc445b..9da8a482d 100644
--- a/crates/ra_hir/src/code_model_api.rs
+++ b/crates/ra_hir/src/code_model_api.rs
@@ -290,7 +290,11 @@ impl Struct {
290 } 290 }
291 291
292 pub fn ty(&self, db: &impl HirDatabase) -> Ty { 292 pub fn ty(&self, db: &impl HirDatabase) -> Ty {
293 db.type_for_def((*self).into()) 293 db.type_for_def((*self).into(), Namespace::Types)
294 }
295
296 pub fn constructor_ty(&self, db: &impl HirDatabase) -> Ty {
297 db.type_for_def((*self).into(), Namespace::Values)
294 } 298 }
295 299
296 // TODO move to a more general type 300 // TODO move to a more general type
@@ -350,7 +354,7 @@ impl Enum {
350 } 354 }
351 355
352 pub fn ty(&self, db: &impl HirDatabase) -> Ty { 356 pub fn ty(&self, db: &impl HirDatabase) -> Ty {
353 db.type_for_def((*self).into()) 357 db.type_for_def((*self).into(), Namespace::Types)
354 } 358 }
355 359
356 // TODO: move to a more general type 360 // TODO: move to a more general type
@@ -425,7 +429,7 @@ pub struct Function {
425 pub(crate) id: FunctionId, 429 pub(crate) id: FunctionId,
426} 430}
427 431
428pub use crate::expr::ScopeEntryWithSyntax; 432pub use crate::{ nameres::Namespace, expr::ScopeEntryWithSyntax};
429 433
430/// The declared signature of a function. 434/// The declared signature of a function.
431#[derive(Debug, Clone, PartialEq, Eq)] 435#[derive(Debug, Clone, PartialEq, Eq)]