Description

Attempting to pass a TMap or TSet into a UFUNCTION as a parameter causes a compilation error. Removing the UFUNCTION declaration works.

Error messages:

2>D:\Unreal Projects\Main\MyProject14\Source\MyProject14\MyActor.h(11): error C2275: 'FName': illegal use of this type as an expression
2>  d:\matthew.clark_main_stream\engine\source\runtime\core\public\UObject/NameTypes.h(522): note: see declaration of 'FName'
2>D:\Unreal Projects\Main\MyProject14\Source\MyProject14\MyActor.h(11): error C2275: 'FString': illegal use of this type as an expression
2>  d:\matthew.clark_main_stream\engine\source\runtime\core\public\GenericPlatform/GenericPlatformSplash.h(34): note: see declaration of 'FString'
2>D:\Unreal Projects\Main\MyProject14\Source\MyProject14\MyActor.h(11): error C2065: 'Z_Param_Out_Test': undeclared identifier
2>D:\Unreal Projects\Main\MyProject14\Source\MyProject14\MyActor.h(11): error C3861: 'P_GET_TMAP_REF': identifier not found
2>d:\unreal projects\main\myproject14\source\myproject14\MyActor.h(11): error C2275: 'FName': illegal use of this type as an expression
2>  d:\matthew.clark_main_stream\engine\source\runtime\core\public\UObject/NameTypes.h(522): note: see declaration of 'FName'
2>d:\unreal projects\main\myproject14\source\myproject14\MyActor.h(11): error C2275: 'FString': illegal use of this type as an expression
2>  d:\matthew.clark_main_stream\engine\source\runtime\core\public\GenericPlatform/GenericPlatformSplash.h(34): note: see declaration of 'FString'
2>d:\unreal projects\main\myproject14\source\myproject14\MyActor.h(11): error C2065: 'Z_Param_Out_Test': undeclared identifier
2>d:\unreal projects\main\myproject14\source\myproject14\MyActor.h(11): error C3861: 'P_GET_TMAP_REF': identifier not found

Regression?: No
This also occurred in 4.14

Steps to Reproduce
  1. Create a new C++ project
  2. Add a new class based off of Actor
  3. In the .h, add the following code on line #25 and compile the project
     UFUNCTION()
    void TestFunction(TMap<FName, FString>& Test) {} 

    Result: The compilation fails with the errors listed in the description
    Expected: The compilation succeeds

Have Comments or More Details?

Head over to the existing Questions & Answers thread and let us know what's up.

31
Login to Vote

Fixed
ComponentUE - Foundation - Core
Affects Versions4.144.154.16
Target Fix4.17
Fix Commit3473722
Main Commit3492074
CreatedMar 2, 2017
ResolvedJun 5, 2017
UpdatedApr 27, 2018