1 write to ExplicitCastInCode
Microsoft.CodeAnalysis.CSharp (1)
Generated\BoundNodes.xml.Generated.cs (1)
3014this.ExplicitCastInCode = explicitCastInCode;
45 references to ExplicitCastInCode
Microsoft.CodeAnalysis.CSharp (45)
Binder\RefSafetyAnalysis.cs (1)
1261inlineArray: node.Expression is not BoundConversion { Conversion.IsIdentity: true, ExplicitCastInCode: false, Operand: BoundExpression operand } ? node.Expression : operand,
BoundTree\BoundConversion.cs (2)
80Debug.Assert(!ExplicitCastInCode); 179Debug.Assert(!ExplicitCastInCode);
BoundTree\BoundExpression.cs (1)
498return this.Update(operand: operand, this.Conversion, this.IsBaseConversion, this.Checked, this.ExplicitCastInCode, this.ConstantValueOpt, this.ConversionGroupOpt, this.InConversionGroupFlags, this.Type);
CodeGen\EmitConversion.cs (1)
221if (conversion.ExplicitCastInCode)
FlowAnalysis\NullableWalker.cs (3)
6200if ((node.RightOperand as BoundConversion)?.ExplicitCastInCode != false && 8984Debug.Assert(group != null || !conversion.ExplicitCastInCode); // Explicit conversions should include a group. 10518fromExplicitCast: conversionOpt?.ExplicitCastInCode ?? false,
Generated\BoundNodes.xml.Generated.cs (5)
3039if (operand != this.Operand || conversion != this.Conversion || isBaseConversion != this.IsBaseConversion || @checked != this.Checked || explicitCastInCode != this.ExplicitCastInCode || constantValueOpt != this.ConstantValueOpt || conversionGroupOpt != this.ConversionGroupOpt || inConversionGroupFlags != this.InConversionGroupFlags || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything)) 11600return node.Update(operand, node.Conversion, node.IsBaseConversion, node.Checked, node.ExplicitCastInCode, node.ConstantValueOpt, node.ConversionGroupOpt, node.InConversionGroupFlags, type); 13769updatedNode = node.Update(operand, node.Conversion, node.IsBaseConversion, node.Checked, node.ExplicitCastInCode, node.ConstantValueOpt, node.ConversionGroupOpt, node.InConversionGroupFlags, infoAndType.Type!); 13774updatedNode = node.Update(operand, node.Conversion, node.IsBaseConversion, node.Checked, node.ExplicitCastInCode, node.ConstantValueOpt, node.ConversionGroupOpt, node.InConversionGroupFlags, node.Type); 16154new TreeDumperNode("explicitCastInCode", node.ExplicitCastInCode, null),
Lowering\BoundTreeToDifferentEnclosingContextRewriter.cs (1)
183node.ExplicitCastInCode,
Lowering\ClosureConversion\ClosureConversion.cs (1)
1402if (_inExpressionLambda && conversion.ExplicitCastInCode)
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (5)
677if (conversion != null && !conversion.ExplicitCastInCode) 732return node.ExplicitCastInCode ? Convert(operand, node.Type, false) : operand; 737return Convert(Visit(node.Operand), node.Operand.Type, node.Type, node.Checked, node.ExplicitCastInCode); 748return Convert(Constant(_bound.Null(_objectType)), _objectType, node.Type, false, node.ExplicitCastInCode); 750return Convert(Visit(node.Operand), node.Operand.Type, node.Type, node.Checked, node.ExplicitCastInCode);
Lowering\DiagnosticsPass_Warnings.cs (5)
144if (conversion.ExplicitCastInCode) break; 346return node.Kind == BoundKind.Conversion && ((BoundConversion)node).ExplicitCastInCode; 354if (conv.ExplicitCastInCode) return false; 441if (conversion.ExplicitCastInCode) 687if (conv.ExplicitCastInCode && toSpecialType.IsSignedIntegralType())
Lowering\LocalRewriter\LocalRewriter_Call.cs (2)
862Debug.Assert(!((BoundConversion)argument).ExplicitCastInCode); 934Debug.Assert(!((BoundConversion)argument).ExplicitCastInCode);
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (3)
79var result = MakeConversionNode(node, node.Syntax, rewrittenOperand, node.Conversion, node.Checked, node.ExplicitCastInCode, node.ConstantValueOpt, rewrittenType); 250return conversion.ConversionKind == ConversionKind.Identity && !conversion.ExplicitCastInCode; 1087explicitCastInCode: conversion.ExplicitCastInCode,
Lowering\LocalRewriter\LocalRewriter_StringInterpolation.cs (2)
240if (arg is BoundConversion { Conversion: { Kind: ConversionKind.InterpolatedStringHandler }, ExplicitCastInCode: false, Operand: var operand }) 251Debug.Assert(arguments.All(arg => arg is not BoundConversion { Conversion: { IsInterpolatedStringHandler: true }, ExplicitCastInCode: false }));
Lowering\LocalRewriter\LocalRewriter_TupleBinaryOperator.cs (6)
75explicitCastInCode: conversion.ExplicitCastInCode, 122syntax, fieldAccess, elementConversions[i], boundConversion.Checked, boundConversion.ExplicitCastInCode, 199case BoundConversion { Conversion: { IsUserDefined: true } or { IsUnion: true } } conv when conv.ExplicitCastInCode || enclosingConversionWasExplicit: // https://github.com/dotnet/roslyn/issues/82636: Add coverage 205var deferredOperand = DeferSideEffectingArgumentToTempForTupleEquality(conv.Operand, effects, temps, conv.ExplicitCastInCode || enclosingConversionWasExplicit); 480expr.Syntax, expr, conversion, enclosing.Checked, enclosing.ExplicitCastInCode, 616conversion: conv.Conversion, @checked: conv.Checked, explicitCastInCode: conv.ExplicitCastInCode,
Operations\CSharpOperationFactory.cs (7)
1048isImplicit = !unionConversion.ExplicitCastInCode || boundConversion.Syntax == (sourceConversion ?? unionConversion).Operand.Syntax; 1053isImplicit = !boundConversion.ExplicitCastInCode; 1058isImplicit = !boundConversion.ExplicitCastInCode; 1136if (boundConversion.ExplicitCastInCode && conversion.IsIdentity && boundOperand.Kind == BoundKind.Conversion) 1141if (nestedConversion.Syntax == nestedOperand.Syntax && nestedConversion.ExplicitCastInCode && 2044boundForEachStatement.Expression is not BoundConversion { Conversion.IsIdentity: true, ExplicitCastInCode: false, Operand: BoundExpression operand } ? 2490var isImplicit = conversion.WasCompilerGenerated || !conversion.ExplicitCastInCode;