Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
cburgdorf committed Nov 7, 2022
1 parent 27642eb commit 1414c64
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions crates/analyzer/src/traversal/expressions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,19 @@ fn expr_call_path<T: std::fmt::Display>(
generic_args: &Option<Node<Vec<fe::GenericArg>>>,
args: &Node<Vec<Node<fe::CallArg>>>,
) -> Result<(ExpressionAttributes, CallType), FatalError> {

// TODO: We need to handle the case of trait associated functions
// If we fail to resolve `whatever::SomeType::foo()` then:
// 1. Remove the last segment (e.g. `foo` in this case)
// 2. If we can resolve `whatever::SomeType` check each trait in scope that is implemented
// for `whatever::SometType` (if any) and collect pure `foo` functions if available
// 3.
// - If we find multiple -> error because call is ambigious
// - If we find a single one -> call it
// - If we find none -> error no match
dbg!("here we go {}", path);
let named_thing = context.resolve_path(path, func.span)?;
dbg!("here we don't");
expr_call_named_thing(context, named_thing, func, generic_args, args)
}

Expand Down

0 comments on commit 1414c64

Please sign in to comment.