| 17213 | } |
| 17214 | |
| 17215 | void BfModule::AssertErrorState() |
| 17216 | { |
| 17217 | if (mIgnoreErrors) |
| 17218 | return; |
| 17219 | if (mHadBuildError) |
| 17220 | return; |
| 17221 | |
| 17222 | if (mCurTypeInstance != NULL) |
| 17223 | { |
| 17224 | if (mCurTypeInstance->IsUnspecializedTypeVariation()) |
| 17225 | return; |
| 17226 | } |
| 17227 | |
| 17228 | if (mCurMethodInstance != NULL) |
| 17229 | { |
| 17230 | if (mCurMethodInstance->IsOrInUnspecializedVariation()) |
| 17231 | return; |
| 17232 | if (mCurMethodInstance->mHasFailed) |
| 17233 | return; |
| 17234 | } |
| 17235 | |
| 17236 | // We want the module to be marked as failed even if it's just an error in the parser |
| 17237 | if (mCurMethodInstance != NULL) |
| 17238 | mCurMethodInstance->mHasFailed = true; |
| 17239 | mHadBuildError = true; |
| 17240 | |
| 17241 | // We check for either the parsing to have failed (possibly on a previous run), or for the current instance to have failed |
| 17242 | if (mCurTypeInstance != NULL) |
| 17243 | { |
| 17244 | if (mCurTypeInstance->mTypeFailed) |
| 17245 | return; |
| 17246 | if ((mCurTypeInstance->mTypeDef->GetDefinition()->mSource != NULL) && (mCurTypeInstance->mTypeDef->GetDefinition()->mSource->mParsingFailed)) |
| 17247 | return; |
| 17248 | } |
| 17249 | if (mCurMethodInstance != NULL) |
| 17250 | { |
| 17251 | if ((mCurMethodInstance->mMethodDef->mDeclaringType != NULL) && |
| 17252 | (mCurMethodInstance->mMethodDef->mDeclaringType->mSource != NULL) && |
| 17253 | (mCurMethodInstance->mMethodDef->mDeclaringType->mSource->mParsingFailed)) |
| 17254 | return; |
| 17255 | if ((mCurMethodState != NULL) && (mCurMethodState->mMixinState != NULL) && |
| 17256 | (mCurMethodState->mMixinState->mMixinMethodInstance->mMethodDef->mDeclaringType->mSource != NULL) && |
| 17257 | (mCurMethodState->mMixinState->mMixinMethodInstance->mMethodDef->mDeclaringType->mSource->mParsingFailed)) |
| 17258 | return; |
| 17259 | } |
| 17260 | |
| 17261 | if (mCompiler->IsAutocomplete()) |
| 17262 | return; |
| 17263 | |
| 17264 | if (mCompiler->mPassInstance->HasFailed()) |
| 17265 | return; |
| 17266 | |
| 17267 | InternalError("Compiler in invalid state but AssertErrorState failed to detect prior error"); |
| 17268 | } |
| 17269 | |
| 17270 | void BfModule::AssertParseErrorState() |
| 17271 | { |
no test coverage detected