mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 15:01:03 +01:00
Implement IndirectValue (#588)
Also updates `FieldAccess` to use `IndirectValue`, as an example.
This commit is contained in:
@@ -638,7 +638,8 @@ void StepLvalue() {
|
||||
case ExpressionKind::GetField: {
|
||||
// { {e.f :: C, E, F} :: S, H}
|
||||
// -> { e :: [].f :: C, E, F} :: S, H}
|
||||
frame->todo.Push(MakeLvalAct(exp->GetFieldAccess().aggregate));
|
||||
frame->todo.Push(
|
||||
MakeLvalAct(exp->GetFieldAccess().aggregate.GetPointer()));
|
||||
act->pos++;
|
||||
break;
|
||||
}
|
||||
@@ -714,7 +715,8 @@ void StepExp() {
|
||||
case ExpressionKind::GetField: {
|
||||
// { { e.f :: C, E, F} :: S, H}
|
||||
// -> { { e :: [].f :: C, E, F} :: S, H}
|
||||
frame->todo.Push(MakeLvalAct(exp->GetFieldAccess().aggregate));
|
||||
frame->todo.Push(
|
||||
MakeLvalAct(exp->GetFieldAccess().aggregate.GetPointer()));
|
||||
act->pos++;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -233,8 +233,8 @@ auto TypeCheckExp(const Expression* e, TypeEnv types, Env values,
|
||||
return TCResult(tuple_e, tuple_t, new_types);
|
||||
}
|
||||
case ExpressionKind::GetField: {
|
||||
auto res = TypeCheckExp(e->GetFieldAccess().aggregate, types, values,
|
||||
nullptr, TCContext::ValueContext);
|
||||
auto res = TypeCheckExp(e->GetFieldAccess().aggregate.GetPointer(), types,
|
||||
values, nullptr, TCContext::ValueContext);
|
||||
auto t = res.type;
|
||||
switch (t->tag) {
|
||||
case ValKind::StructTV:
|
||||
|
||||
Reference in New Issue
Block a user