Skip to content

Missing name for ValueTuple in Linq #3014

@sgkoishi

Description

@sgkoishi

Input code

using System.Linq;

var a = args.Select(v => (Name: v, Value: v))
    .OrderBy(kvp => kvp.Name)
    .First();

Erroneous output

(from v in args
    select (v, v) into c
    orderby c.Name
    select c).First()

The decompiled version is select (v, v) without the name (Name, Value) of the ValueTuple, thus the later orderby c.Name shows the error does not contain a definition for 'Name' ...

Details

  • Product in use: ILSpy
  • Version in use: 8.0, also tested latest CI version 8.0.0.7405.

Metadata

Metadata

Labels

BugDecompilerThe decompiler engine itself

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions