提交 96f5ce2f 编写于 作者: A Andy Gocke

Document breaking change in #5712 (#11399)

Adds a file to the C# compiler docs that lists known breaking changes with the native compiler and
adds #5712 to that list.
上级 a7ed5768
**This document lists known breaking changes in Roslyn (VS2015+) from the native C# compiler (VS2013 and previous).**
*Breaks are formatted with a monotonically increasing numbered list to allow them to referenced via shorthand (i.e., "known break #1").
Each entry should include a short description of the break, followed by either a link to the issue describing the full details of the break or the full details of the break inline.*
1. In some cases, due to a bug in the native compiler, programs with pointers to structs with one or more
type parameters compiled without error. All such programs should now produce errors in Roslyn. See
[#5712](https://github.com/dotnet/roslyn/issues/5712) for examples and details.
......@@ -7681,6 +7681,27 @@ unsafe static void Main()
#region PointerTypes tests
[WorkItem(5712, "https://github.com/dotnet/roslyn/issues/5712")]
[Fact]
public void PathalogicalRefStructPtrMultiDimensionalArray()
{
var text = @"
class C
{
class Foo3 {
internal struct Struct1<U> {}
}
unsafe void NMethodCecilNameHelper_Parameter_AllTogether<U>(ref Foo3.Struct1<int>**[][,,] ppi) { }
}
";
CreateCompilationWithMscorlib(text, options: TestOptions.UnsafeDebugDll).VerifyDiagnostics(
// (8,67): error CS0208: Cannot take the address of, get the size of, or declare a pointer to a managed type ('C.Foo3.Struct1<int>')
// unsafe void NMethodCecilNameHelper_Parameter_AllTogether<U>(ref Foo3.Struct1<int>**[][,,] ppi) { }
Diagnostic(ErrorCode.ERR_ManagedAddr, "Foo3.Struct1<int>*").WithArguments("C.Foo3.Struct1<int>").WithLocation(8, 67));
}
[WorkItem(543990, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/543990")]
[Fact]
public void PointerTypeInVolatileField()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册