dotnet / csharplang

The official repo for the design of the C# programming language
11.02k stars 1.01k forks source link

Add first-class span types proposal #7904

Closed 333fred closed 3 months ago

CyrusNajmabadi commented 3 months ago

Question. If we have your this, can we remove the special roles rules we have with collections to prefer spans over stays arrays? Would that just all fall out trivially once we have these conversions through preexisting better ness rules? If so, that would be lovely.

333fred commented 3 months ago

Question. If we have your this, can we remove the special roles rules we have with collections to prefer spans over stays arrays? Would that just all fall out trivially once we have these conversions through preexisting better ness rules? If so, that would be lovely.

Potentially. I haven't worked through all the scenarios, but I do believe it would make Span and ReadOnlySpan encompassing types in more scenarios, allowing the desired semantics to just fall out.

CyrusNajmabadi commented 3 months ago

Lovely!