| 23197 | } |
| 23198 | |
| 23199 | String BfModule::GetLocalMethodName(const StringImpl& baseName, BfAstNode* anchorNode, BfMethodState* declMethodState, BfMixinState* declMixinState) |
| 23200 | { |
| 23201 | String name; |
| 23202 | |
| 23203 | bool found = false; |
| 23204 | auto checkMethodState = mCurMethodState; |
| 23205 | while (checkMethodState != NULL) |
| 23206 | { |
| 23207 | if (checkMethodState->mClosureState == NULL) |
| 23208 | break; |
| 23209 | if (checkMethodState->mClosureState->mClosureMethodDef != NULL) |
| 23210 | { |
| 23211 | found = true; |
| 23212 | name += checkMethodState->mClosureState->mClosureMethodDef->mName; |
| 23213 | break; |
| 23214 | } |
| 23215 | checkMethodState = checkMethodState->mPrevMethodState; |
| 23216 | } |
| 23217 | |
| 23218 | if (!found) |
| 23219 | name += mCurMethodInstance->mMethodDef->mName; |
| 23220 | |
| 23221 | int prevSepPos = (int)name.LastIndexOf('$'); |
| 23222 | if (prevSepPos != -1) |
| 23223 | { |
| 23224 | name.RemoveToEnd(prevSepPos); |
| 23225 | } |
| 23226 | |
| 23227 | name += "@"; |
| 23228 | name += baseName; |
| 23229 | |
| 23230 | HashContext hashCtx; |
| 23231 | if (anchorNode != NULL) |
| 23232 | { |
| 23233 | hashCtx.Mixin(anchorNode->GetStartCharId()); |
| 23234 | } |
| 23235 | |
| 23236 | // |
| 23237 | { |
| 23238 | auto checkMethodState = declMethodState; |
| 23239 | auto checkMixinState = declMixinState; |
| 23240 | while (checkMethodState != NULL) |
| 23241 | { |
| 23242 | if (checkMixinState != NULL) |
| 23243 | { |
| 23244 | hashCtx.Mixin(checkMixinState->mSource->GetStartCharId()); |
| 23245 | } |
| 23246 | checkMethodState = checkMethodState->mPrevMethodState; |
| 23247 | if (checkMethodState != NULL) |
| 23248 | checkMixinState = checkMethodState->mMixinState; |
| 23249 | } |
| 23250 | } |
| 23251 | |
| 23252 | auto rootMethodState = mCurMethodState->GetRootMethodState(); |
| 23253 | if ((rootMethodState != NULL) && (rootMethodState->mMethodInstance != NULL) && (rootMethodState->mMethodInstance->mMethodInfoEx != NULL)) |
| 23254 | { |
| 23255 | for (auto methodGenericArg : rootMethodState->mMethodInstance->mMethodInfoEx->mMethodGenericArguments) |
| 23256 | { |
no test coverage detected