mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 10:51:06 +01:00
Support for member access into classes. (#3335)
Add support for member access into classes, for both non-instance members and for fields. --------- Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
This commit is contained in:
co-authored by
Jon Ross-Perkins
parent
620408b999
commit
ab575cf32a
@@ -55,8 +55,11 @@ auto HandlePatternBinding(Context& context, Parse::Node parse_node) -> bool {
|
||||
parse_node, context.GetBuiltinType(SemIR::BuiltinKind::TypeType),
|
||||
class_info.self_type_id, cast_type_id});
|
||||
value_type_id = context.CanonicalizeType(field_type_node_id);
|
||||
value_id =
|
||||
context.AddNode(SemIR::Field{parse_node, value_type_id, name_id});
|
||||
value_id = context.AddNode(
|
||||
SemIR::Field{parse_node, value_type_id, name_id,
|
||||
SemIR::MemberIndex(context.args_type_info_stack()
|
||||
.PeekCurrentBlockContents()
|
||||
.size())});
|
||||
|
||||
// Add a corresponding field to the object representation of the class.
|
||||
context.args_type_info_stack().AddNode(
|
||||
|
||||
Reference in New Issue
Block a user