提交 e6406257 编写于 作者: J Julien 提交者: VSadov

Add test reference for ValueTuple library (#10817)

上级 57e75065
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.CSharp.Test.Utilities;
using Roslyn.Test.Utilities;
using Microsoft.CodeAnalysis.Test.Utilities;
using System;
using System.Collections.Immutable;
using System.Linq;
using System.Text;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.CSharp.Test.Utilities;
using Microsoft.CodeAnalysis.Test.Utilities;
using Roslyn.Test.Utilities;
using Xunit;
namespace Microsoft.CodeAnalysis.CSharp.UnitTests.CodeGen
......@@ -188,6 +188,7 @@ public ValueTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7
}
}
";
[Fact]
public void SimpleTuple()
{
......@@ -845,9 +846,9 @@ static void Main()
(int, int, int, int, int, int, int, int) y = (1, 2, 3, 4, 5, 6, 7, 8, 9);
}
}
" + trivial2uple + trivial3uple + trivalRemainingTuples;
";
CreateCompilationWithMscorlib(source, parseOptions: TestOptions.Regular.WithTuplesFeature()).VerifyDiagnostics(
CreateCompilationWithMscorlib(source, references: new[] { ValueTupleRef, SystemRuntimeFacadeRef }, parseOptions: TestOptions.Regular.WithTuplesFeature()).VerifyDiagnostics(
// (6,54): error CS0029: Cannot implicitly convert type '(string, int, int, int, int, int, int, int)' to '(int, int, int, int, int, int, int, int)'
// (int, int, int, int, int, int, int, int) x = ("Alice", 2, 3, 4, 5, 6, 7, 8);
Diagnostic(ErrorCode.ERR_NoImplicitConv, @"(""Alice"", 2, 3, 4, 5, 6, 7, 8)").WithArguments("(string, int, int, int, int, int, int, int)", "(int, int, int, int, int, int, int, int)").WithLocation(6, 54),
......@@ -1299,9 +1300,9 @@ static void Main()
(int Item1, int Item01, int Item10) x = (Item01: 1, Item1: 2, Item10: 3);
}
}
" + trivial2uple + trivial3uple + trivalRemainingTuples;
";
var comp = CreateCompilationWithMscorlib(source, parseOptions: TestOptions.Regular.WithTuplesFeature());
var comp = CreateCompilationWithMscorlib(source, references: new[] { ValueTupleRef }, parseOptions: TestOptions.Regular.WithTuplesFeature());
comp.VerifyDiagnostics(
// (6,37): error CS8201: Tuple member name 'Item10' is only allowed at position 10.
// (int Item1, int Item01, int Item10) x = (Item01: 1, Item1: 2, Item10: 3);
......@@ -1370,9 +1371,9 @@ static void Main()
(int Item1, string Item3, string Item2, int Item4, int Item5, int Item6, int Item7, string Rest) x = (Item2: ""bad"", Item4: ""bad"", Item3: 3, Item4: 4, Item5: 5, Item6: 6, Item7: 7, Rest: ""bad"");
}
}
" + trivial2uple + trivial3uple + trivalRemainingTuples;
";
var comp = CreateCompilationWithMscorlib(source, parseOptions: TestOptions.Regular.WithTuplesFeature());
var comp = CreateCompilationWithMscorlib(source, references: new[] { ValueTupleRef }, parseOptions: TestOptions.Regular.WithTuplesFeature());
comp.VerifyDiagnostics(
// (6,28): error CS8201: Tuple member name 'Item3' is only allowed at position 3.
// (int Item1, string Item3, string Item2, int Item4, int Item5, int Item6, int Item7, string Rest) x = (Item2: "bad", Item4: "bad", Item3: 3, Item4: 4, Item5: 5, Item6: 6, Item7: 7, Rest: "bad");
......@@ -1440,7 +1441,7 @@ static void Main()
System.Console.WriteLine($""{x.a} {x.b} {x.c} {x.d} {x.e} {x.f} {x.g} {x.h} {x.i} {x.j} {x.k} {x.l}"");
}
}
" + trivial2uple + trivial3uple + trivalRemainingTuples;
";
Action<ModuleSymbol> validator = module =>
{
......@@ -1457,7 +1458,7 @@ static void Main()
model.GetDeclaredSymbol(x).ToTestDisplayString());
};
var verifier = CompileAndVerify(source, expectedOutput: @"1 2 3 4 5 6 7 Alice 2 3 4 5", additionalRefs: new[] { MscorlibRef }, sourceSymbolValidator: validator, parseOptions: TestOptions.Regular.WithTuplesFeature());
var verifier = CompileAndVerify(source, expectedOutput: @"1 2 3 4 5 6 7 Alice 2 3 4 5", additionalRefs: new[] { MscorlibRef, ValueTupleRef, SystemRuntimeFacadeRef }, sourceSymbolValidator: validator, parseOptions: TestOptions.Regular.WithTuplesFeature());
verifier.VerifyDiagnostics();
}
......@@ -1560,7 +1561,7 @@ static void Main()
[Fact]
public void LongTupleCreation()
{
var source = trivial2uple + trivial3uple + trivalRemainingTuples + @"
var source = @"
class C
{
static void Main()
......@@ -1587,7 +1588,7 @@ static void Main()
model.GetTypeInfo(node).Type.ToTestDisplayString());
};
var verifier = CompileAndVerify(source, expectedOutput: @"1 2 3 4 5 6 7 Alice 2 3 4 5 6 7 Bob 2 3", additionalRefs: new[] { MscorlibRef }, sourceSymbolValidator: validator, parseOptions: TestOptions.Regular.WithTuplesFeature());
var verifier = CompileAndVerify(source, expectedOutput: @"1 2 3 4 5 6 7 Alice 2 3 4 5 6 7 Bob 2 3", additionalRefs: new[] { MscorlibRef, ValueTupleRef, SystemRuntimeFacadeRef }, sourceSymbolValidator: validator, parseOptions: TestOptions.Regular.WithTuplesFeature());
verifier.VerifyDiagnostics();
}
......@@ -1733,7 +1734,7 @@ static void Main()
System.Console.WriteLine($""{x.a} {x.b} {x.c} {x.d} {x.e} {x.f} {x.g} {x.h} {x.i} {x.j} {x.k} {x.l} {x.m} {x.n} {x.o} {x.p} {x.q}"");
}
}
" + trivial2uple + trivial3uple + trivalRemainingTuples;
";
Action<ModuleSymbol> validator = module =>
{
......@@ -1751,7 +1752,7 @@ static void Main()
model.GetTypeInfo(node).Type.ToTestDisplayString());
};
var verifier = CompileAndVerify(source, expectedOutput: @"1 2 3 4 5 6 7 Alice 2 3 4 5 6 7 Bob 2 3", additionalRefs: new[] { MscorlibRef }, sourceSymbolValidator: validator, parseOptions: TestOptions.Regular.WithTuplesFeature());
var verifier = CompileAndVerify(source, expectedOutput: @"1 2 3 4 5 6 7 Alice 2 3 4 5 6 7 Bob 2 3", additionalRefs: new[] { MscorlibRef, ValueTupleRef, SystemRuntimeFacadeRef }, sourceSymbolValidator: validator, parseOptions: TestOptions.Regular.WithTuplesFeature());
verifier.VerifyDiagnostics();
}
......@@ -1772,9 +1773,9 @@ static T PrintAndReturn<T>(T i)
return i;
}
}
" + trivial2uple + trivial3uple + trivalRemainingTuples;
";
var verifier = CompileAndVerify(source, expectedOutput: @"1 4 7 Alice 7 Bob 3", additionalRefs: new[] { MscorlibRef }, parseOptions: TestOptions.Regular.WithTuplesFeature());
var verifier = CompileAndVerify(source, expectedOutput: @"1 4 7 Alice 7 Bob 3", additionalRefs: new[] { MscorlibRef, ValueTupleRef, SystemRuntimeFacadeRef }, parseOptions: TestOptions.Regular.WithTuplesFeature());
verifier.VerifyDiagnostics();
}
......@@ -1790,7 +1791,7 @@ static void Main()
System.Console.WriteLine($""{x.Rest.Item1} {x.Rest.Item2}"");
}
}
" + trivial2uple + trivial3uple + trivalRemainingTuples;
";
Action<ModuleSymbol> validator = module =>
{
......@@ -1804,7 +1805,7 @@ static void Main()
Assert.Equal("System.ValueTuple<System.String, System.Int32>", model.GetTypeInfo(node).Type.ToTestDisplayString());
};
var verifier = CompileAndVerify(source, expectedOutput: @"Alice 1", additionalRefs: new[] { MscorlibRef }, sourceSymbolValidator: validator, parseOptions: TestOptions.Regular.WithTuplesFeature());
var verifier = CompileAndVerify(source, expectedOutput: @"Alice 1", additionalRefs: new[] { MscorlibRef, ValueTupleRef, SystemRuntimeFacadeRef }, sourceSymbolValidator: validator, parseOptions: TestOptions.Regular.WithTuplesFeature());
verifier.VerifyDiagnostics();
}
......@@ -2070,9 +2071,9 @@ static void Main()
return (a.Item1.Length, a.Item2.Length);
}
}
" + trivial2uple + trivial3uple + trivalRemainingTuples;
";
var comp = CompileAndVerify(source, expectedOutput: @"5 3", parseOptions: TestOptions.Regular.WithTuplesFeature());
var comp = CompileAndVerify(source, expectedOutput: @"5 3", additionalRefs: new[] { ValueTupleRef, SystemRuntimeFacadeRef }, parseOptions: TestOptions.Regular.WithTuplesFeature());
comp.VerifyDiagnostics();
}
......@@ -2099,9 +2100,9 @@ static void Main()
return (a.Item1.Length, a.Item2.Length);
}
}
" + trivial2uple + trivial3uple + trivalRemainingTuples;
";
var comp = CompileAndVerify(source, expectedOutput: @"5 3", parseOptions: TestOptions.Regular.WithTuplesFeature());
var comp = CompileAndVerify(source, expectedOutput: @"5 3", additionalRefs: new[] { ValueTupleRef, SystemRuntimeFacadeRef }, parseOptions: TestOptions.Regular.WithTuplesFeature());
comp.VerifyDiagnostics();
}
......@@ -2128,9 +2129,9 @@ static void Main()
return a;
}
}
" + trivial2uple + trivial3uple + trivalRemainingTuples;
";
var comp = CompileAndVerify(source, expectedOutput: @"1 7 8", parseOptions: TestOptions.Regular.WithTuplesFeature());
var comp = CompileAndVerify(source, expectedOutput: @"1 7 8", additionalRefs: new[] { ValueTupleRef, SystemRuntimeFacadeRef }, parseOptions: TestOptions.Regular.WithTuplesFeature());
comp.VerifyDiagnostics();
}
......@@ -2157,9 +2158,9 @@ static void Main()
return (a.Item1.Length, a.Item2.Length);
}
}
" + trivial2uple + trivial3uple + trivalRemainingTuples;
";
var comp = CompileAndVerify(source, expectedOutput: @"5 3", parseOptions: TestOptions.Regular.WithTuplesFeature());
var comp = CompileAndVerify(source, expectedOutput: @"5 3", additionalRefs: new[] { ValueTupleRef, SystemRuntimeFacadeRef }, parseOptions: TestOptions.Regular.WithTuplesFeature());
comp.VerifyDiagnostics();
}
......@@ -2186,9 +2187,9 @@ static void Main()
return new System.ValueTuple<int, int>(a.Item1.Length, a.Item2.Length);
}
}
" + trivial2uple + trivial3uple + trivalRemainingTuples;
";
var comp = CompileAndVerify(source, expectedOutput: @"5 3", parseOptions: TestOptions.Regular.WithTuplesFeature());
var comp = CompileAndVerify(source, expectedOutput: @"5 3", additionalRefs: new[] { ValueTupleRef, SystemRuntimeFacadeRef }, parseOptions: TestOptions.Regular.WithTuplesFeature());
comp.VerifyDiagnostics();
}
......@@ -2412,7 +2413,7 @@ static void M((int, string)? a)
[Fact]
public void Tuple2To8Members()
{
var source = trivial2uple + trivial3uple + trivalRemainingTuples + @"
var source = @"
class C
{
static void Main()
......@@ -2456,7 +2457,7 @@ static void Main()
}
";
var comp = CompileAndVerify(source, expectedOutput: "12345678901234567890123456789012345", parseOptions: TestOptions.Regular.WithTuplesFeature());
var comp = CompileAndVerify(source, expectedOutput: "12345678901234567890123456789012345", additionalRefs: new[] { ValueTupleRef, SystemRuntimeFacadeRef }, parseOptions: TestOptions.Regular.WithTuplesFeature());
}
[Fact]
......@@ -2932,9 +2933,9 @@ static void Test<T>((Func<T>, Func<T>, Func<T>, Func<T>, Func<T>, Func<T>, Func<
System.Console.WriteLine(x.Item1().ToString());
}
}
" + trivial2uple + trivial3uple + trivalRemainingTuples;
";
var comp = CompileAndVerify(source, parseOptions: TestOptions.Regular.WithTuplesFeature(), expectedOutput: @"
var comp = CompileAndVerify(source, additionalRefs: new[] { ValueTupleRef, SystemRuntimeFacadeRef }, parseOptions: TestOptions.Regular.WithTuplesFeature(), expectedOutput: @"
second
first
third
......@@ -2978,7 +2979,6 @@ static void Test<T>(T arg)
public void TargetTypingNullable02Long()
{
var source = @"
using System;
class C
{
static void Main()
......@@ -2999,12 +2999,11 @@ static void Test<T>(T arg)
System.Console.WriteLine(arg);
}
}
" + trivial2uple + trivial3uple + trivalRemainingTuples;
var comp = CompileAndVerify(source, parseOptions: TestOptions.Regular.WithTuplesFeature(), expectedOutput: @"
1
";
var comp = CompileAndVerify(source, additionalRefs: new[] { ValueTupleRef, SystemRuntimeFacadeRef }, parseOptions: TestOptions.Regular.WithTuplesFeature(), expectedOutput:
@"1
8
System.ValueTuple`8[System.Int32,System.String,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.ValueTuple`3[System.Int32,System.Int32,System.Int32]]
(1, , 1, 2, 3, 4, 5, (6, 7, 8))
");
}
......@@ -3012,7 +3011,6 @@ static void Test<T>(T arg)
public void TargetTypingNullableOverload()
{
var source = @"
using System;
class C
{
static void Main()
......@@ -3042,9 +3040,9 @@ static void Test((int, int, int, int, int, int, int, int, int, int) x)
System.Console.WriteLine(""fourth"");
}
}
" + trivial2uple + trivial3uple + trivalRemainingTuples;
";
var comp = CompileAndVerify(source, parseOptions: TestOptions.Regular.WithTuplesFeature(), expectedOutput: @"
var comp = CompileAndVerify(source, additionalRefs: new[] { ValueTupleRef, SystemRuntimeFacadeRef }, parseOptions: TestOptions.Regular.WithTuplesFeature(), expectedOutput: @"
first
first
fourth
......@@ -3055,7 +3053,6 @@ static void Test((int, int, int, int, int, int, int, int, int, int) x)
public void TupleConversion01()
{
var source = @"
class C
{
static void Main()
......@@ -3071,16 +3068,16 @@ static void Main()
}
" + trivial2uple;
CreateCompilationWithMscorlib(source, parseOptions: TestOptions.Regular.WithTuplesFeature()).VerifyDiagnostics(
// (8,29): error CS0029: Cannot implicitly convert type '(long c, long d)' to '(int a, int b)'
CreateCompilationWithMscorlib(source, references: new[] { ValueTupleRef, SystemRuntimeFacadeRef }, parseOptions: TestOptions.Regular.WithTuplesFeature()).VerifyDiagnostics(
// (7,29): error CS0029: Cannot implicitly convert type '(long c, long d)' to '(int a, int b)'
// (int a, int b) x1 = ((long c, long d))(e: 1, f:2);
Diagnostic(ErrorCode.ERR_NoImplicitConv, "((long c, long d))(e: 1, f:2)").WithArguments("(long c, long d)", "(int a, int b)").WithLocation(8, 29),
// (10,33): error CS0029: Cannot implicitly convert type '(int c, int d)' to '(short a, short b)'
Diagnostic(ErrorCode.ERR_NoImplicitConv, "((long c, long d))(e: 1, f:2)").WithArguments("(long c, long d)", "(int a, int b)").WithLocation(7, 29),
// (9,33): error CS0029: Cannot implicitly convert type '(int c, int d)' to '(short a, short b)'
// (short a, short b) x2 = ((int c, int d))(e: 1, f:2);
Diagnostic(ErrorCode.ERR_NoImplicitConv, "((int c, int d))(e: 1, f:2)").WithArguments("(int c, int d)", "(short a, short b)").WithLocation(10, 33),
// (13,29): error CS0030: Cannot convert type '(int e, string f)' to '(long c, long d)'
Diagnostic(ErrorCode.ERR_NoImplicitConv, "((int c, int d))(e: 1, f:2)").WithArguments("(int c, int d)", "(short a, short b)").WithLocation(9, 33),
// (12,29): error CS0030: Cannot convert type '(int e, string f)' to '(long c, long d)'
// (int a, int b) x3 = ((long c, long d))(e: 1, f:"qq");
Diagnostic(ErrorCode.ERR_NoExplicitConv, @"((long c, long d))(e: 1, f:""qq"")").WithArguments("(int e, string f)", "(long c, long d)").WithLocation(13, 29)
Diagnostic(ErrorCode.ERR_NoExplicitConv, @"((long c, long d))(e: 1, f:""qq"")").WithArguments("(int e, string f)", "(long c, long d)").WithLocation(12, 29)
);
}
......
......@@ -544,6 +544,7 @@ public void AllWellKnownTypes()
SystemXmlRef,
SystemXmlLinqRef,
SystemWindowsFormsRef,
ValueTupleRef
}.Concat(WinRtRefs).ToArray();
var comp = CreateCompilation("", refs);
......@@ -557,15 +558,6 @@ public void AllWellKnownTypes()
continue;
case WellKnownType.System_FormattableString:
case WellKnownType.System_Runtime_CompilerServices_FormattableStringFactory:
case WellKnownType.System_ValueTuple_T1:
case WellKnownType.System_ValueTuple_T2:
case WellKnownType.System_ValueTuple_T3:
case WellKnownType.System_ValueTuple_T4:
case WellKnownType.System_ValueTuple_T5:
case WellKnownType.System_ValueTuple_T6:
case WellKnownType.System_ValueTuple_T7:
case WellKnownType.System_ValueTuple_TRest:
// PROTOTYPE(tuples)
// Not yet in the platform.
continue;
case WellKnownType.ExtSentinel:
......@@ -593,6 +585,7 @@ public void AllWellKnownTypeMembers()
SystemXmlRef,
SystemXmlLinqRef,
SystemWindowsFormsRef,
ValueTupleRef
}.Concat(WinRtRefs).ToArray();
var comp = CreateCompilation("", refs);
......@@ -608,62 +601,7 @@ public void AllWellKnownTypeMembers()
// C# can't embed VB core.
continue;
case WellKnownMember.System_Array__Empty:
case WellKnownMember.System_ValueTuple_T1__Item1:
case WellKnownMember.System_ValueTuple_T2__Item1:
case WellKnownMember.System_ValueTuple_T2__Item2:
case WellKnownMember.System_ValueTuple_T3__Item1:
case WellKnownMember.System_ValueTuple_T3__Item2:
case WellKnownMember.System_ValueTuple_T3__Item3:
case WellKnownMember.System_ValueTuple_T4__Item1:
case WellKnownMember.System_ValueTuple_T4__Item2:
case WellKnownMember.System_ValueTuple_T4__Item3:
case WellKnownMember.System_ValueTuple_T4__Item4:
case WellKnownMember.System_ValueTuple_T5__Item1:
case WellKnownMember.System_ValueTuple_T5__Item2:
case WellKnownMember.System_ValueTuple_T5__Item3:
case WellKnownMember.System_ValueTuple_T5__Item4:
case WellKnownMember.System_ValueTuple_T5__Item5:
case WellKnownMember.System_ValueTuple_T6__Item1:
case WellKnownMember.System_ValueTuple_T6__Item2:
case WellKnownMember.System_ValueTuple_T6__Item3:
case WellKnownMember.System_ValueTuple_T6__Item4:
case WellKnownMember.System_ValueTuple_T6__Item5:
case WellKnownMember.System_ValueTuple_T6__Item6:
case WellKnownMember.System_ValueTuple_T7__Item1:
case WellKnownMember.System_ValueTuple_T7__Item2:
case WellKnownMember.System_ValueTuple_T7__Item3:
case WellKnownMember.System_ValueTuple_T7__Item4:
case WellKnownMember.System_ValueTuple_T7__Item5:
case WellKnownMember.System_ValueTuple_T7__Item6:
case WellKnownMember.System_ValueTuple_T7__Item7:
case WellKnownMember.System_ValueTuple_TRest__Item1:
case WellKnownMember.System_ValueTuple_TRest__Item2:
case WellKnownMember.System_ValueTuple_TRest__Item3:
case WellKnownMember.System_ValueTuple_TRest__Item4:
case WellKnownMember.System_ValueTuple_TRest__Item5:
case WellKnownMember.System_ValueTuple_TRest__Item6:
case WellKnownMember.System_ValueTuple_TRest__Item7:
case WellKnownMember.System_ValueTuple_TRest__Rest:
case WellKnownMember.System_ValueTuple_T1__ctor:
case WellKnownMember.System_ValueTuple_T2__ctor:
case WellKnownMember.System_ValueTuple_T3__ctor:
case WellKnownMember.System_ValueTuple_T4__ctor:
case WellKnownMember.System_ValueTuple_T5__ctor:
case WellKnownMember.System_ValueTuple_T6__ctor:
case WellKnownMember.System_ValueTuple_T7__ctor:
case WellKnownMember.System_ValueTuple_TRest__ctor:
// PROTOTYPE(tuples): tuples
// Not yet in the platform.
// Not yet in the platform.
continue;
}
if (wkm == WellKnownMember.Count) continue; // Not a real value.
......
......@@ -137,6 +137,7 @@
<Content Include="NetFX\Minimal\Key.snk" />
<Content Include="NetFX\Minimal\minasync.cs" />
<Content Include="NetFX\Minimal\mincorlib.cs" />
<EmbeddedResource Include="NetFX\ValueTuple\System.ValueTuple.dll" />
<Content Include="SymbolsTests\NoPia\ParametersWithoutNames.cs" />
<EmbeddedResource Include="PerfTests\CSPerfTest.cs" />
<Content Include="Resources\License.txt" />
......
......@@ -166,6 +166,12 @@ public static class Minimal
private static byte[] s_minasync;
public static byte[] minasync => ResourceLoader.GetOrCreateResource(ref s_minasync, "NetFX.Minimal.minasync.dll");
}
public static class ValueTuple
{
private static byte[] s_tuplelib;
public static byte[] tuplelib => ResourceLoader.GetOrCreateResource(ref s_tuplelib, "NetFX.ValueTuple.System.ValueTuple.dll");
}
}
namespace TestResources
......
......@@ -489,7 +489,8 @@ End Namespace
CSharpRef,
SystemXmlRef,
SystemXmlLinqRef,
SystemWindowsFormsRef
SystemWindowsFormsRef,
ValueTupleRef
}.Concat(WinRtRefs).ToArray()
Dim comp = CreateCompilationWithReferences((<compilation/>), refs.Concat(MsvbRef_v4_0_30319_17929).ToArray())
......@@ -499,15 +500,7 @@ End Namespace
' Only present when embedding VB Core.
Continue For
Case WellKnownType.System_FormattableString,
WellKnownType.System_Runtime_CompilerServices_FormattableStringFactory,
WellKnownType.System_ValueTuple_T1,
WellKnownType.System_ValueTuple_T2,
WellKnownType.System_ValueTuple_T3,
WellKnownType.System_ValueTuple_T4,
WellKnownType.System_ValueTuple_T5,
WellKnownType.System_ValueTuple_T6,
WellKnownType.System_ValueTuple_T7,
WellKnownType.System_ValueTuple_TRest ' PROTOTYPE(tuples)
WellKnownType.System_Runtime_CompilerServices_FormattableStringFactory
' Not available on all platforms.
Continue For
Case WellKnownType.ExtSentinel
......@@ -539,15 +532,7 @@ End Namespace
' Not embedded, so not available.
Continue For
Case WellKnownType.System_FormattableString,
WellKnownType.System_Runtime_CompilerServices_FormattableStringFactory,
WellKnownType.System_ValueTuple_T1,
WellKnownType.System_ValueTuple_T2,
WellKnownType.System_ValueTuple_T3,
WellKnownType.System_ValueTuple_T4,
WellKnownType.System_ValueTuple_T5,
WellKnownType.System_ValueTuple_T6,
WellKnownType.System_ValueTuple_T7,
WellKnownType.System_ValueTuple_TRest ' PROTOTYPE(tuples)
WellKnownType.System_Runtime_CompilerServices_FormattableStringFactory
' Not available on all platforms.
Continue For
Case WellKnownType.ExtSentinel
......@@ -572,7 +557,8 @@ End Namespace
CSharpRef,
SystemXmlRef,
SystemXmlLinqRef,
SystemWindowsFormsRef
SystemWindowsFormsRef,
ValueTupleRef
}.Concat(WinRtRefs).ToArray()
Dim comp = CreateCompilationWithReferences((<compilation/>), refs.Concat(MsvbRef_v4_0_30319_17929).ToArray())
......@@ -584,53 +570,7 @@ End Namespace
Case WellKnownMember.Count
' Not a real value.
Continue For
Case WellKnownMember.System_Array__Empty,
WellKnownMember.System_ValueTuple_T1__Item1,
WellKnownMember.System_ValueTuple_T2__Item1,
WellKnownMember.System_ValueTuple_T2__Item2,
WellKnownMember.System_ValueTuple_T3__Item1,
WellKnownMember.System_ValueTuple_T3__Item2,
WellKnownMember.System_ValueTuple_T3__Item3,
WellKnownMember.System_ValueTuple_T4__Item1,
WellKnownMember.System_ValueTuple_T4__Item2,
WellKnownMember.System_ValueTuple_T4__Item3,
WellKnownMember.System_ValueTuple_T4__Item4,
WellKnownMember.System_ValueTuple_T5__Item1,
WellKnownMember.System_ValueTuple_T5__Item2,
WellKnownMember.System_ValueTuple_T5__Item3,
WellKnownMember.System_ValueTuple_T5__Item4,
WellKnownMember.System_ValueTuple_T5__Item5,
WellKnownMember.System_ValueTuple_T6__Item1,
WellKnownMember.System_ValueTuple_T6__Item2,
WellKnownMember.System_ValueTuple_T6__Item3,
WellKnownMember.System_ValueTuple_T6__Item4,
WellKnownMember.System_ValueTuple_T6__Item5,
WellKnownMember.System_ValueTuple_T6__Item6,
WellKnownMember.System_ValueTuple_T7__Item1,
WellKnownMember.System_ValueTuple_T7__Item2,
WellKnownMember.System_ValueTuple_T7__Item3,
WellKnownMember.System_ValueTuple_T7__Item4,
WellKnownMember.System_ValueTuple_T7__Item5,
WellKnownMember.System_ValueTuple_T7__Item6,
WellKnownMember.System_ValueTuple_T7__Item7,
WellKnownMember.System_ValueTuple_TRest__Item1,
WellKnownMember.System_ValueTuple_TRest__Item2,
WellKnownMember.System_ValueTuple_TRest__Item3,
WellKnownMember.System_ValueTuple_TRest__Item4,
WellKnownMember.System_ValueTuple_TRest__Item5,
WellKnownMember.System_ValueTuple_TRest__Item6,
WellKnownMember.System_ValueTuple_TRest__Item7,
WellKnownMember.System_ValueTuple_TRest__Rest,
WellKnownMember.System_ValueTuple_T1__ctor,
WellKnownMember.System_ValueTuple_T2__ctor,
WellKnownMember.System_ValueTuple_T3__ctor,
WellKnownMember.System_ValueTuple_T4__ctor,
WellKnownMember.System_ValueTuple_T5__ctor,
WellKnownMember.System_ValueTuple_T6__ctor,
WellKnownMember.System_ValueTuple_T7__ctor,
WellKnownMember.System_ValueTuple_TRest__ctor
' PROTOTYPE(tuples)
Case WellKnownMember.System_Array__Empty
' Not available yet, but will be in upcoming release.
Continue For
End Select
......@@ -707,53 +647,7 @@ End Namespace
WellKnownMember.Microsoft_VisualBasic_Interaction__CallByName
' The type is not embedded, so the member is not available.
Continue For
Case WellKnownMember.System_Array__Empty,
WellKnownMember.System_ValueTuple_T1__Item1,
WellKnownMember.System_ValueTuple_T2__Item1,
WellKnownMember.System_ValueTuple_T2__Item2,
WellKnownMember.System_ValueTuple_T3__Item1,
WellKnownMember.System_ValueTuple_T3__Item2,
WellKnownMember.System_ValueTuple_T3__Item3,
WellKnownMember.System_ValueTuple_T4__Item1,
WellKnownMember.System_ValueTuple_T4__Item2,
WellKnownMember.System_ValueTuple_T4__Item3,
WellKnownMember.System_ValueTuple_T4__Item4,
WellKnownMember.System_ValueTuple_T5__Item1,
WellKnownMember.System_ValueTuple_T5__Item2,
WellKnownMember.System_ValueTuple_T5__Item3,
WellKnownMember.System_ValueTuple_T5__Item4,
WellKnownMember.System_ValueTuple_T5__Item5,
WellKnownMember.System_ValueTuple_T6__Item1,
WellKnownMember.System_ValueTuple_T6__Item2,
WellKnownMember.System_ValueTuple_T6__Item3,
WellKnownMember.System_ValueTuple_T6__Item4,
WellKnownMember.System_ValueTuple_T6__Item5,
WellKnownMember.System_ValueTuple_T6__Item6,
WellKnownMember.System_ValueTuple_T7__Item1,
WellKnownMember.System_ValueTuple_T7__Item2,
WellKnownMember.System_ValueTuple_T7__Item3,
WellKnownMember.System_ValueTuple_T7__Item4,
WellKnownMember.System_ValueTuple_T7__Item5,
WellKnownMember.System_ValueTuple_T7__Item6,
WellKnownMember.System_ValueTuple_T7__Item7,
WellKnownMember.System_ValueTuple_TRest__Item1,
WellKnownMember.System_ValueTuple_TRest__Item2,
WellKnownMember.System_ValueTuple_TRest__Item3,
WellKnownMember.System_ValueTuple_TRest__Item4,
WellKnownMember.System_ValueTuple_TRest__Item5,
WellKnownMember.System_ValueTuple_TRest__Item6,
WellKnownMember.System_ValueTuple_TRest__Item7,
WellKnownMember.System_ValueTuple_TRest__Rest,
WellKnownMember.System_ValueTuple_T1__ctor,
WellKnownMember.System_ValueTuple_T2__ctor,
WellKnownMember.System_ValueTuple_T3__ctor,
WellKnownMember.System_ValueTuple_T4__ctor,
WellKnownMember.System_ValueTuple_T5__ctor,
WellKnownMember.System_ValueTuple_T6__ctor,
WellKnownMember.System_ValueTuple_T7__ctor,
WellKnownMember.System_ValueTuple_TRest__ctor
' PROTOTYPE(tuples)
Case WellKnownMember.System_Array__Empty
' Not available yet, but will be in upcoming release.
Continue For
End Select
......
......@@ -172,6 +172,23 @@ public static PortableExecutableReference minasync
}
}
public static class ValueTuple
{
private static PortableExecutableReference s_tuplelib;
public static PortableExecutableReference tuplelib
{
get
{
if (s_tuplelib == null)
{
s_tuplelib = AssemblyMetadata.CreateFromImage(TestResources.NetFX.ValueTuple.tuplelib).GetReference(display: "System.ValueTuple.dll");
}
return s_tuplelib;
}
}
}
public static class silverlight_v5_0_5_0
{
private static PortableExecutableReference s_system;
......
......@@ -325,6 +325,8 @@ public static MetadataReference MscorlibRefSilverlight
public static MetadataReference MinCorlibRef => TestReferences.NetFx.Minimal.mincorlib;
public static MetadataReference ValueTupleRef => TestReferences.NetFx.ValueTuple.tuplelib;
private static MetadataReference s_msvbRef;
public static MetadataReference MsvbRef
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册