Description

Reproduced 3/3 times, issue also occurs in //UE5/Release-5.0 - CL 20979098 Binary. Confirmed NOT a Regression.

EnumBugBP uses two enum cases and three argument cases for 6 total permutations:

  1. Enum without matching values and different arg name
  2. Enum without matching values and arg name same as enum name
  3. Enum without matching values and arg name same as enum value
  4. Enum with matching values and different arg name
  5. Enum with matching values and arg name same as enum name
  6. Enum with matching values and arg name same as enum value

In all cases where the argument name matches an enum value (cases 3, 5, and 6) the executed output pin is always pin 0.

Steps to Reproduce
  1. Create a new C++ Class, set parent to BPFunctionLibrary, name it EnumBugBP
  2. Set its .h & .cpp as followed:
#pragma once

#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "EnumBugBP.generated.h"

UENUM(BlueprintType)
enum class EPinSlot : uint8 {
    First,
    Second,
    Third,
    Fourth,
    Fifth
};

UENUM(BlueprintType)
enum class EPinSlotSameName : uint8 {
    First,
    PinSlotSameName,
    Third,
    Fourth,
    Fifth
};

UCLASS()
class UEnumBugBP : public UBlueprintFunctionLibrary {
    GENERATED_BODY()

public:
    UFUNCTION(BlueprintCallable, Category = "EnumBug", meta = (ExpandEnumAsExecs = "outPath"))
        static void TakeEnumPath(EPinSlot desiredPath, EPinSlot& outPath);
    UFUNCTION(BlueprintCallable, Category = "EnumBug", meta = (ExpandEnumAsExecs = "pinSlot"))
        static void TakeEnumPathSameArgName(EPinSlot desiredPath, EPinSlot& pinSlot);
    UFUNCTION(BlueprintCallable, Category = "EnumBug", meta = (ExpandEnumAsExecs = "third"))
        static void TakeEnumPathArgIsEnumVal(EPinSlot desiredPath, EPinSlot& third);
    UFUNCTION(BlueprintCallable, Category = "EnumBug", meta = (ExpandEnumAsExecs = "outPath"))
        static void TakeEnumPathSameName(EPinSlotSameName desiredPath, EPinSlotSameName& outPath);
    UFUNCTION(BlueprintCallable, Category = "EnumBug", meta = (ExpandEnumAsExecs = "pinSlotSameName"))
        static void TakeEnumPathSameNameSameArgName(EPinSlotSameName desiredPath, EPinSlotSameName& pinSlotSameName);
    UFUNCTION(BlueprintCallable, Category = "EnumBug", meta = (ExpandEnumAsExecs = "fourth"))
        static void TakeEnumPathSameNameSameArgIsEnumVal(EPinSlotSameName desiredPath, EPinSlotSameName& fourth);
};
#include "EnumBugBP.h"
#include "Engine.h"

void UEnumBugBP::TakeEnumPath(EPinSlot desiredPath, EPinSlot& outPath) {
    outPath = desiredPath;
}

void UEnumBugBP::TakeEnumPathSameArgName(EPinSlot desiredPath, EPinSlot& pinSlot) {
    pinSlot = desiredPath;
}

void UEnumBugBP::TakeEnumPathArgIsEnumVal(EPinSlot desiredPath, EPinSlot& third) {
    third = desiredPath;
}

void UEnumBugBP::TakeEnumPathSameName(EPinSlotSameName desiredPath, EPinSlotSameName& outPath) {
    outPath = desiredPath;
}

void UEnumBugBP::TakeEnumPathSameNameSameArgName(EPinSlotSameName desiredPath, EPinSlotSameName& pinSlotSameName) {
    pinSlotSameName = desiredPath;
}

void UEnumBugBP::TakeEnumPathSameNameSameArgIsEnumVal(EPinSlotSameName desiredPath, EPinSlotSameName& fourth) {
    fourth = desiredPath;
}
  1. Compile. Open level blueprint
  2. Right Click on event graph and add a "Take Enum Path Arg Is Enum Val" node, connect it to BeginPlay
  3. Connect a Print String node out of First, have it print "first"
  4. Connect a Print String node out of Second, have it print "second"
  5. Set the Enum value in the node to Second
  6. Compile & PIE

Actual Result: "first" is printed, despite First not being the chosen Enum

Expected Result: "second" is printed, because it was the chosen Enum

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-174107 in the post.

0
Login to Vote

Fixed
ComponentUE - Gameplay - Blueprint
Affects Versions5.1
Target Fix5.3
Fix Commit23983965
Main Commit23983965
Release Commit23873498
CreatedJan 13, 2023
ResolvedFeb 3, 2023
UpdatedFeb 6, 2023