| 1162 | } |
| 1163 | |
| 1164 | void BfMethodInstance::GetParamName(int paramIdx, StringImpl& name, int& namePrefixCount) |
| 1165 | { |
| 1166 | if (paramIdx == -1) |
| 1167 | { |
| 1168 | BF_ASSERT(!mMethodDef->mIsStatic); |
| 1169 | name = "this"; |
| 1170 | return; |
| 1171 | } |
| 1172 | |
| 1173 | if ((mMethodInfoEx != NULL) && (mMethodInfoEx->mClosureInstanceInfo != NULL) && (mMethodDef->mIsLocalMethod)) |
| 1174 | { |
| 1175 | if (paramIdx < (int)mMethodInfoEx->mClosureInstanceInfo->mCaptureEntries.size()) |
| 1176 | { |
| 1177 | name = mMethodInfoEx->mClosureInstanceInfo->mCaptureEntries[paramIdx].mName; |
| 1178 | return; |
| 1179 | } |
| 1180 | } |
| 1181 | |
| 1182 | BfMethodParam* methodParam = &mParams[paramIdx]; |
| 1183 | BfParameterDef* paramDef = mMethodDef->mParams[methodParam->mParamDefIdx]; |
| 1184 | if (methodParam->mDelegateParamIdx != -1) |
| 1185 | { |
| 1186 | if (methodParam->mResolvedType->IsTuple()) |
| 1187 | { |
| 1188 | auto tupleType = (BfTupleType*)methodParam->mResolvedType; |
| 1189 | auto& fieldInstance = tupleType->mFieldInstances[methodParam->mDelegateParamIdx]; |
| 1190 | if (methodParam->mDelegateParamNameCombine) |
| 1191 | name = paramDef->mName + "__" + fieldInstance.GetFieldDef()->mName; |
| 1192 | else |
| 1193 | name = fieldInstance.GetFieldDef()->mName; |
| 1194 | |
| 1195 | return; |
| 1196 | } |
| 1197 | |
| 1198 | BfMethodInstance* invokeMethodInstance = methodParam->GetDelegateParamInvoke(); |
| 1199 | if (methodParam->mDelegateParamNameCombine) |
| 1200 | name = paramDef->mName + "__" + invokeMethodInstance->GetParamName(methodParam->mDelegateParamIdx); |
| 1201 | else |
| 1202 | invokeMethodInstance->GetParamName(methodParam->mDelegateParamIdx, name, namePrefixCount); |
| 1203 | return; |
| 1204 | } |
| 1205 | name.Reference(paramDef->mName); |
| 1206 | namePrefixCount = paramDef->mNamePrefixCount; |
| 1207 | } |
| 1208 | |
| 1209 | String BfMethodInstance::GetParamName(int paramIdx) |
| 1210 | { |
no test coverage detected