dotnet / docs

This repository contains .NET Documentation.
https://learn.microsoft.com/dotnet
Creative Commons Attribution 4.0 International
4.27k stars 5.9k forks source link

Collection Expressions Documentation Lists Convertion To Inline Array #38916

Open MrKWatkins opened 10 months ago

MrKWatkins commented 10 months ago

Type of issue

Missing information

Description

The conversions section of the collection expressions docs (https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/collection-expressions#conversions) states that conversions to inline arrays are supported. However this does not seem to be the case; I get CS9174 when I try, and https://github.com/dotnet/roslyn/issues/69236 / https://github.com/dotnet/roslyn/issues/68927 imply that support for conversion to inline arrays didn't make it into C#12. I'm therefore assuming the docs are incorrect?

Target framework

dotnet --info output or About VS info ```console .NET SDK: Version: 8.0.100 Commit: 57efcf1350 Workload version: 8.0.100-manifests.2d90560f Runtime Environment: OS Name: ubuntu OS Version: 23.10 OS Platform: Linux RID: ubuntu.23.10-x64 Base Path: /usr/lib/dotnet/sdk/8.0.100/ .NET workloads installed: Workload version: 8.0.100-manifests.2d90560f There are no installed workloads to display. Host: Version: 8.0.0 Architecture: x64 Commit: 5535e31a71 .NET SDKs installed: 6.0.125 [/usr/lib/dotnet/sdk] 7.0.114 [/usr/lib/dotnet/sdk] 8.0.100 [/usr/lib/dotnet/sdk] .NET runtimes installed: Microsoft.AspNetCore.App 6.0.25 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 7.0.14 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 8.0.0 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 6.0.25 [/usr/lib/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 7.0.14 [/usr/lib/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 8.0.0 [/usr/lib/dotnet/shared/Microsoft.NETCore.App] Other architectures found: None Environment variables: Not set global.json file: Not found Learn more: https://aka.ms/dotnet/info Download .NET: https://aka.ms/dotnet/download ```

Page URL

https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/collection-expressions#conversions

Content source URL

https://github.com/dotnet/docs/blob/main/docs/csharp/language-reference/operators/collection-expressions.md

Document Version Independent Id

49349466-94fd-00b5-93da-e4200d9f9ec8

Article author

@BillWagner

PavelCibulka commented 9 months ago

I hope this will get attention. Working with "InlineArray" without collection expresion is very annoying.

adegeo commented 1 month ago

@BillWagner This one slipped through the cracks. I updated it with the latest issue template formats