diff --git a/frontend/lib/resolution/default-functions.cpp b/frontend/lib/resolution/default-functions.cpp index e813d8bd50bd..cef45d7ad52f 100644 --- a/frontend/lib/resolution/default-functions.cpp +++ b/frontend/lib/resolution/default-functions.cpp @@ -946,17 +946,21 @@ generateRecordBinaryOperator(Context* context, UniqueString op, static const TypedFnSignature* generateRecordAssignment(Context* context, const CompositeType* lhsType) { + // rhs used to be 'maybe const' but now 'const' is default. + // + // TODO: it's possible that we need to compute the dyno equivalent of + // FLAG_COPY_MUTATES to get the right constness here. return generateRecordBinaryOperator(context, USTR("="), lhsType, - /*this*/ QualifiedType::CONST_REF, - /*lhs*/ QualifiedType::CONST_REF, - /*rhs*/ QualifiedType::CONST_REF); + /*this*/ QualifiedType::TYPE, + /*lhs*/ QualifiedType::REF, + /*rhs*/ QualifiedType::CONST_REF ); } static const TypedFnSignature* generateRecordComparison(Context* context, const CompositeType* lhsType) { return generateRecordBinaryOperator(context, USTR("=="), lhsType, - /*this*/ QualifiedType::REF, - /*lhs*/ QualifiedType::REF, + /*this*/ QualifiedType::TYPE, + /*lhs*/ QualifiedType::CONST_REF, /*rhs*/ QualifiedType::CONST_REF); }