mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 21:21:04 +01:00
Track a resolved Member on each member access expression. (#1333)
Type checking now stores information on a member access identifying the member that was accessed, not only its name. This parallels what we do for other similar constructs whose meaning is resolved by name lookup or type-checking, and will allow us to avoid redoing lookups in some cases during interpretation.
This commit is contained in:
@@ -143,7 +143,8 @@ void Declaration::PrintID(llvm::raw_ostream& out) const {
|
||||
}
|
||||
}
|
||||
|
||||
auto GetName(const Declaration& declaration) -> std::optional<std::string> {
|
||||
auto GetName(const Declaration& declaration)
|
||||
-> std::optional<std::string_view> {
|
||||
switch (declaration.kind()) {
|
||||
case DeclarationKind::FunctionDeclaration:
|
||||
return cast<FunctionDeclaration>(declaration).name();
|
||||
|
||||
Reference in New Issue
Block a user