Ejemplo n.º 1
0
 private MemberAnalysisResult(
     MemberResolutionKind kind,
     ImmutableArray <int> badArgumentsOpt,
     ImmutableArray <int> argsToParamsOpt,
     ImmutableArray <Conversion> conversionsOpt,
     int missingParameter          = -1,
     bool hasAnyRefOmittedArgument = false)
 {
     this.Kind                     = kind;
     this.BadArgumentsOpt          = badArgumentsOpt;
     this.ArgsToParamsOpt          = argsToParamsOpt;
     this.ConversionsOpt           = conversionsOpt;
     this.BadParameter             = missingParameter;
     this.HasAnyRefOmittedArgument = hasAnyRefOmittedArgument;
 }
Ejemplo n.º 2
0
 private MemberAnalysisResult(
     MemberResolutionKind kind,
     ImmutableArray<int> badArgumentsOpt,
     ImmutableArray<int> argsToParamsOpt,
     ImmutableArray<Conversion> conversionsOpt,
     int missingParameter = -1,
     bool hasAnyRefOmittedArgument = false)
 {
     this.Kind = kind;
     this.BadArgumentsOpt = badArgumentsOpt;
     this.ArgsToParamsOpt = argsToParamsOpt;
     this.ConversionsOpt = conversionsOpt;
     this.BadParameter = missingParameter;
     this.HasAnyRefOmittedArgument = hasAnyRefOmittedArgument;
 }
Ejemplo n.º 3
0
 private MemberAnalysisResult(
     MemberResolutionKind kind,
     ImmutableArray <int> badArgumentsOpt       = default,
     ImmutableArray <int> argsToParamsOpt       = default,
     ImmutableArray <Conversion> conversionsOpt = default,
     int missingParameter          = -1,
     bool hasAnyRefOmittedArgument = false,
     ImmutableArray <TypeParameterDiagnosticInfo> constraintFailureDiagnosticsOpt = default)
 {
     this.Kind                         = kind;
     this.BadArgumentsOpt              = badArgumentsOpt;
     this.ArgsToParamsOpt              = argsToParamsOpt;
     this.ConversionsOpt               = conversionsOpt;
     this.BadParameter                 = missingParameter;
     this.HasAnyRefOmittedArgument     = hasAnyRefOmittedArgument;
     this.ConstraintFailureDiagnostics = constraintFailureDiagnosticsOpt.NullToEmpty();
 }
Ejemplo n.º 4
0
        private static bool SuppressUseSiteDiagnosticsForKind(MemberResolutionKind kind)
        {
            switch (kind)
            {
            case MemberResolutionKind.UnsupportedMetadata:
                return(true);

            case MemberResolutionKind.NoCorrespondingParameter:
            case MemberResolutionKind.NoCorrespondingNamedParameter:
            case MemberResolutionKind.NameUsedForPositional:
            case MemberResolutionKind.RequiredParameterMissing:
            case MemberResolutionKind.LessDerived:
                // Dev12 checks all of these things before considering use site diagnostics.
                // That is, use site diagnostics are suppressed for candidates rejected for these reasons.
                return(true);

            default:
                return(false);
            }
        }
Ejemplo n.º 5
0
        private static CommonMemberResolutionKind ConvertKind(MemberResolutionKind kind)
        {
            switch (kind)
            {
            case MemberResolutionKind.ApplicableInExpandedForm:
            case MemberResolutionKind.ApplicableInNormalForm:
                return(CommonMemberResolutionKind.Applicable);

            case MemberResolutionKind.UseSiteError:
            case MemberResolutionKind.UnsupportedMetadata:
                return(CommonMemberResolutionKind.UseSiteError);

            case MemberResolutionKind.TypeInferenceFailed:
            case MemberResolutionKind.TypeInferenceExtensionInstanceArgument:
                return(CommonMemberResolutionKind.TypeInferenceFailed);

            default:
                return(CommonMemberResolutionKind.Worse);
            }
        }
Ejemplo n.º 6
0
 private MemberAnalysisResult(MemberResolutionKind kind)
     : this(kind, default(ImmutableArray <int>), default(ImmutableArray <int>), default(ImmutableArray <Conversion>))
 {
 }
Ejemplo n.º 7
0
 private MemberAnalysisResult(MemberResolutionKind kind)
     : this(kind, default(ImmutableArray<int>), default(ImmutableArray<int>), default(ImmutableArray<Conversion>))
 {
 }
Ejemplo n.º 8
0
 private static bool SuppressUseSiteDiagnosticsForKind(MemberResolutionKind kind)
 {
     switch (kind)
     {
         case MemberResolutionKind.UnsupportedMetadata:
             return true;
         case MemberResolutionKind.NoCorrespondingParameter:
         case MemberResolutionKind.NoCorrespondingNamedParameter:
         case MemberResolutionKind.NameUsedForPositional:
         case MemberResolutionKind.RequiredParameterMissing:
         case MemberResolutionKind.LessDerived:
             // Dev12 checks all of these things before considering use site diagnostics.
             // That is, use site diagnostics are suppressed for candidates rejected for these reasons.
             return true;
         default:
             return false;
     }
 }