73 references to Bad
Microsoft.CodeAnalysis (14)
Compilation\Expression.cs (1)
46return ConstantValue.Bad;
ConstantValue.cs (1)
410case ConstantValueTypeDiscriminator.Bad: return Bad;
EnumConstantHelper.cs (1)
25offsetValue = ConstantValue.Bad;
MetadataReader\MetadataDecoder.cs (4)
1022value = (type.IsReferenceType || type.TypeKind == TypeKind.Pointer || type.TypeKind == TypeKind.FunctionPointer) ? ConstantValue.Null : ConstantValue.Bad; 1026value = ConstantValue.Bad; 1116return ConstantValue.Bad; 1124return ConstantValue.Bad;
MetadataReader\PEModule.cs (6)
1616defaultValue = ConstantValue.Bad; 3603return constantHandle.IsNil ? ConstantValue.Bad : GetConstantValueOrThrow(constantHandle); 3607return ConstantValue.Bad; 3620return constantHandle.IsNil ? ConstantValue.Bad : GetConstantValueOrThrow(constantHandle); 3624return ConstantValue.Bad; 3772return ConstantValue.Bad;
Symbols\Attributes\CommonAttributeData.cs (1)
247return ConstantValue.Bad;
Microsoft.CodeAnalysis.CSharp (38)
Binder\Binder_Conversions.cs (3)
3297return ConstantValue.Bad; 3305return ConstantValue.Bad; 3321return ConstantValue.Bad;
Binder\Binder_Expressions.cs (1)
9078constantValueOpt = ConstantValue.Bad;
Binder\Binder_Operators.cs (12)
2794return ConstantValue.Bad; 2806return ConstantValue.Bad; 2845return ConstantValue.Bad; 2881return ConstantValue.Bad; 3195return (newLength > int.MaxValue) ? ConstantValue.Bad : ConstantValue.CreateFromRope(Rope.Concat(leftValue, rightValue)); 4507return ConstantValue.Bad; 4853node.Right, convertedExpression, constantValueOpt ?? ConstantValue.Bad, operand.Type, convertedExpression.Type ?? operand.Type, hasErrors) 4986/// - <see cref="ConstantValue.Bad"/> - compiler doesn't support the type check, i.e. cannot perform it, even at runtime 5151return ConstantValue.Bad; 5542/// - <see cref="ConstantValue.Bad"/> - compiler doesn't support the type check, i.e. cannot perform it, even at runtime 5564return ConstantValue.Bad; 6030return ConstantValue.Bad;
Binder\Binder_Patterns.cs (6)
452node, convertedExpression, constantValueOpt ?? ConstantValue.Bad, inputType, convertedType, hasErrors || constantValueOpt is null); 633if (match == ConstantValue.False || match == ConstantValue.Bad) 780if (matchPossible != ConstantValue.False && matchPossible != ConstantValue.Bad) 811/// - <see cref="ConstantValue.Bad"/> - compiler doesn't support the type check, i.e. cannot perform it, even at runtime 843Debug.Assert(!conversion.IsUserDefined || result == ConstantValue.False || result == ConstantValue.Bad); 1679constantValueOpt = ConstantValue.Bad;
Binder\Binder_Statements.cs (2)
2295else if (conversion.Kind == ConversionKind.ExplicitNumeric && sourceConstantValueOpt != null && sourceConstantValueOpt != ConstantValue.Bad && 2296ConversionsBase.HasImplicitConstantExpressionConversion(new BoundLiteral(syntax, ConstantValue.Bad, sourceType), targetType))
Symbols\ConstantValueUtils.cs (1)
85var value = ConstantValue.Bad;
Symbols\ReducedExtensionMethodSymbol.cs (2)
145var thisArgumentValue = new BoundLiteral(syntax, ConstantValue.Bad, thisType) { WasCompilerGenerated = true }; 147var otherArgumentValue = new BoundLiteral(syntax, ConstantValue.Bad, otherArgumentType) { WasCompilerGenerated = true };
Symbols\Source\SourceComplexParameterSymbol.cs (7)
394return ConstantValue.Bad; 401return ConstantValue.Bad; 742value = ConstantValue.Bad; 993return ConstantValue.Bad; 1031return ConstantValue.Bad; 1041return ConstantValue.Bad; 1052return ConstantValue.Bad;
Symbols\Source\SourceEnumConstantSymbol.cs (1)
213return Microsoft.CodeAnalysis.ConstantValue.Bad;
Symbols\Source\SourceLocalSymbol.cs (2)
675var value = Microsoft.CodeAnalysis.ConstantValue.Bad; 698return Microsoft.CodeAnalysis.ConstantValue.Bad;
Symbols\Source\SourceNamedTypeSymbol_Extension.cs (1)
1227var receiverValue = new BoundLiteral(syntax, ConstantValue.Bad, receiverType) { WasCompilerGenerated = true };
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (3)
Semantics\ConstantTests.cs (1)
4024badConst = ConstantValue.Bad,
Semantics\NamedAndOptionalTests.cs (1)
2463Assert.Equal(ConstantValue.Bad, param.ExplicitDefaultConstantValue);
Utilities\ValueSetTests.cs (1)
875ConstantValue badConstant = ConstantValue.Bad;
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (16)
Compilation\GetSemanticInfoTests.cs (16)
894EnumOffset(ConstantValue.Create((sbyte)(sbyte.MaxValue - 3)), 4, EnumOverflowKind.OverflowReport, ConstantValue.Bad); 895EnumOffset(ConstantValue.Create((sbyte)(sbyte.MaxValue - 3)), 5, EnumOverflowKind.OverflowIgnore, ConstantValue.Bad); 901EnumOffset(ConstantValue.Create((byte)(byte.MaxValue - 3)), 4, EnumOverflowKind.OverflowReport, ConstantValue.Bad); 902EnumOffset(ConstantValue.Create((byte)(byte.MaxValue - 3)), 5, EnumOverflowKind.OverflowIgnore, ConstantValue.Bad); 910EnumOffset(ConstantValue.Create((short)(short.MaxValue - 3)), 4, EnumOverflowKind.OverflowReport, ConstantValue.Bad); 911EnumOffset(ConstantValue.Create((short)(short.MaxValue - 3)), 5, EnumOverflowKind.OverflowIgnore, ConstantValue.Bad); 917EnumOffset(ConstantValue.Create((ushort)(ushort.MaxValue - 3)), 4, EnumOverflowKind.OverflowReport, ConstantValue.Bad); 918EnumOffset(ConstantValue.Create((ushort)(ushort.MaxValue - 3)), 5, EnumOverflowKind.OverflowIgnore, ConstantValue.Bad); 926EnumOffset(ConstantValue.Create((int)(int.MaxValue - 3)), 4, EnumOverflowKind.OverflowReport, ConstantValue.Bad); 927EnumOffset(ConstantValue.Create((int)(int.MaxValue - 3)), 5, EnumOverflowKind.OverflowIgnore, ConstantValue.Bad); 933EnumOffset(ConstantValue.Create((uint)(uint.MaxValue - 3)), 4, EnumOverflowKind.OverflowReport, ConstantValue.Bad); 934EnumOffset(ConstantValue.Create((uint)(uint.MaxValue - 3)), 5, EnumOverflowKind.OverflowIgnore, ConstantValue.Bad); 942EnumOffset(ConstantValue.Create((long)(long.MaxValue - 3)), 4, EnumOverflowKind.OverflowReport, ConstantValue.Bad); 943EnumOffset(ConstantValue.Create((long)(long.MaxValue - 3)), 5, EnumOverflowKind.OverflowIgnore, ConstantValue.Bad); 949EnumOffset(ConstantValue.Create((ulong)(ulong.MaxValue - 3)), 4, EnumOverflowKind.OverflowReport, ConstantValue.Bad); 950EnumOffset(ConstantValue.Create((ulong)(ulong.MaxValue - 3)), 5, EnumOverflowKind.OverflowIgnore, ConstantValue.Bad);
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (1)
PDB\PdbHelpers.cs (1)
108_ => ConstantValue.Bad,
Microsoft.CodeAnalysis.UnitTests (1)
CorLibTypesTests.cs (1)
157Assert.Equal(ConstantValue.Bad, ConstantValue.Default(ConstantValueTypeDiscriminator.Bad));