Skip to content

Test plan for "First-class Span Types" #73445

@jjonescz

Description

@jjonescz

Proposal issue: dotnet/csharplang#7905
Speclet: https://github.com/dotnet/csharplang/blob/main/proposals/csharp-14.0/first-class-span-types.md
Label: https://github.com/dotnet/roslyn/labels/New%20Feature%20-%20First-class%20Span%20Types
Feature branch: https://github.com/dotnet/roslyn/tree/features/FirstClassSpan

  • conversions
    • based on language version
    • conversions:
      • from T[] to Span<U>
      • from T[] to ReadOnlySpan<U>
      • from Span<T> to ReadOnlySpan<U>
      • from ReadOnlySpan<T> to ReadOnlySpan<U>
      • from string to ReadOnlySpan<U>
    • implicit conversions between the above where the conversion from T to U is:
      • no conversion
      • identity conversion
      • reference conversion
      • non-reference conversion
      • user-defined conversion
    • explicit conversions between the above where the conversion from T to U is:
      • see implicit conversions
    • implicit and explicit conversions from the reverse of the above are disallowed (see FirstClassSpanTests.*_Opposite*)
    • span conversions are standard implicit conversions (see FirstClassSpanTests.*_ThroughUserImplicit)
    • implicit conversions for extension method receiver
      • not considered for extension receiver in method group
    • limited co-variance from ReadOnlySpan<T> to ReadOnlySpan<U>
    • conversions to params {ReadOnly}Span<T> (see FirstClassSpanTests.*_Params*)
    • no span conversion with ref, ref readonly, in modifiers
    • no span conversion from multi-dimensional arrays
    • method group parameter and return type conversions (disallowed) (see FirstClassSpanTests.*_MethodGroup*)
  • pattern matching ignores span conversions
  • nullable analysis of element types
  • ref safety of implicit and explicit conversions (see FirstClassSpanTests.*_RefSafety)
  • null coalesce expressions (see FirstClassSpanTests.*_Coalesce)
  • conversions in expression trees (see FirstClassSpanTests.*_ExpressionTree*)
  • Span<T> and ReadOnlySpan<T> recognized by fully-qualified name
    • must be ref struct
    • multiple definitions
    • retargeted span types
  • code generation:
    • uses well-known runtime helpers
    • missing well-known runtime helpers
  • overload resolution: based on language version
  • overload resolution: better conversion from expression (see FirstClassSpanTests.OverloadResolution_*)
    • implicit span conversion and identity conversion
    • implicit span conversion for both:
      • Span<T> and ReadOnlySpan<U>
      • ReadOnlySpan<T> and ReadOnlySpan<U>
    • implicit span conversion and array variance: {ReadOnly}Span<T> and U[]
    • implicit span conversion and implicit reference conversion: {ReadOnly}Span<T> and IEnumerable<U>
    • implicit span conversion and user-defined conversion
    • extension method receiver (see FirstClassSpanTests.OverloadResolution_*_ExtensionMethodReceiver*)
    • params (see FirstClassSpanTests.OverloadResolution_*_Params*)
  • type inference: (see FirstClassSpanTests.TypeInference_*)
    • lower-bound inference from T[] arg to {ReadOnly}Span<U>
    • lower-bound inference from Span<T> arg to ReadOnlySpan<U>
    • exact inference from T[] arg to {ReadOnly}Span<U>
    • exact inference from Span<T> arg to ReadOnlySpan<U>
  • semantic model:
    • implicit conversion
    • explicit conversion
    • Conversion.IsSpan { get; }
  • public API review: API: Conversion.IsSpan #74738
  • document breaking changes
  • IDE:
    • simplify cast
  • build dotnet/runtime
  • build Visual Studio
  • update test plan

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions