Skip to content

Commit

Permalink
[unreal]对于原生cpp绑定,若未绑定构造函数,则在ts声明中加入abstract标记,可以在ts中尝试构造时提示报错 (#1971)
Browse files Browse the repository at this point in the history
Signed-off-by: morirain <[email protected]>
  • Loading branch information
morirain authored Jan 16, 2025
1 parent 0dc4b6d commit 2213c81
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,17 @@ struct FGenImp
{
if (HasUENamespace(ClassDefinition->ScriptName))
return;
Output << " class " << ClassDefinition->ScriptName;

Output << " ";

PUERTS_NAMESPACE::NamedFunctionInfo* ConstructorInfo = ClassDefinition->ConstructorInfos;
const bool IsNoConstructorInfos = !ConstructorInfo || !(ConstructorInfo->Name && ConstructorInfo->Type);
if (IsNoConstructorInfos)
{
Output << "abstract ";
}

Output << "class " << ClassDefinition->ScriptName;
if (ClassDefinition->SuperTypeId)
{
Output << " extends " << PUERTS_NAMESPACE::FindClassByID(ClassDefinition->SuperTypeId)->ScriptName;
Expand All @@ -92,7 +102,6 @@ struct FGenImp

TSet<FString> AddedFunctions;

PUERTS_NAMESPACE::NamedFunctionInfo* ConstructorInfo = ClassDefinition->ConstructorInfos;
while (ConstructorInfo && ConstructorInfo->Name && ConstructorInfo->Type)
{
FStringBuffer Tmp;
Expand Down

0 comments on commit 2213c81

Please sign in to comment.