diff --git a/IDEHelper/Compiler/BfCompiler.cpp b/IDEHelper/Compiler/BfCompiler.cpp index 0a5d8979..ac02b431 100644 --- a/IDEHelper/Compiler/BfCompiler.cpp +++ b/IDEHelper/Compiler/BfCompiler.cpp @@ -8445,12 +8445,18 @@ void BfCompiler::GenerateAutocompleteInfo() if (checkMethodInstance->GetNumGenericParams() == 0) checkMethodInstance = methodEntry.mCurMethodInstance; + bool handled = false; if (genericParamType->mGenericParamIdx < checkMethodInstance->GetNumGenericParams()) { auto genericParamInstance = checkMethodInstance->mMethodInfoEx->mGenericParams[genericParamType->mGenericParamIdx]; - methodText += genericParamInstance->GetGenericParamDef()->mName; + auto genericParamDef = genericParamInstance->GetGenericParamDef(); + if (genericParamDef != NULL) + { + methodText += genericParamDef->mName; + handled = true; + } } - else + if (!handled) { methodText += StrFormat("@M%d", genericParamType->mGenericParamIdx); } diff --git a/IDEHelper/Compiler/BfReducer.cpp b/IDEHelper/Compiler/BfReducer.cpp index 8bcc9878..15bcce99 100644 --- a/IDEHelper/Compiler/BfReducer.cpp +++ b/IDEHelper/Compiler/BfReducer.cpp @@ -8866,7 +8866,16 @@ BfAstNode* BfReducer::CreateTopLevelObject(BfTokenNode* tokenNode, BfAttributeDi } } - if (!ParseMethod(methodDecl, ¶ms, &commas)) + bool failed = ParseMethod(methodDecl, ¶ms, &commas); + + if (methodDecl->mGenericConstraintsDeclaration != NULL) + { + typeDeclaration->mGenericConstraintsDeclaration = methodDecl->mGenericConstraintsDeclaration; + typeDeclaration->SetSrcEnd(methodDecl->GetSrcEnd()); + methodDecl->mGenericConstraintsDeclaration = NULL; + } + + if (failed) return typeDeclaration; if (methodDecl->mEndSemicolon == NULL)