Problem
Rider doesn't complain on the usages of Unreal built-in types that are not even forward declared in a source file. It happens when a member is a pointer or its non-declared type is used in a template argument. Meantime, after declaring a non-pointer field, the line is highlighted and a message says the "Type is Incomplete".
Cause
Actually, using an incomplete type as a type for pointer member is totally fine in C++. For the incomplete types compiler knows the type exists, but it doesn't know anything about its size or member details, so it cannot form complete objects or fields of that type. However, since the size of a pointer or reference is known and does not depend on the details of the type they're pointing to, pointers or references to an incomplete type can be used.
Also, using an incomplete type in a template argument is considered totally fine.
However, Rider is not totally correct by saying, "Type is Incomplete" for those types that are not even forward declared in a context. This is fixed in the 2024.3 version. Since 2024.3, Rider reports "Can't resolve type". (Wrong "Type is incomplete" in UE solution) Rider has specific logic for indexing identifiers defined in Unreal Engine public headers. It allows Rider to be aware of existing types (which is used in completion, navigation, etc..).
Resolution
For types that are used as a type for a pointer member or as a template argument, there is a highlighting and a hint for including a type or adding a forward declaration. However, only two letters are underlined (because the default severity is "Hint"). Put caret at the first two letters, so the context action should appear.
If this highlighting seems not noticeable enough, the severity of the inspection can be increased to "Error":
Comments
0 comments
Please sign in to leave a comment.