Support user-defined implicit conversions via ImplicitAs (#1273)

Support is added for all of the non-type expression contexts where we currently accept built-in conversions, such as reordering the fields in a struct.
This commit is contained in:
Richard Smith
2022-05-20 17:10:30 -07:00
committed by GitHub
parent e77fcded86
commit 8dd398807d
33 changed files with 999 additions and 97 deletions
+5
View File
@@ -200,6 +200,7 @@ void Expression::Print(llvm::raw_ostream& out) const {
case ExpressionKind::StringTypeLiteral:
case ExpressionKind::TypeTypeLiteral:
case ExpressionKind::ContinuationTypeLiteral:
case ExpressionKind::ValueLiteral:
PrintID(out);
break;
}
@@ -236,6 +237,10 @@ void Expression::PrintID(llvm::raw_ostream& out) const {
case ExpressionKind::ContinuationTypeLiteral:
out << "Continuation";
break;
case ExpressionKind::ValueLiteral:
// FIXME: For layering reasons, we can't print out the value from here.
out << "ValueLiteral";
break;
case ExpressionKind::IndexExpression:
case ExpressionKind::FieldAccessExpression:
case ExpressionKind::CompoundFieldAccessExpression: