-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Named tuples from C# methods do not retain their names #10502
Copy link
Copy link
Closed
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime
Metadata
Metadata
Assignees
Labels
Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-No ActivityIssue has had no activity for 6 months or moreIssue has had no activity for 6 months or moreWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime
Steps to reproduce
Expected behavior
Offsetis translated toItem1andLengthis translated toItem2Actual behavior
Tuple items must be referred to by their real property names (e.g.
Item1andItem2).Environment data
Notes
Named tuples are implemented in metadata. The method that returns the tuple is annotated with the
TupleElementNamesattribute. In the example, the method is annotated with this attribute:The item names cannot be inferred from the value itself, but
PSInvokeMemberBindercould attachPSAliasProperty's to the tuple after invocation.Currently this probably isn't all that important. In the version of Core included in7.0.0-preview.3, there are only two public API's in the BCL that return named tuples (the other is
Enumerable.Zip<,>(IEnumerable<>,IEnumerable<>)).