Reporter |
|
---|---|
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.
This code compiles without any errors, but ReSharper reports the following:
An
// 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
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)