Have been experiencing an issue where using const reference parameters in a function marked with the CommutativeAssociativeBinaryOperator metadata property declared like this
This happens whenever a blueprint with this operator is opened or that operator is placed within a blueprint.
A cursory look at the differences between the pin types are the same only that the InputType is const and a reference and Pin->PinType is not. Any subsequent pins beyond the two default pins that are added using the small ‘+’ in the lower right corner of the node also appear to use the small diamond input pin style usually reserved for references.
I can confirm that this still behaves as described in 4.20; I’m seeing the same thing. K2Node_CommutativeAssociativeBinaryOperator.cpp:127:
ensure(InputType == Pin->PinType);
The Input type is the same as the pin type. However the PinType, named “ReturnValue” is non-const as it is a new value. The fault also occurs if the return pin is a value and the parameter pins are a reference:
/** Returns the maximum value of A and B */
UFUNCTION(BlueprintPure, meta=(DisplayName = “Max (BigInt)”, CompactNodeTitle = “MAX”, CommutativeAssociativeBinaryOperator = “true”), Category=“Math|BigInt”)
static const FBigInt Max(const FBigInt& A, const FBigInt& B);
I can confirm that this still behaves as described in 4.20; I’m seeing the same thing. K2Node_CommutativeAssociativeBinaryOperator.cpp:127:
ensure(InputType == Pin->PinType);
The Input type is the same as the pin type. However the PinType, named “ReturnValue” is non-const as it is a new value. The fault also occurs if the return pin is a value and the parameter pins are a reference:
/** Returns the maximum value of A and B */
UFUNCTION(BlueprintPure, meta=(DisplayName = “Max (BigInt)”, CompactNodeTitle = “MAX”, CommutativeAssociativeBinaryOperator = “true”), Category=“Math|BigInt”)
static const FBigInt Max(const FBigInt& A, const FBigInt& B);