Ejemplo n.º 1
0
 /// <remarks>
 /// NOTE:    This method is intended for passes other than the LocalRewriter.
 /// NOTE:    Use MakeConversion helper method in the LocalRewriter instead,
 /// NOTE:    it generates a synthesized conversion in its lowered form.
 /// </remarks>
 public static BoundConversion Synthesized(
     SyntaxNode syntax,
     BoundExpression operand,
     Conversion conversion,
     bool @checked,
     bool explicitCastInCode,
     ConversionGroup conversionGroupOpt,
     ConstantValue constantValueOpt,
     TypeSymbol type,
     bool hasErrors = false)
 {
     return(new BoundConversion(
                syntax,
                operand,
                conversion,
                @checked,
                explicitCastInCode: explicitCastInCode,
                conversionGroupOpt,
                constantValueOpt,
                type,
                hasErrors || !conversion.IsValid)
     {
         WasCompilerGenerated = true
     });
 }
Ejemplo n.º 2
0
 public BoundConversion(
     SyntaxNode syntax,
     BoundExpression operand,
     Conversion conversion,
     bool @checked,
     bool explicitCastInCode,
     ConversionGroup conversionGroupOpt,
     ConstantValue constantValueOpt,
     TypeSymbol type,
     bool hasErrors = false)
     : this(
         syntax,
         operand,
         conversion,
         isBaseConversion : false,
         @checked : @checked,
         explicitCastInCode : explicitCastInCode,
         constantValueOpt : constantValueOpt,
         conversionGroupOpt,
         type : type,
         hasErrors : hasErrors || !conversion.IsValid)
 {
     OriginalUserDefinedConversionsOpt = conversion.OriginalUserDefinedConversions;
 }