X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fmcs%2Ftypemanager.cs;h=b6aff14e1c025195c5ec8425d623610361c19ae9;hb=c8df60885110b86fde2f5bb47e11cfa36e1da750;hp=b53915f6eb1c030c749d98c239553e8a7c46c76d;hpb=883a0ae745bf33b35d44bb730d5714936a2141f7;p=mono.git diff --git a/mcs/mcs/typemanager.cs b/mcs/mcs/typemanager.cs index b53915f6eb1..b6aff14e1c0 100644 --- a/mcs/mcs/typemanager.cs +++ b/mcs/mcs/typemanager.cs @@ -240,6 +240,9 @@ namespace Mono.CSharp public readonly PredefinedType FormattableString; public readonly PredefinedType FormattableStringFactory; + // C# 7.0 + public readonly PredefinedType[] Tuples; + public PredefinedTypes (ModuleContainer module) { TypedReference = new PredefinedType (module, MemberKind.Struct, "System", "TypedReference"); @@ -337,6 +340,14 @@ namespace Mono.CSharp IFormattable.Define (); FormattableString.Define (); + + Tuples = new PredefinedType [8]; + for (int i = 0; i < Tuples.Length; i++) { + var pt = new PredefinedType (module, MemberKind.Struct, "System", "ValueTuple", i + 1); + Tuples [i] = pt; + if (pt.Define ()) + pt.TypeSpec.IsTupleType = true; + } } } @@ -403,6 +414,7 @@ namespace Mono.CSharp public readonly PredefinedMember StructLayoutCharSet; public readonly PredefinedMember StructLayoutSize; public readonly PredefinedMember TypeGetTypeFromHandle; + public readonly PredefinedMember TupleElementNamesAttributeCtor; public PredefinedMembers (ModuleContainer module) { @@ -715,6 +727,10 @@ namespace Mono.CSharp MemberFilter.Field ("Size", btypes.Int)); TypeGetTypeFromHandle = new PredefinedMember (module, btypes.Type, "GetTypeFromHandle", btypes.RuntimeTypeHandle); + + TupleElementNamesAttributeCtor = new PredefinedMember (module, atypes.TupleElementNames, + MemberFilter.Constructor (ParametersCompiled.CreateFullyResolved ( + ArrayContainer.MakeType (module, btypes.String)))); } }