Programming Search⌘K

C# errors and diagnostics, page 8 of 11

The error codes and warnings of C#, with the message that each one prints and what causes it. This page has 2,008 cards.

Method '…' specifies a 'default' constraint for type parameter '…', but corresponding type parameter '…' of overridden or explicitly implemented method '…' is constrained to a reference type or a value type. CS8822

Code
CS8822
Severity
error
Message
Method '{}' specifies a 'default' constraint for type parameter '{}', but corresponding type parameter '{}' of overridden or explicitly implemented method '{}' is constrained to a reference type or a value type.

Source: github.com. JSON record. This entry is a card. Help write this page.

The return type for ++ or -- operator must either match the parameter type, or be derived from the parameter type, or be the containing type's type parameter constrained to it unless the parameter type is a different type parameter. CS8923

Code
CS8923
Severity
error
Message
The return type for ++ or -- operator must either match the parameter type, or be derived from the parameter type, or be the containing type's type parameter constrained to it unless the parameter type is a different type parameter.

Source: github.com. JSON record. This entry is a card. Help write this page.

A generic task-like return type was expected, but the type '…' found in 'AsyncMethodBuilder' attribute was not suitable. It must be an unbound generic type of arity one, and its containing type (if any) must be non-generic. CS8940

Code
CS8940
Severity
error
Message
A generic task-like return type was expected, but the type '{}' found in 'AsyncMethodBuilder' attribute was not suitable. It must be an unbound generic type of arity one, and its containing type (if any) must be non-generic.

Source: github.com. JSON record. This entry is a card. Help write this page.

Parameter to interpolated string handler conversion occurs after handler parameter. CS8947

Code
CS8947
Severity
warning
Message
Parameter '{}' occurs after '{}' in the parameter list, but is used as an argument for interpolated string handler conversions. This will require the caller to reorder parameters with named arguments at the call site. Consider putting the interpolated string handler parameter after all arguments involved.

Source: github.com. JSON record. This entry is a card. Help write this page.

Parameter '…' is an argument to the interpolated string handler conversion on parameter '…', but the corresponding argument is specified after the interpolated string expression. Reorder the arguments to move '…' before '…'. CS8950

Code
CS8950
Severity
error
Message
Parameter '{}' is an argument to the interpolated string handler conversion on parameter '{}', but the corresponding argument is specified after the interpolated string expression. Reorder the arguments to move '{}' before '{}'.

Source: github.com. JSON record. This entry is a card. Help write this page.

Conditional expression is not valid in language version … because a common type was not found between '…' and '…'. To use a target-typed conversion, upgrade to language version … or greater. CS8957

Code
CS8957
Severity
error
Message
Conditional expression is not valid in language version {} because a common type was not found between '{}' and '{}'. To use a target-typed conversion, upgrade to language version {} or greater.

Source: github.com. JSON record. This entry is a card. Help write this page.