Click or drag to resize

CandidateReason Class



Indicates the reasons why a candidate (or set of candidate) symbols were not considered correct in SemanticInfo. Higher values take precedence over lower values, so if, for example, there a symbol with a given name that was inaccessible, and other with the wrong arity, only the inaccessible one would be reported in the SemanticInfo.
Inheritance Hierarchy
SystemEnum
  Microsoft.CodeAnalysisCandidateReason

Namespace:  Microsoft.CodeAnalysis
Assembly:  Microsoft.CodeAnalysis (in Microsoft.CodeAnalysis.dll) Version: 2.3.0-dev-56735-00. Commit Hash: <developer build>
Syntax
public sealed class CandidateReason : Enum

The CandidateReason type exposes the following members.

Fields
  NameDescription
Public fieldStatic memberAmbiguous
Multiple ambiguous symbols were available with the same name. This can occur if "using" statements bring multiple namespaces into scope, and the same type is available in multiple. This can also occur if multiple properties of the same name are available in a multiple interface inheritance situation.
Public fieldStatic memberInaccessible
The candidate symbol had an accessibility modifier (private, protected, ...) that made it inaccessible.
Public fieldStatic memberLateBound
Method could not be selected statically. The candidate symbols are the methods there were considered during overload resolution (which may or may not be applicable methods).
Public fieldStatic memberMemberGroup
CandidateSymbols are members of a group of results. This is used when there isn't a problem, but there is more than one result, for example nameof(int.ToString).
Public fieldStatic memberNone
No CandidateSymbols.
Public fieldStatic memberNotAnAttributeType
Only an attribute type was valid in the given location, but the candidate symbol was of the wrong kind.
Public fieldStatic memberNotAnEvent
Only an event was valid in the given location, but the candidate symbols was of the wrong kind.
Public fieldStatic memberNotATypeOrNamespace
Only a type or namespace was valid in the given location, but the candidate symbols was of the wrong kind.
Public fieldStatic memberNotAValue
The candidate symbol was in a place where a value was required, but was not a value (e.g., was a type or namespace).
Public fieldStatic memberNotAVariable
The candidate symbol was in a place where a variable (or sometimes, a property) was required, but was not allowed there because it isn't a symbol that can be assigned to. For example, the left hand side of an assignment, or a ref or out parameter.
Public fieldStatic memberNotAWithEventsMember
The candidate symbol must be a WithEvents member, but it was not.
Public fieldStatic memberNotCreatable
The candidate symbol existed, but was not allowed to be created in a new expression. For example, interfaces, static classes, and unconstrained type parameters.
Public fieldStatic memberNotInvocable
The candidate symbol was used in a way that an invocable member (method, or variable of delegate type) was required, but the candidate symbol was not invocable.
Public fieldStatic memberNotReferencable
The candidate symbol existed, but was not allowed to be referenced. For example, the "get_XXX" method used to implement a property named "XXX" may not be directly referenced. Similarly, the type "System.Void" can not be directly referenced. Also occurs if "this" is used in a context (static method or field initializer) where "this" is not available.
Public fieldStatic memberOverloadResolutionFailure
Overload resolution did not choose a method. The candidate symbols are the methods there were considered during overload resolution (which may or may not be applicable methods).
Public fieldStatic memberStaticInstanceMismatch
The candidate symbol must be an instance variable, but was used as static, or the reverse.
Public fieldvalue__
Public fieldStatic memberWrongArity
The candidate symbol takes a different number of type parameters that was required.
Top
See Also