diff --git a/IDEHelper/Compiler/BfStmtEvaluator.cpp b/IDEHelper/Compiler/BfStmtEvaluator.cpp index 29960fe8..bfc0be0d 100644 --- a/IDEHelper/Compiler/BfStmtEvaluator.cpp +++ b/IDEHelper/Compiler/BfStmtEvaluator.cpp @@ -4464,9 +4464,12 @@ void BfModule::Visit(BfSwitchStatement* switchStmt) } } - constantInt = mBfIRBuilder->GetConstant(caseValue.mValue); - if ((constantInt != NULL) && (!mBfIRBuilder->IsInt(constantInt->mTypeCode))) - constantInt = NULL; + if (caseValue.mType == switchValue.mType) + { + constantInt = mBfIRBuilder->GetConstant(caseValue.mValue); + if ((constantInt != NULL) && (!mBfIRBuilder->IsInt(constantInt->mTypeCode))) + constantInt = NULL; + } } }