Exemple #1
0
 private Conversion(
     ConversionKind kind,
     UncommonData uncommonData)
 {
     _kind         = kind;
     _uncommonData = uncommonData;
 }
Exemple #2
0
        internal Conversion(ConversionKind kind, DeconstructionInfo deconstructionInfo, ImmutableArray <Conversion> nestedConversions)
        {
            Debug.Assert(kind == ConversionKind.Deconstruction);

            this._kind    = kind;
            _uncommonData = new DeconstructionUncommonData(deconstructionInfo, nestedConversions);
        }
Exemple #3
0
 internal Conversion(ConversionKind kind, ImmutableArray <Conversion> nestedConversions)
 {
     this._kind    = kind;
     _uncommonData = new UncommonData(
         isExtensionMethod: false,
         isArrayIndex: false,
         conversionResult: default(UserDefinedConversionResult),
         conversionMethod: null,
         nestedConversions: nestedConversions);
 }
Exemple #4
0
 // For the method group, lambda and anonymous method conversions
 internal Conversion(ConversionKind kind, MethodSymbol conversionMethod, bool isExtensionMethod)
 {
     this._kind    = kind;
     _uncommonData = new UncommonData(
         isExtensionMethod: isExtensionMethod,
         isArrayIndex: false,
         conversionResult: default(UserDefinedConversionResult),
         conversionMethod: conversionMethod,
         nestedConversions: default(ImmutableArray <Conversion>));
 }
Exemple #5
0
        internal Conversion(UserDefinedConversionResult conversionResult, bool isImplicit)
        {
            _kind = conversionResult.Kind == UserDefinedConversionResultKind.NoApplicableOperators
                ? ConversionKind.NoConversion
                : isImplicit ? ConversionKind.ImplicitUserDefined : ConversionKind.ExplicitUserDefined;

            _uncommonData = new UncommonData(
                isExtensionMethod: false,
                isArrayIndex: false,
                conversionResult: conversionResult,
                conversionMethod: null,
                nestedConversions: default(ImmutableArray <Conversion>));
        }