Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/infer.rs')
-rw-r--r--crates/hir-ty/src/infer.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/crates/hir-ty/src/infer.rs b/crates/hir-ty/src/infer.rs
index e37763e8ea..63d0f1b01c 100644
--- a/crates/hir-ty/src/infer.rs
+++ b/crates/hir-ty/src/infer.rs
@@ -67,6 +67,14 @@ pub(crate) fn infer_query(db: &dyn HirDatabase, def: DefWithBodyId) -> Arc<Infer
DefWithBodyId::ConstId(c) => ctx.collect_const(&db.const_data(c)),
DefWithBodyId::FunctionId(f) => ctx.collect_fn(f),
DefWithBodyId::StaticId(s) => ctx.collect_static(&db.static_data(s)),
+ DefWithBodyId::VariantId(v) => {
+ //let def = AttrDefId::EnumVariantId(v);
+ //let attrs = db.attrs(def);
+ //let repr = attrs.by_key("repr").attrs().next().unwrap();
+ //let ident = repr.single_ident_value().unwrap().text;
+ // TODO(ole): Get the real type
+ ctx.return_ty = TyBuilder::def_ty(db, v.parent.into()).fill_with_unknown().build()
+ }
}
ctx.infer_body();