From dde6a56a039ca79aaa83c10bb793eac8fde3a717 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Wed, 25 Mar 2020 09:17:34 -0700 Subject: [PATCH] Added uninitialized ctors: this(?), base(?) --- IDEHelper/Compiler/BfModule.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/IDEHelper/Compiler/BfModule.cpp b/IDEHelper/Compiler/BfModule.cpp index b5313812..6d56d29b 100644 --- a/IDEHelper/Compiler/BfModule.cpp +++ b/IDEHelper/Compiler/BfModule.cpp @@ -14587,6 +14587,24 @@ void BfModule::EmitCtorBody(bool& skipBody) mCurMethodState->mCurAppendAlign = methodInstance->mAppendAllocAlign; } + if ((ctorDeclaration != NULL) && (ctorDeclaration->mInitializer != NULL) && (ctorDeclaration->mInitializer->mArguments.size() == 1) && (targetType != NULL)) + { + if (auto tokenNode = BfNodeDynCast(ctorDeclaration->mInitializer->mArguments[0])) + { + if (targetType == mCurTypeInstance) + { + auto thisVariable = GetThisVariable(); + if (thisVariable != NULL) + { + thisVariable->mUnassignedFieldFlags = 0; + thisVariable->mIsAssigned = true; + } + } + + targetType = NULL; + } + } + if (targetType != NULL) { BfAstNode* refNode = methodDeclaration;