mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-02 22:02:51 +01:00
Switch Member to variant in anticipation of more kinds. (#656)
Note this overlaps a little with #644's Member changes, but not too badly.
This commit is contained in:
@@ -300,12 +300,12 @@ auto ChoiceDeclaration::InitGlobals(Env& globals) const -> void {
|
||||
auto StructDeclaration::InitGlobals(Env& globals) const -> void {
|
||||
VarValues fields;
|
||||
VarValues methods;
|
||||
for (auto i = definition.members->begin(); i != definition.members->end();
|
||||
++i) {
|
||||
switch ((*i)->tag) {
|
||||
for (Member* m : *definition.members) {
|
||||
switch (m->tag()) {
|
||||
case MemberKind::FieldMember: {
|
||||
auto t = InterpExp(Env(), (*i)->u.field.type);
|
||||
fields.push_back(make_pair(*(*i)->u.field.name, t));
|
||||
const auto& field = m->GetFieldMember();
|
||||
auto t = InterpExp(Env(), field.type);
|
||||
fields.push_back({field.name, t});
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user