Quantcast
Channel: YouTrackReSharper (RSRP) - Bug and Issue Tracker
Viewing all articles
Browse latest Browse all 106942

RSRP-468351: False errors for conversion from stackalloc to Span

$
0
0
Reporter Vladimir Reshetnikov (nikov) Vladimir Reshetnikov (nikov)
Created Feb 13, 2018 12:26:48 AM
Updated Apr 9, 2018 4:03:39 PM
Resolved Apr 9, 2018 10:50:05 AM
Subsystem Code Analysis - C#
Assignee Ivan Serduk (IvanSerduk)
Priority Normal
State Fixed
Type Bug
Fix version 2018.1
Affected versions No Affected versions
Fixed In Version ReSharper 2018.1 RTM
VsVersion All Versions
See the full solution attached.

// C# 7.2
using System;

class Program
{
static void Main()
{
Span<byte> s = stackalloc byte[5];
}
}

This code compiles without any errors, but ReSharper reports the following:
Struct 'System.Span<T>' is obsolete: "Types with embedded references are not supported in this version of your compiler."
Cannot use unsafe construct in safe context


An Obsolete attribute with this message has a special meaning for C# 7.2 compiler (see https://github.com/dotnet/csharplang/blob/master/proposals/csharp-7.2/span-safety.md#user-content-metadata-representation-or-ref-like-structs)



Viewing all articles
Browse latest Browse all 106942

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>