From 9a4aeb7ec7ffe0c522ee1d431cc4dc95dbc1e069 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Sat, 21 Nov 2020 07:38:23 -0800 Subject: [PATCH] Fixed cast check issue --- IDEHelper/Compiler/BfModuleTypeUtils.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/IDEHelper/Compiler/BfModuleTypeUtils.cpp b/IDEHelper/Compiler/BfModuleTypeUtils.cpp index a839a40a..0be4bee9 100644 --- a/IDEHelper/Compiler/BfModuleTypeUtils.cpp +++ b/IDEHelper/Compiler/BfModuleTypeUtils.cpp @@ -9955,6 +9955,7 @@ BfIRValue BfModule::CastToValue(BfAstNode* srcNode, BfTypedValue typedVal, BfTyp if (genericParamInst->mTypeConstraint != NULL) { + SetAndRestoreValue prevIgnoreWrites(mBfIRBuilder->mIgnoreWrites, true); auto constraintTypeInst = genericParamInst->mTypeConstraint->ToTypeInstance(); if ((constraintTypeInst != NULL) && (constraintTypeInst->mTypeDef == mCompiler->mEnumTypeDef)) {