diff --git a/ICSharpCode.Decompiler/IL/Transforms/TransformAssignment.cs b/ICSharpCode.Decompiler/IL/Transforms/TransformAssignment.cs index 58ab81eda..9e89d9852 100644 --- a/ICSharpCode.Decompiler/IL/Transforms/TransformAssignment.cs +++ b/ICSharpCode.Decompiler/IL/Transforms/TransformAssignment.cs @@ -361,6 +361,9 @@ namespace ICSharpCode.Decompiler.IL.Transforms return conv.TargetType != type.ToPrimitiveType(); } else if (value is Comp) { return false; // comp returns 0 or 1, which always fits + } else if (value is IfInstruction ifInst) { + return IsImplicitTruncation(ifInst.TrueInst, type, allowNullableValue) + || IsImplicitTruncation(ifInst.FalseInst, type, allowNullableValue); } else { IType inferredType = value.InferType(); if (allowNullableValue) {