Skip to content

Commit

Permalink
Fix intents on operators '=' and '=='
Browse files Browse the repository at this point in the history
Signed-off-by: Danila Fedorin <[email protected]>
  • Loading branch information
DanilaFe committed Feb 7, 2025
1 parent 8cf16b6 commit 3bbb87c
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions frontend/lib/resolution/default-functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 3bbb87c

Please sign in to comment.