diff --git a/IDEHelper/Compiler/BfResolvedTypeUtils.cpp b/IDEHelper/Compiler/BfResolvedTypeUtils.cpp index b8253306..f97a86b7 100644 --- a/IDEHelper/Compiler/BfResolvedTypeUtils.cpp +++ b/IDEHelper/Compiler/BfResolvedTypeUtils.cpp @@ -1208,7 +1208,8 @@ void BfMethodInstance::GetIRFunctionInfo(BfModule* module, BfIRType& returnType, { returnType = module->mBfIRBuilder->MapType(mReturnType); } - + + bool hasExplicitThis = false; for (int paramIdx = -1; paramIdx < GetParamCount(); paramIdx++) { BfType* checkType = NULL; @@ -1223,13 +1224,23 @@ void BfMethodInstance::GetIRFunctionInfo(BfModule* module, BfIRType& returnType, else { if (HasExplicitThis()) + { checkType = GetParamType(0); + hasExplicitThis = true; + } else checkType = GetOwner(); } } else { + if (hasExplicitThis) + { + // We already looked at this + hasExplicitThis = false; + continue; + } + checkType = GetParamType(paramIdx); }