Address feedback from #856 (#864)

* Make tuple/struct fields mutable.
* Avoid ExpectType when we know it will fail.
This commit is contained in:
Geoff Romer
2021-10-08 16:52:17 -07:00
committed by GitHub
parent 93a002a21a
commit 6068d2306b
5 changed files with 79 additions and 53 deletions
+2 -2
View File
@@ -68,7 +68,7 @@ static void PrintFields(llvm::raw_ostream& out,
std::string_view separator) {
llvm::ListSeparator sep;
for (const auto& field : fields) {
out << sep << "." << field.name << separator << *field.expression;
out << sep << "." << field.name() << separator << *field.expression();
}
}
@@ -86,7 +86,7 @@ void Expression::Print(llvm::raw_ostream& out) const {
}
case Expression::Kind::TupleLiteral:
out << "(";
PrintFields(out, cast<TupleLiteral>(*this).Fields(), " = ");
PrintFields(out, cast<TupleLiteral>(*this).fields(), " = ");
out << ")";
break;
case Expression::Kind::StructLiteral: