Skip to content

[Diagnostics] - Tuples: names, metadata, conversions, and equality #55337

Description

@BillWagner

Describe the issue or suggestion

Tuple themed diagnostics:

Code Actual message text What triggers it Feature
CS8123 The tuple element name '{0}' is ignored because a different name or no name is specified by the target type '{1}'. A tuple literal supplies element names that the target tuple type does not preserve. Tuple element names
CS8126 Tuple element name '{0}' is disallowed at any position. A tuple element uses a reserved/disallowed element name. Tuple element names
CS8137 Cannot define a class or member that utilizes tuples because the compiler required type '{0}' cannot be found. Are you missing a reference? TupleElementNamesAttribute is unavailable for a class/member signature that uses tuple names. Tuple metadata
CS8138 Cannot reference 'System.Runtime.CompilerServices.TupleElementNamesAttribute' explicitly. Use the tuple syntax to define tuple names. Source explicitly references the compiler-reserved tuple-name attribute. Tuple metadata
CS8307 The first operand of an 'as' operator may not be a tuple literal without a natural type. A tuple literal without a natural type is used directly as the left operand of as. Tuple literals

Consider:

Code Actual message text What triggers it Feature
CS8128 Member '{0}' was not found on type '{1}' from assembly '{2}'. Tuple binding expects a required member on a predefined tuple type and cannot find it. ValueTuple infrastructure
CS8135 Tuple with {0} elements cannot be converted to type '{1}'. A tuple expression has the wrong cardinality for the target type. Tuple conversions
CS8179 Predefined type '{0}' is not defined or imported The required predefined System.ValueTuple type is missing. ValueTuple infrastructure
CS8182 Predefined type '{0}' must be a struct. A referenced predefined System.ValueTuple type is not a struct. ValueTuple infrastructure
CS8383 The tuple element name '{0}' is ignored because a different name or no name is specified on the other side of the tuple == or != operator. Tuple equality compares operands with conflicting or absent element names. Tuple equality
CS8384 Tuple types used as operands of an == or != operator must have matching cardinalities. But this operator has tuple types of cardinality {0} on the left and {1} on the right. Tuple equality/inequality operands have different tuple lengths. Tuple equality

Associated WorkItem - 607283

Metadata

Metadata

Assignees

Labels

📌 seQUESTeredIdentifies that an issue has been imported into Quest.okr-curationOKR: Curate content to remove outdated recommendations

Type

No type

Projects

Status
🔖 Ready

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions