CommutativeAssociativeBinaryOperator and const reference parameters

Have been experiencing an issue where using const reference parameters in a function marked with the CommutativeAssociativeBinaryOperator metadata property declared like this

UFUNCTION(BlueprintPure, meta = (DisplayName = "SpecialStruct + SpecialStruct", CompactNodeTitle = "+", Keywords = "+ add plus", CommutativeAssociativeBinaryOperator = "true"), Category = "Math|Special")
	static void AddSpecialStructs(const FSpecialStruct& A, const FSpecialStruct& B, FSpecialStruct& Result);

has been producing the following error :

LogOutputDevice:Error: Ensure condition failed: InputType == Pin->PinType [File:D:\Build++UE4+Release-4.15+Compile\Sync\Engine\Source\Editor\BlueprintGraph\Private\K2Node_CommutativeAssociativeBinaryOperator.cpp] [Line: 128]

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.

JackMorgan, did you fix it? 4.19 has the same behavior…

UFUNCTION(BlueprintPure, Category = "FABRIK|test", meta = (DisplayName = "AppendIntArrays", CommutativeAssociativeBinaryOperator = "true"))
static TArray<int32> BP_Append_IntArray(const TArray<int32>& A, const TArray<int32>& B)
{
	TArray<int32> out =A;
	out.Append(B);
	return out;
}

[2018.04.29-06.19.57:292][355]LogBlueprintUserMessages:
[NewBlueprint1_C_0] 1.0
[2018.04.29-06.19.57:296][355]LogSlate: Took 0.000187 seconds to synchronously
load lazily loaded font
‘…/…/…/Engine/Content/Slate/Fonts/Roboto-BoldCondensed.ttf’
(158K)
[2018.04.29-06.19.59:848][555]LogOutputDevice:
Error: Ensure condition failed:
InputType == Pin->PinType
[File:D:\Build++UE4+Release-4.19+Compile\Sync\Engine\Source\Editor\BlueprintGraph\Private\K2Node_CommutativeAssociativeBinaryOperator.cpp]
[Line: 127]

[2018.04.29-06.19.59:848][555]LogStats: FDebug::EnsureFailed - 0.000 s
UE4Editor.exe has triggered a
breakpoint.

if you continue the work then the function works as expected

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);