Resolve paths to defs (functions currently) during type inference

This commit is contained in:
Florian Diebold 2018-12-23 17:13:11 +01:00
parent 93ffbf80c6
commit ef67581104
17 changed files with 215 additions and 87 deletions

View file

@ -94,6 +94,7 @@ salsa::database_storage! {
fn fn_syntax() for hir::db::FnSyntaxQuery;
fn submodules() for hir::db::SubmodulesQuery;
fn infer() for hir::db::InferQuery;
fn type_for_def() for hir::db::TypeForDefQuery;
}
}
}

View file

@ -524,7 +524,7 @@ impl AnalysisImpl {
let function = ctry!(source_binder::function_from_source(
&*self.db, file_id, parent_fn
)?);
let infer = function.infer(&*self.db);
let infer = function.infer(&*self.db)?;
Ok(infer.type_of_node(node).map(|t| t.to_string()))
}