| 3232 | } |
| 3233 | |
| 3234 | BfError* BfModule::Fail(const StringImpl& error, BfAstNode* refNode, bool isPersistent, bool deferError) |
| 3235 | { |
| 3236 | BP_ZONE("BfModule::Fail"); |
| 3237 | |
| 3238 | if (mIgnoreErrors) |
| 3239 | { |
| 3240 | mHadIgnoredError = true; |
| 3241 | if (mAttributeState != NULL) |
| 3242 | mAttributeState->mFlags = (BfAttributeState::Flags)(mAttributeState->mFlags | BfAttributeState::Flag_HadError); |
| 3243 | return NULL; |
| 3244 | } |
| 3245 | |
| 3246 | if (!mReportErrors) |
| 3247 | { |
| 3248 | mCompiler->mPassInstance->SilentFail(); |
| 3249 | return NULL; |
| 3250 | } |
| 3251 | |
| 3252 | if (refNode != NULL) |
| 3253 | refNode = BfNodeToNonTemporary(refNode); |
| 3254 | |
| 3255 | //BF_ASSERT(refNode != NULL); |
| 3256 | |
| 3257 | if (mIsComptimeModule) |
| 3258 | { |
| 3259 | if (auto ceDbgState = GetCeDbgState()) |
| 3260 | { |
| 3261 | // Follow normal fail path |
| 3262 | } |
| 3263 | else |
| 3264 | { |
| 3265 | mHadBuildError = true; |
| 3266 | |
| 3267 | if ((mCompiler->mCeMachine->mCurContext != NULL) && (mCompiler->mCeMachine->mCurContext->mCurCallSource != NULL) && |
| 3268 | (mCompiler->mCeMachine->mCurContext->mCurCallSource->mRefNode != NULL)) |
| 3269 | { |
| 3270 | BfError* bfError = mCompiler->mPassInstance->Fail("Comptime method generation had errors", |
| 3271 | mCompiler->mCeMachine->mCurContext->mCurCallSource->mRefNode); |
| 3272 | if (bfError != NULL) |
| 3273 | mCompiler->mPassInstance->MoreInfo(error, refNode); |
| 3274 | return bfError; |
| 3275 | } |
| 3276 | |
| 3277 | return NULL; |
| 3278 | } |
| 3279 | } |
| 3280 | |
| 3281 | if ((mCurMethodState != NULL) && (mCurMethodState->mConstResolveState != NULL) && (mCurMethodState->mConstResolveState->mInCalcAppend)) |
| 3282 | { |
| 3283 | mCurMethodState->mConstResolveState->mFailed = true; |
| 3284 | return NULL; |
| 3285 | } |
| 3286 | |
| 3287 | if (mCurMethodInstance != NULL) |
| 3288 | mCurMethodInstance->mHasFailed = true; |
| 3289 | |
| 3290 | if ((mCurTypeInstance != NULL) && (mCurTypeInstance->IsUnspecializedTypeVariation())) |
| 3291 | return NULL; |
no test coverage detected