Skip to content

IDE0007 not reported when resolved type is Span<T> #79337

@glen-84

Description

@glen-84

Version Used:

10.0.100-preview.5.25277.114

Steps to Reproduce:

// ✅ Not reported (would change to `byte*`).
Span<byte> buffer1 = stackalloc byte[32];

// ❌ Not reported (would remain `Span<byte>`).
Span<byte> buffer2 = requiredLength < 256
    ? stackalloc byte[32]
    : (rented = ArrayPool<byte>.Shared.Rent(requiredLength)).AsSpan();

Diagnostic Id:

IDE0007: Use var instead of explicit type

Expected Behavior:

(see code snippet above)

Actual Behavior:

(see code snippet above)


Possibly related to #22779.

This is handled correctly by Rider/ReSharper SuggestVarOrType_Elsewhere and Roslynator RCS1264.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions