From 9b8bbe1ad94acaf721aa66db3302ad96c35aea57 Mon Sep 17 00:00:00 2001 From: Julien Couvreur Date: Thu, 2 Feb 2017 10:20:20 -0800 Subject: [PATCH] Make ValueTuple types serializable (dotnet/coreclr#9271) Commit migrated from https://github.com/dotnet/coreclr/commit/875b7487efcfe0a0b148ad01f33505e065f5a5af --- src/coreclr/src/mscorlib/src/System/ValueTuple.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/coreclr/src/mscorlib/src/System/ValueTuple.cs b/src/coreclr/src/mscorlib/src/System/ValueTuple.cs index 8476122..0f0863a 100644 --- a/src/coreclr/src/mscorlib/src/System/ValueTuple.cs +++ b/src/coreclr/src/mscorlib/src/System/ValueTuple.cs @@ -28,6 +28,7 @@ namespace System /// - they are mutable rather than readonly, and /// - their members (such as Item1, Item2, etc) are fields rather than properties. /// + [Serializable] public struct ValueTuple : IEquatable, IStructuralEquatable, IStructuralComparable, IComparable, IComparable, IValueTupleInternal, ITuple { @@ -296,6 +297,7 @@ namespace System /// Represents a 1-tuple, or singleton, as a value type. /// The type of the tuple's only component. + [Serializable] public struct ValueTuple : IEquatable>, IStructuralEquatable, IStructuralComparable, IComparable, IComparable>, IValueTupleInternal, ITuple { @@ -460,6 +462,7 @@ namespace System /// /// The type of the tuple's first component. /// The type of the tuple's second component. + [Serializable] [StructLayout(LayoutKind.Auto)] public struct ValueTuple : IEquatable>, IStructuralEquatable, IStructuralComparable, IComparable, IComparable>, IValueTupleInternal, ITuple @@ -669,6 +672,7 @@ namespace System /// The type of the tuple's first component. /// The type of the tuple's second component. /// The type of the tuple's third component. + [Serializable] [StructLayout(LayoutKind.Auto)] public struct ValueTuple : IEquatable>, IStructuralEquatable, IStructuralComparable, IComparable, IComparable>, IValueTupleInternal, ITuple @@ -876,6 +880,7 @@ namespace System /// The type of the tuple's second component. /// The type of the tuple's third component. /// The type of the tuple's fourth component. + [Serializable] [StructLayout(LayoutKind.Auto)] public struct ValueTuple : IEquatable>, IStructuralEquatable, IStructuralComparable, IComparable, IComparable>, IValueTupleInternal, ITuple @@ -1102,6 +1107,7 @@ namespace System /// The type of the tuple's third component. /// The type of the tuple's fourth component. /// The type of the tuple's fifth component. + [Serializable] [StructLayout(LayoutKind.Auto)] public struct ValueTuple : IEquatable>, IStructuralEquatable, IStructuralComparable, IComparable, IComparable>, IValueTupleInternal, ITuple @@ -1347,6 +1353,7 @@ namespace System /// The type of the tuple's fourth component. /// The type of the tuple's fifth component. /// The type of the tuple's sixth component. + [Serializable] [StructLayout(LayoutKind.Auto)] public struct ValueTuple : IEquatable>, IStructuralEquatable, IStructuralComparable, IComparable, IComparable>, IValueTupleInternal, ITuple @@ -1611,6 +1618,7 @@ namespace System /// The type of the tuple's fifth component. /// The type of the tuple's sixth component. /// The type of the tuple's seventh component. + [Serializable] [StructLayout(LayoutKind.Auto)] public struct ValueTuple : IEquatable>, IStructuralEquatable, IStructuralComparable, IComparable, IComparable>, IValueTupleInternal, ITuple @@ -1894,6 +1902,7 @@ namespace System /// The type of the tuple's sixth component. /// The type of the tuple's seventh component. /// The type of the tuple's eighth component. + [Serializable] [StructLayout(LayoutKind.Auto)] public struct ValueTuple : IEquatable>, IStructuralEquatable, IStructuralComparable, IComparable, IComparable>, IValueTupleInternal, ITuple -- 2.7.4