How to reproduce: in one module, create a class that extends from UObject and create a property with the UPROPERTY macro and name it something unique. In a separate class, create a function (with the UFUNCTION macro) that accepts an argument with the same name, but the name may start with a lowercase letter On compilation, C2039 is thrown and UnrealHeaderTool reports that the first class (which contains the property) does not contain the given member.
Example, for UMyFirstClass:
UPROPERTY(BlueprintReadOnly, Category = "SomeCategory")
FVector2D SomeName;
And then for UMySecondClass (notice the case difference)
UFUNCTION(BlueprintCallable, Category = "SomeOtherCategory")
void RandomFunction(FVector2D someName);
The thrown error is:
C2039: 'someName' : is not a member of 'UMyFirstObject'
Followed by a 2661 generated by the boilerplate (both errors are in the boilerplate .generated.inl file)
Why is it looking for the case-sensitive name of the function argument inside a completely different class?
I can reproduce this reliably on my side. This is definitely expected behavior for things within the same class, because of the way Blueprints will extract the names of properties and make getters/setters out of them, but it shouldn’t be a phenomena happening between entirely different classes. I’ve played around with it and have so far been convinced this is not desired behavior.
- Havlik