Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

[BUG] Wrong generated method signature from interface method

Hi, I want to report a bug I discovered today. I make use of C++ interfaces and also implement them im Blueprints.

(There is some "special" behaviour which was a great deal to discover for me: See also here)

I now defined a C++ interface and declared a method which takes a FString parameter (among other ones). I did not implement it yet by any Object. But I already call the auto-generated Execute_XXX method from a Pawn.

 UFUNCTION(BlueprintCallable, BlueprintImplementableEvent, Category = "Command")
 bool ExecuteLocationCommand(FString CommandName, ...);

The compilation was the first one after the interface method was declared (if that is relevant). So interface method and calling code got compiled together (thus, Execute_XXX was not known by IntelliSense).

 if (Selection.IsValid() && Selection.Get()->GetClass()->ImplementsInterface(URTSCommandInterface::StaticClass()))
     TEXT("MoveTo"), LastHitResult.ImpactPoint);

The compilation threw an error in InterfaceXXX.gen.cpp. Since I did not provide a default implementation, there seems to be an autogenerated one, which i.a. checks that you don't call it directly but with Execute-Prefix. And this autogenerated implementation had another signature as the original defined one (const FString& instead of String). Hence, I got a compiler error. Changing the parameter type in my declared function solved this and is definitely better, but still it caused an error.

If this is wanted behaviour, please document it somewhere, so one knows that he has to pass Strings by const-ref

Product Version: UE 4.18
more ▼

asked Nov 09 '17 at 11:55 PM in Bug Reports

avatar image

885 46 45 80

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question