From ba0c23b8c5eff6378cbe7c4b9c5a22d1419e8489 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Fri, 31 Dec 2021 14:17:17 -0500 Subject: [PATCH] Fixed 'method not generated' comptime error --- IDE/src/ui/GenerateDialog.bf | 6 +++++- IDEHelper/Compiler/CeMachine.cpp | 7 ++++--- IDEHelper/Compiler/CeMachine.h | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/IDE/src/ui/GenerateDialog.bf b/IDE/src/ui/GenerateDialog.bf index 7bb15545..26a4f82f 100644 --- a/IDE/src/ui/GenerateDialog.bf +++ b/IDE/src/ui/GenerateDialog.bf @@ -693,7 +693,11 @@ namespace IDE.ui { mPendingUIFocus = false; if (!mUIEntries.IsEmpty) - mUIEntries[0].mWidget.SetFocus(); + { + var widget = mUIEntries[0].mWidget; + if (widget.mWidgetWindow != null) + widget.SetFocus(); + } } DeleteAndNullify!(mUIData); diff --git a/IDEHelper/Compiler/CeMachine.cpp b/IDEHelper/Compiler/CeMachine.cpp index ce41561f..142f5ac1 100644 --- a/IDEHelper/Compiler/CeMachine.cpp +++ b/IDEHelper/Compiler/CeMachine.cpp @@ -6454,7 +6454,8 @@ bool CeContext::Execute(CeFunction* startFunction, uint8* startStackPtr, uint8* if (moduleMethodInstance) { - mCeMachine->QueueMethod(moduleMethodInstance.mMethodInstance, moduleMethodInstance.mFunc); + auto ceFunction = mCeMachine->QueueMethod(moduleMethodInstance.mMethodInstance, moduleMethodInstance.mFunc); + callEntry.mFunctionInfo = ceFunction->mCeFunctionInfo; } } @@ -8207,7 +8208,7 @@ BfMethodInstance* CeMachine::GetMethodInstance(int64 methodHandle) return methodInstance; } -void CeMachine::QueueMethod(BfMethodInstance* methodInstance, BfIRValue func) +CeFunction* CeMachine::QueueMethod(BfMethodInstance* methodInstance, BfIRValue func) { if (mPreparingFunction != NULL) { @@ -8216,7 +8217,7 @@ void CeMachine::QueueMethod(BfMethodInstance* methodInstance, BfIRValue func) } bool added = false; - auto ceFunction = GetFunction(methodInstance, func, added); + return GetFunction(methodInstance, func, added); } void CeMachine::QueueMethod(BfModuleMethodInstance moduleMethodInstance) diff --git a/IDEHelper/Compiler/CeMachine.h b/IDEHelper/Compiler/CeMachine.h index 0271f416..78a3abae 100644 --- a/IDEHelper/Compiler/CeMachine.h +++ b/IDEHelper/Compiler/CeMachine.h @@ -969,7 +969,7 @@ public: public: void CompileStarted(); void CompileDone(); - void QueueMethod(BfMethodInstance* methodInstance, BfIRValue func); + CeFunction* QueueMethod(BfMethodInstance* methodInstance, BfIRValue func); void QueueMethod(BfModuleMethodInstance moduleMethodInstance); void QueueStaticField(BfFieldInstance* fieldInstance, const StringImpl& mangledFieldName);