Skip to content

Commit

Permalink
Only use operator equals for reference types (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanL8 authored Sep 26, 2023
1 parent 5b73ff2 commit 79c750e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Generator/Generators/CSharp/CSharpSources.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,7 @@ private void GenerateFieldSetter(Field field, Class @class, QualifiedType fieldT
{
if (field.Type.IsClass() && !field.Type.IsPointer())
{
if (field.Type.TryGetClass(out Class fieldClass) && !(fieldClass is ClassTemplateSpecialization))
if (field.Type.TryGetClass(out Class fieldClass) && !(fieldClass is ClassTemplateSpecialization) && !fieldClass.IsValueType)
{
var caop = fieldClass.Methods.FirstOrDefault(m => m.OperatorKind == CXXOperatorKind.Equal);
if (caop != null && caop.IsGenerated)
Expand Down

0 comments on commit 79c750e

Please sign in to comment.