提交 069dd448 编写于 作者: T Ty Overby 提交者: GitHub

add regression test (#14342)

上级 0054a243
......@@ -19081,6 +19081,45 @@ public ValueTuple(T1 item1, T2 item2)
}
[Fact]
[WorkItem(13472, "https://github.com/dotnet/roslyn/issues/13472")]
public void InvalidCastRef()
{
var source = @"
namespace System
{
public struct ValueTuple<T1, T2>
{
public T1 Item1;
public T2 Item2;
public ValueTuple(T1 _1, T2 _2)
{
Item1 = _1;
Item2 = _2;
}
}
}
namespace System.Runtime.CompilerServices
{
public class TupleElementNamesAttribute : Attribute
{
public TupleElementNamesAttribute(string[] names)
{
}
}
}
class C
{
static void Main()
{
(int A, int B) x = (1, 2);
ref (int, int) y = ref x;
}
}";
var comp = CompileAndVerify(source);
comp.EmitAndVerify();
}
[Fact]
[WorkItem(14166, "https://github.com/dotnet/roslyn/issues/14166")]
public void RefTuple001()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册