From 0026135ebac13b12f798910ee7caa71767a91140 Mon Sep 17 00:00:00 2001 From: Santiago Fernandez Madero Date: Thu, 16 May 2019 13:44:33 -0700 Subject: [PATCH 1/2] Generate System.Runtime ref assembly against implementation --- .../ref/System.Runtime.Manual.cs | 32 ++-- src/System.Runtime/ref/System.Runtime.cs | 149 +++++++++--------- .../src/MatchingRefApiCompatBaseline.txt | 11 -- 3 files changed, 99 insertions(+), 93 deletions(-) diff --git a/src/System.Runtime/ref/System.Runtime.Manual.cs b/src/System.Runtime/ref/System.Runtime.Manual.cs index b3ffb9338d29..d2cadb14eba2 100644 --- a/src/System.Runtime/ref/System.Runtime.Manual.cs +++ b/src/System.Runtime/ref/System.Runtime.Manual.cs @@ -7,15 +7,6 @@ namespace System { - public partial struct Single - { - public const float MinValue = (float)-3.40282346638528859e+38; - public const float Epsilon = (float)1.4e-45; - public const float MaxValue = (float)3.40282346638528859e+38; - public const float PositiveInfinity = (float)1.0 / (float)0.0; - public const float NegativeInfinity = (float)-1.0 / (float)0.0; - public const float NaN = (float)0.0 / (float)0.0; - } public partial struct Double { public const double MinValue = -1.7976931348623157E+308; @@ -28,4 +19,27 @@ public partial struct Double public const double PositiveInfinity = (double)1.0 / (double)(0.0); public const double NaN = (double)0.0 / (double)0.0; } + public partial struct Single + { + public const float MinValue = (float)-3.40282346638528859e+38; + public const float Epsilon = (float)1.4e-45; + public const float MaxValue = (float)3.40282346638528859e+38; + public const float PositiveInfinity = (float)1.0 / (float)0.0; + public const float NegativeInfinity = (float)-1.0 / (float)0.0; + public const float NaN = (float)0.0 / (float)0.0; + } + public ref partial struct TypedReference + { + // We need to add this into the manual ref assembly to preserve it because the + // implementation doesn't have any reference field, hence GenApi will not emit it. + private object _dummy; + private int _dummyPrimitive; + } +} +namespace System.Reflection +{ + public partial class TypeDelegator + { + public override bool IsVariableBoundArray { get { throw null; } } + } } diff --git a/src/System.Runtime/ref/System.Runtime.cs b/src/System.Runtime/ref/System.Runtime.cs index b26e5728d998..3e69ae9a07d4 100644 --- a/src/System.Runtime/ref/System.Runtime.cs +++ b/src/System.Runtime/ref/System.Runtime.cs @@ -1270,7 +1270,7 @@ public static void Collect(int generation, System.GCCollectionMode mode, bool bl public static int CollectionCount(int generation) { throw null; } public static void EndNoGCRegion() { } public static long GetAllocatedBytesForCurrentThread() { throw null; } - public static GCMemoryInfo GetGCMemoryInfo() { throw null; } + public static System.GCMemoryInfo GetGCMemoryInfo() { throw null; } public static int GetGeneration(object obj) { throw null; } public static int GetGeneration(System.WeakReference wo) { throw null; } public static long GetTotalAllocatedBytes(bool precise = false) { throw null; } @@ -1290,20 +1290,21 @@ public static void SuppressFinalize(object obj) { } public static System.GCNotificationStatus WaitForFullGCComplete(int millisecondsTimeout) { throw null; } public static void WaitForPendingFinalizers() { } } - public readonly struct GCMemoryInfo - { - public long HighMemoryLoadThresholdBytes { get { throw null; } } - public long MemoryLoadBytes { get { throw null; } } - public long TotalAvailableMemoryBytes { get { throw null; } } - public long HeapSizeBytes { get { throw null; } } - public long FragmentedBytes { get { throw null; } } - } public enum GCCollectionMode { Default = 0, Forced = 1, Optimized = 2, } + public readonly struct GCMemoryInfo + { + private readonly int _dummyPrimitive; + public long FragmentedBytes { get { throw null; } } + public long HeapSizeBytes { get { throw null; } } + public long HighMemoryLoadThresholdBytes { get { throw null; } } + public long MemoryLoadBytes { get { throw null; } } + public long TotalAvailableMemoryBytes { get { throw null; } } + } public enum GCNotificationStatus { Succeeded = 0, @@ -1734,7 +1735,7 @@ protected MemberAccessException(System.Runtime.Serialization.SerializationInfo i public MemberAccessException(string message) { } public MemberAccessException(string message, System.Exception inner) { } } - public readonly partial struct Memory : IEquatable> + public readonly partial struct Memory : System.IEquatable> { private readonly object _dummy; private readonly int _dummyPrimitive; @@ -2002,7 +2003,7 @@ protected RankException(System.Runtime.Serialization.SerializationInfo info, Sys public RankException(string message) { } public RankException(string message, System.Exception innerException) { } } - public readonly partial struct ReadOnlyMemory : IEquatable> + public readonly partial struct ReadOnlyMemory : System.IEquatable> { private readonly object _dummy; private readonly int _dummyPrimitive; @@ -2744,47 +2745,47 @@ public static partial class TupleExtensions [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static void Deconstruct(this System.Tuple> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9) { throw null; } public static System.Tuple ToTuple(this System.ValueTuple value) { throw null; } - public static System.Tuple> ToTuple(this System.ValueTuple> value) { throw null; } - public static System.Tuple> ToTuple(this System.ValueTuple> value) { throw null; } - public static System.Tuple> ToTuple(this System.ValueTuple> value) { throw null; } - public static System.Tuple> ToTuple(this System.ValueTuple> value) { throw null; } - public static System.Tuple> ToTuple(this System.ValueTuple> value) { throw null; } - public static System.Tuple>> ToTuple(this System.ValueTuple>> value) { throw null; } - public static System.Tuple>> ToTuple(this System.ValueTuple>> value) { throw null; } - public static System.Tuple>> ToTuple(this System.ValueTuple>> value) { throw null; } - public static System.Tuple>> ToTuple(this System.ValueTuple>> value) { throw null; } - public static System.Tuple>> ToTuple(this System.ValueTuple>> value) { throw null; } - public static System.Tuple ToTuple(this System.ValueTuple value) { throw null; } - public static System.Tuple>> ToTuple(this System.ValueTuple>> value) { throw null; } - public static System.Tuple>> ToTuple(this System.ValueTuple>> value) { throw null; } - public static System.Tuple ToTuple(this System.ValueTuple value) { throw null; } - public static System.Tuple ToTuple(this System.ValueTuple value) { throw null; } - public static System.Tuple ToTuple(this System.ValueTuple value) { throw null; } - public static System.Tuple ToTuple(this System.ValueTuple value) { throw null; } - public static System.Tuple ToTuple(this System.ValueTuple value) { throw null; } - public static System.Tuple> ToTuple(this System.ValueTuple> value) { throw null; } - public static System.Tuple> ToTuple(this System.ValueTuple> value) { throw null; } + public static System.Tuple> ToTuple(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) value) { throw null; } + public static System.Tuple> ToTuple(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) value) { throw null; } + public static System.Tuple> ToTuple(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12) value) { throw null; } + public static System.Tuple> ToTuple(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13) value) { throw null; } + public static System.Tuple> ToTuple(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14) value) { throw null; } + public static System.Tuple>> ToTuple(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15) value) { throw null; } + public static System.Tuple>> ToTuple(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16) value) { throw null; } + public static System.Tuple>> ToTuple(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17) value) { throw null; } + public static System.Tuple>> ToTuple(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18) value) { throw null; } + public static System.Tuple>> ToTuple(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19) value) { throw null; } + public static System.Tuple ToTuple(this (T1, T2) value) { throw null; } + public static System.Tuple>> ToTuple(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20) value) { throw null; } + public static System.Tuple>> ToTuple(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21) value) { throw null; } + public static System.Tuple ToTuple(this (T1, T2, T3) value) { throw null; } + public static System.Tuple ToTuple(this (T1, T2, T3, T4) value) { throw null; } + public static System.Tuple ToTuple(this (T1, T2, T3, T4, T5) value) { throw null; } + public static System.Tuple ToTuple(this (T1, T2, T3, T4, T5, T6) value) { throw null; } + public static System.Tuple ToTuple(this (T1, T2, T3, T4, T5, T6, T7) value) { throw null; } + public static System.Tuple> ToTuple(this (T1, T2, T3, T4, T5, T6, T7, T8) value) { throw null; } + public static System.Tuple> ToTuple(this (T1, T2, T3, T4, T5, T6, T7, T8, T9) value) { throw null; } public static System.ValueTuple ToValueTuple(this System.Tuple value) { throw null; } - public static System.ValueTuple> ToValueTuple(this System.Tuple> value) { throw null; } - public static System.ValueTuple> ToValueTuple(this System.Tuple> value) { throw null; } - public static System.ValueTuple> ToValueTuple(this System.Tuple> value) { throw null; } - public static System.ValueTuple> ToValueTuple(this System.Tuple> value) { throw null; } - public static System.ValueTuple> ToValueTuple(this System.Tuple> value) { throw null; } - public static System.ValueTuple>> ToValueTuple(this System.Tuple>> value) { throw null; } - public static System.ValueTuple>> ToValueTuple(this System.Tuple>> value) { throw null; } - public static System.ValueTuple>> ToValueTuple(this System.Tuple>> value) { throw null; } - public static System.ValueTuple>> ToValueTuple(this System.Tuple>> value) { throw null; } - public static System.ValueTuple>> ToValueTuple(this System.Tuple>> value) { throw null; } - public static System.ValueTuple ToValueTuple(this System.Tuple value) { throw null; } - public static System.ValueTuple>> ToValueTuple(this System.Tuple>> value) { throw null; } - public static System.ValueTuple>> ToValueTuple(this System.Tuple>> value) { throw null; } - public static System.ValueTuple ToValueTuple(this System.Tuple value) { throw null; } - public static System.ValueTuple ToValueTuple(this System.Tuple value) { throw null; } - public static System.ValueTuple ToValueTuple(this System.Tuple value) { throw null; } - public static System.ValueTuple ToValueTuple(this System.Tuple value) { throw null; } - public static System.ValueTuple ToValueTuple(this System.Tuple value) { throw null; } - public static System.ValueTuple> ToValueTuple(this System.Tuple> value) { throw null; } - public static System.ValueTuple> ToValueTuple(this System.Tuple> value) { throw null; } + public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) ToValueTuple(this System.Tuple> value) { throw null; } + public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) ToValueTuple(this System.Tuple> value) { throw null; } + public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12) ToValueTuple(this System.Tuple> value) { throw null; } + public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13) ToValueTuple(this System.Tuple> value) { throw null; } + public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14) ToValueTuple(this System.Tuple> value) { throw null; } + public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15) ToValueTuple(this System.Tuple>> value) { throw null; } + public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16) ToValueTuple(this System.Tuple>> value) { throw null; } + public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17) ToValueTuple(this System.Tuple>> value) { throw null; } + public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18) ToValueTuple(this System.Tuple>> value) { throw null; } + public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19) ToValueTuple(this System.Tuple>> value) { throw null; } + public static (T1, T2) ToValueTuple(this System.Tuple value) { throw null; } + public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20) ToValueTuple(this System.Tuple>> value) { throw null; } + public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21) ToValueTuple(this System.Tuple>> value) { throw null; } + public static (T1, T2, T3) ToValueTuple(this System.Tuple value) { throw null; } + public static (T1, T2, T3, T4) ToValueTuple(this System.Tuple value) { throw null; } + public static (T1, T2, T3, T4, T5) ToValueTuple(this System.Tuple value) { throw null; } + public static (T1, T2, T3, T4, T5, T6) ToValueTuple(this System.Tuple value) { throw null; } + public static (T1, T2, T3, T4, T5, T6, T7) ToValueTuple(this System.Tuple value) { throw null; } + public static (T1, T2, T3, T4, T5, T6, T7, T8) ToValueTuple(this System.Tuple> value) { throw null; } + public static (T1, T2, T3, T4, T5, T6, T7, T8, T9) ToValueTuple(this System.Tuple> value) { throw null; } } public partial class Tuple : System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.IComparable, System.Runtime.CompilerServices.ITuple { @@ -3150,8 +3151,6 @@ public enum TypeCode [System.CLSCompliantAttribute(false)] public ref partial struct TypedReference { - private object _dummy; - private int _dummyPrimitive; public override bool Equals(object o) { throw null; } public override int GetHashCode() { throw null; } public static System.Type GetTargetType(System.TypedReference value) { throw null; } @@ -3556,7 +3555,7 @@ public partial struct ValueTuple : System.Collections.IStructuralComparable, Sys public static (T1, T2, T3, T4, T5) Create(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5) { throw null; } public static (T1, T2, T3, T4, T5, T6) Create(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6) { throw null; } public static (T1, T2, T3, T4, T5, T6, T7) Create(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7) { throw null; } - public static System.ValueTuple> Create(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8) { throw null; } + public static (T1, T2, T3, T4, T5, T6, T7, T8) Create(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8) { throw null; } public override bool Equals(object obj) { throw null; } public bool Equals(System.ValueTuple other) { throw null; } public override int GetHashCode() { throw null; } @@ -3935,7 +3934,7 @@ public partial interface IComparer { int Compare(T x, T y); } - public partial interface IDictionary : System.Collections.Generic.ICollection>, System.Collections.Generic.IEnumerable>, System.Collections.IEnumerable + public partial interface IDictionary : System.Collections.Generic.ICollection>, System.Collections.Generic.IEnumerable>, System.Collections.IEnumerable where TKey : object { TValue this[TKey key] { get; set; } System.Collections.Generic.ICollection Keys { get; } @@ -3969,7 +3968,7 @@ public partial interface IReadOnlyCollection : System.Collections.Generic { int Count { get; } } - public partial interface IReadOnlyDictionary : System.Collections.Generic.IEnumerable>, System.Collections.Generic.IReadOnlyCollection>, System.Collections.IEnumerable + public partial interface IReadOnlyDictionary : System.Collections.Generic.IEnumerable>, System.Collections.Generic.IReadOnlyCollection>, System.Collections.IEnumerable where TKey : object { TValue this[TKey key] { get; } System.Collections.Generic.IEnumerable Keys { get; } @@ -4045,8 +4044,8 @@ public void CopyTo(T[] array, int index) { } public void Insert(int index, T item) { } protected virtual void InsertItem(int index, T item) { } protected virtual void InsertItemsRange(int index, System.Collections.Generic.IEnumerable collection) { } - public void InsertRange(int index, System.Collections.Generic.IEnumerable collection) { } - public bool Remove(T item) { throw null; } + public void InsertRange(int index, System.Collections.Generic.IEnumerable collection) { } + public bool Remove(T item) { throw null; } public void RemoveAt(int index) { } protected virtual void RemoveItem(int index) { } protected virtual void RemoveItemsRange(int index, int count) { } @@ -5162,7 +5161,6 @@ public FileStream(string path, System.IO.FileMode mode, System.IO.FileAccess acc public override bool CanRead { get { throw null; } } public override bool CanSeek { get { throw null; } } public override bool CanWrite { get { throw null; } } - public override System.Threading.Tasks.Task CopyToAsync(System.IO.Stream destination, int bufferSize, System.Threading.CancellationToken cancellationToken) { throw null; } [System.ObsoleteAttribute("This property has been deprecated. Please use FileStream's SafeFileHandle property instead. https://go.microsoft.com/fwlink/?linkid=14202")] public virtual System.IntPtr Handle { get { throw null; } } public virtual bool IsAsync { get { throw null; } } @@ -5172,6 +5170,7 @@ public FileStream(string path, System.IO.FileMode mode, System.IO.FileAccess acc public virtual Microsoft.Win32.SafeHandles.SafeFileHandle SafeFileHandle { get { throw null; } } public override System.IAsyncResult BeginRead(byte[] array, int offset, int numBytes, System.AsyncCallback callback, object state) { throw null; } public override System.IAsyncResult BeginWrite(byte[] array, int offset, int numBytes, System.AsyncCallback callback, object state) { throw null; } + public override System.Threading.Tasks.Task CopyToAsync(System.IO.Stream destination, int bufferSize, System.Threading.CancellationToken cancellationToken) { throw null; } protected override void Dispose(bool disposing) { } public override System.Threading.Tasks.ValueTask DisposeAsync() { throw null; } public override int EndRead(System.IAsyncResult asyncResult) { throw null; } @@ -5645,9 +5644,9 @@ protected CustomAttributeFormatException(System.Runtime.Serialization.Serializat public CustomAttributeFormatException(string message) { } public CustomAttributeFormatException(string message, System.Exception inner) { } } - public partial struct CustomAttributeNamedArgument + public readonly partial struct CustomAttributeNamedArgument { - private object _dummy; + private readonly object _dummy; public CustomAttributeNamedArgument(System.Reflection.MemberInfo memberInfo, object value) { throw null; } public CustomAttributeNamedArgument(System.Reflection.MemberInfo memberInfo, System.Reflection.CustomAttributeTypedArgument typedArgument) { throw null; } public bool IsField { get { throw null; } } @@ -5660,9 +5659,9 @@ public partial struct CustomAttributeNamedArgument public static bool operator !=(System.Reflection.CustomAttributeNamedArgument left, System.Reflection.CustomAttributeNamedArgument right) { throw null; } public override string ToString() { throw null; } } - public partial struct CustomAttributeTypedArgument + public readonly partial struct CustomAttributeTypedArgument { - private object _dummy; + private readonly object _dummy; public CustomAttributeTypedArgument(object value) { throw null; } public CustomAttributeTypedArgument(System.Type argumentType, object value) { throw null; } public System.Type ArgumentType { get { throw null; } } @@ -6237,8 +6236,10 @@ public sealed partial class ReflectionTypeLoadException : System.SystemException public ReflectionTypeLoadException(System.Type[] classes, System.Exception[] exceptions) { } public ReflectionTypeLoadException(System.Type[] classes, System.Exception[] exceptions, string message) { } public System.Exception[] LoaderExceptions { get { throw null; } } + public override string Message { get { throw null; } } public System.Type[] Types { get { throw null; } } public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } + public override string ToString() { throw null; } } [System.FlagsAttribute] public enum ResourceAttributes @@ -6342,12 +6343,12 @@ public TypeDelegator(System.Type delegatingType) { } public override string FullName { get { throw null; } } public override System.Guid GUID { get { throw null; } } public override bool IsByRefLike { get { throw null; } } + public override bool IsCollectible { get { throw null; } } public override bool IsConstructedGenericType { get { throw null; } } public override bool IsGenericMethodParameter { get { throw null; } } public override bool IsGenericTypeParameter { get { throw null; } } public override bool IsSZArray { get { throw null; } } public override bool IsTypeDefinition { get { throw null; } } - public override bool IsVariableBoundArray { get { throw null; } } public override int MetadataToken { get { throw null; } } public override System.Reflection.Module Module { get { throw null; } } public override string Name { get { throw null; } } @@ -6557,11 +6558,10 @@ public ConditionalWeakTable() { } public void Add(TKey key, TValue value) { } public void AddOrUpdate(TKey key, TValue value) { } public void Clear() { } - ~ConditionalWeakTable() { } public TValue GetOrCreateValue(TKey key) { throw null; } public TValue GetValue(TKey key, System.Runtime.CompilerServices.ConditionalWeakTable.CreateValueCallback createValueCallback) { throw null; } public bool Remove(TKey key) { throw null; } - System.Collections.Generic.IEnumerator> System.Collections.Generic.IEnumerable>.GetEnumerator() { throw null; } + System.Collections.Generic.IEnumerator> System.Collections.Generic.IEnumerable>.GetEnumerator() { throw null; } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } public bool TryGetValue(TKey key, out TValue value) { throw null; } public delegate TValue CreateValueCallback(TKey key); @@ -6662,8 +6662,8 @@ public partial class DiscardableAttribute : System.Attribute { public DiscardableAttribute() { } } - [System.AttributeUsageAttribute(AttributeTargets.Parameter, Inherited = false)] - public sealed class EnumeratorCancellationAttribute : Attribute + [System.AttributeUsageAttribute(System.AttributeTargets.Parameter, Inherited=false)] + public sealed class EnumeratorCancellationAttribute : System.Attribute { public EnumeratorCancellationAttribute() { } } @@ -7110,8 +7110,8 @@ namespace System.Runtime.Serialization public sealed partial class DeserializationBlockedException : System.Exception { public DeserializationBlockedException() { } - public DeserializationBlockedException(String message) { } - public DeserializationBlockedException(Exception innerException) { } + public DeserializationBlockedException(System.Exception innerException) { } + public DeserializationBlockedException(string message) { } } public partial interface IDeserializationCallback { @@ -7369,6 +7369,7 @@ public sealed partial class SecurityTransparentAttribute : System.Attribute public SecurityTransparentAttribute() { } } [System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Field | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=false, Inherited=false)] + [System.ObsoleteAttribute("SecurityTreatAsSafe is only used for .NET 2.0 transparency compatibility. Please use the SecuritySafeCriticalAttribute instead.")] public sealed partial class SecurityTreatAsSafeAttribute : System.Attribute { public SecurityTreatAsSafeAttribute() { } @@ -7732,8 +7733,8 @@ public enum NormalizationForm public override string ToString() { throw null; } public static System.Text.Rune ToUpper(System.Text.Rune value, System.Globalization.CultureInfo culture) { throw null; } public static System.Text.Rune ToUpperInvariant(System.Text.Rune value) { throw null; } - public static bool TryCreate(char ch, out System.Text.Rune result) { throw null; } public static bool TryCreate(char highSurrogate, char lowSurrogate, out System.Text.Rune result) { throw null; } + public static bool TryCreate(char ch, out System.Text.Rune result) { throw null; } public static bool TryCreate(int value, out System.Text.Rune result) { throw null; } [System.CLSCompliantAttribute(false)] public static bool TryCreate(uint value, out System.Text.Rune result) { throw null; } @@ -7839,7 +7840,9 @@ void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Ser public string ToString(int startIndex, int length) { throw null; } public partial struct ChunkEnumerator { + private object _dummy; public System.ReadOnlyMemory Current { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public System.Text.StringBuilder.ChunkEnumerator GetEnumerator() { throw null; } public bool MoveNext() { throw null; } } @@ -7862,8 +7865,8 @@ namespace System.Text.Unicode { public static partial class Utf8 { - public static System.Buffers.OperationStatus FromUtf16(ReadOnlySpan source, Span destination, out int charsRead, out int bytesWritten, bool replaceInvalidSequences = true, bool isFinalBlock = true) { throw null; } - public static System.Buffers.OperationStatus ToUtf16(ReadOnlySpan source, Span destination, out int bytesRead, out int charsWritten, bool replaceInvalidSequences = true, bool isFinalBlock = true) { throw null; } + public static System.Buffers.OperationStatus FromUtf16(System.ReadOnlySpan source, System.Span destination, out int charsRead, out int bytesWritten, bool replaceInvalidSequences = true, bool isFinalBlock = true) { throw null; } + public static System.Buffers.OperationStatus ToUtf16(System.ReadOnlySpan source, System.Span destination, out int numBytesRead, out int numCharsWritten, bool replaceInvalidSequences = true, bool isFinalBlock = true) { throw null; } } } namespace System.Threading diff --git a/src/System.Runtime/src/MatchingRefApiCompatBaseline.txt b/src/System.Runtime/src/MatchingRefApiCompatBaseline.txt index c508ef05699e..aaec582797d6 100644 --- a/src/System.Runtime/src/MatchingRefApiCompatBaseline.txt +++ b/src/System.Runtime/src/MatchingRefApiCompatBaseline.txt @@ -7,17 +7,6 @@ MembersMustExist : Member 'System.AppContext.remove_ProcessExit(System.EventHand MembersMustExist : Member 'System.AppContext.remove_UnhandledException(System.UnhandledExceptionEventHandler)' does not exist in the reference but it does exist in the implementation. MembersMustExist : Member 'System.AppContext.SetData(System.String, System.Object)' does not exist in the reference but it does exist in the implementation. MembersMustExist : Member 'System.WeakReference..ctor()' does not exist in the reference but it does exist in the implementation. -MembersMustExist : Member 'System.Collections.ObjectModel.Collection.AddRange(System.Collections.Generic.IEnumerable)' does not exist in the reference but it does exist in the implementation. -MembersMustExist : Member 'System.Collections.ObjectModel.Collection.InsertItemsRange(System.Int32, System.Collections.Generic.IEnumerable)' does not exist in the reference but it does exist in the implementation. -MembersMustExist : Member 'System.Collections.ObjectModel.Collection.InsertRange(System.Int32, System.Collections.Generic.IEnumerable)' does not exist in the reference but it does exist in the implementation. -MembersMustExist : Member 'System.Collections.ObjectModel.Collection.RemoveItemsRange(System.Int32, System.Int32)' does not exist in the reference but it does exist in the implementation. -MembersMustExist : Member 'System.Collections.ObjectModel.Collection.RemoveRange(System.Int32, System.Int32)' does not exist in the reference but it does exist in the implementation. -MembersMustExist : Member 'System.Collections.ObjectModel.Collection.ReplaceItemsRange(System.Int32, System.Int32, System.Collections.Generic.IEnumerable)' does not exist in the reference but it does exist in the implementation. -MembersMustExist : Member 'System.Collections.ObjectModel.Collection.ReplaceRange(System.Int32, System.Int32, System.Collections.Generic.IEnumerable)' does not exist in the reference but it does exist in the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Reflection.CustomAttributeNamedArgument' in the implementation but not the reference. -TypeCannotChangeClassification : Type 'System.Reflection.CustomAttributeNamedArgument' is marked as readonly in the implementation so it must also be marked readonly in the reference. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Reflection.CustomAttributeTypedArgument' in the implementation but not the reference. -TypeCannotChangeClassification : Type 'System.Reflection.CustomAttributeTypedArgument' is marked as readonly in the implementation so it must also be marked readonly in the reference. MembersMustExist : Member 'System.Reflection.Module.GetModuleHandleImpl()' does not exist in the reference but it does exist in the implementation. CannotRemoveBaseTypeOrInterface : Type 'System.Runtime.Serialization.DeserializationBlockedException' does not inherit from base type 'System.Runtime.Serialization.SerializationException' in the reference but it does in the implementation. MembersMustExist : Member 'System.Runtime.Serialization.SerializationInfo.DeserializationInProgress.get()' does not exist in the reference but it does exist in the implementation. From 632602842631f520be538c9fe81cc85ce47ef2cd Mon Sep 17 00:00:00 2001 From: Santiago Fernandez Madero Date: Fri, 17 May 2019 09:57:57 -0700 Subject: [PATCH 2/2] PR Feedback and baseline uapaot errors --- .../src/ApiCompatBaseline.uapaot.txt | 6 +++++ .../src/MatchingRefApiCompatBaseline.txt | 6 +---- .../ref/System.Runtime.Manual.cs | 7 ------ src/System.Runtime/ref/System.Runtime.cs | 3 ++- .../src/ApiCompatBaseline.uapaot.txt | 24 +++++-------------- .../src/MatchingRefApiCompatBaseline.txt | 2 +- 6 files changed, 16 insertions(+), 32 deletions(-) create mode 100644 src/System.Reflection/src/ApiCompatBaseline.uapaot.txt diff --git a/src/System.Reflection/src/ApiCompatBaseline.uapaot.txt b/src/System.Reflection/src/ApiCompatBaseline.uapaot.txt new file mode 100644 index 000000000000..88a2b952cca4 --- /dev/null +++ b/src/System.Reflection/src/ApiCompatBaseline.uapaot.txt @@ -0,0 +1,6 @@ +Compat issues with assembly System.Reflection: +CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Reflection.CustomAttributeNamedArgument' in the contract but not the implementation. +TypeCannotChangeClassification : Type 'System.Reflection.CustomAttributeNamedArgument' is marked as readonly in the contract so it must also be marked readonly in the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Reflection.CustomAttributeTypedArgument' in the contract but not the implementation. +TypeCannotChangeClassification : Type 'System.Reflection.CustomAttributeTypedArgument' is marked as readonly in the contract so it must also be marked readonly in the implementation. +Total Issues: 4 diff --git a/src/System.Reflection/src/MatchingRefApiCompatBaseline.txt b/src/System.Reflection/src/MatchingRefApiCompatBaseline.txt index 30d13ded3202..98555eff228f 100644 --- a/src/System.Reflection/src/MatchingRefApiCompatBaseline.txt +++ b/src/System.Reflection/src/MatchingRefApiCompatBaseline.txt @@ -1,7 +1,3 @@ Compat issues with assembly System.Reflection: -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Reflection.CustomAttributeNamedArgument' in the implementation but not the reference. -TypeCannotChangeClassification : Type 'System.Reflection.CustomAttributeNamedArgument' is marked as readonly in the implementation so it must also be marked readonly in the reference. -CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Reflection.CustomAttributeTypedArgument' in the implementation but not the reference. -TypeCannotChangeClassification : Type 'System.Reflection.CustomAttributeTypedArgument' is marked as readonly in the implementation so it must also be marked readonly in the reference. MembersMustExist : Member 'System.Reflection.Module.GetModuleHandleImpl()' does not exist in the reference but it does exist in the implementation. -Total Issues: 5 +Total Issues: 1 diff --git a/src/System.Runtime/ref/System.Runtime.Manual.cs b/src/System.Runtime/ref/System.Runtime.Manual.cs index d2cadb14eba2..2aa2d8e9e2c0 100644 --- a/src/System.Runtime/ref/System.Runtime.Manual.cs +++ b/src/System.Runtime/ref/System.Runtime.Manual.cs @@ -36,10 +36,3 @@ public ref partial struct TypedReference private int _dummyPrimitive; } } -namespace System.Reflection -{ - public partial class TypeDelegator - { - public override bool IsVariableBoundArray { get { throw null; } } - } -} diff --git a/src/System.Runtime/ref/System.Runtime.cs b/src/System.Runtime/ref/System.Runtime.cs index 3e69ae9a07d4..532875243950 100644 --- a/src/System.Runtime/ref/System.Runtime.cs +++ b/src/System.Runtime/ref/System.Runtime.cs @@ -6349,6 +6349,7 @@ public TypeDelegator(System.Type delegatingType) { } public override bool IsGenericTypeParameter { get { throw null; } } public override bool IsSZArray { get { throw null; } } public override bool IsTypeDefinition { get { throw null; } } + public override bool IsVariableBoundArray { get { throw null; } } public override int MetadataToken { get { throw null; } } public override System.Reflection.Module Module { get { throw null; } } public override string Name { get { throw null; } } @@ -7866,7 +7867,7 @@ namespace System.Text.Unicode public static partial class Utf8 { public static System.Buffers.OperationStatus FromUtf16(System.ReadOnlySpan source, System.Span destination, out int charsRead, out int bytesWritten, bool replaceInvalidSequences = true, bool isFinalBlock = true) { throw null; } - public static System.Buffers.OperationStatus ToUtf16(System.ReadOnlySpan source, System.Span destination, out int numBytesRead, out int numCharsWritten, bool replaceInvalidSequences = true, bool isFinalBlock = true) { throw null; } + public static System.Buffers.OperationStatus ToUtf16(System.ReadOnlySpan source, System.Span destination, out int bytesRead, out int charsWritten, bool replaceInvalidSequences = true, bool isFinalBlock = true) { throw null; } } } namespace System.Threading diff --git a/src/System.Runtime/src/ApiCompatBaseline.uapaot.txt b/src/System.Runtime/src/ApiCompatBaseline.uapaot.txt index 4ecf26a99fde..6f2a1e82da74 100644 --- a/src/System.Runtime/src/ApiCompatBaseline.uapaot.txt +++ b/src/System.Runtime/src/ApiCompatBaseline.uapaot.txt @@ -1,21 +1,9 @@ Compat issues with assembly System.Runtime: TypesMustExist : Type 'System.ArgIterator' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.String System.Runtime.CompilerServices.RuntimeFeature.DefaultImplementationsOfInterfaces' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.Runtime.CompilerServices.RuntimeHelpers.PrepareMethod(System.RuntimeMethodHandle)' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.Runtime.CompilerServices.RuntimeHelpers.PrepareMethod(System.RuntimeMethodHandle, System.RuntimeTypeHandle[])' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.String.GetPinnableReference()' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.Text.Rune.DecodeFromUtf16(System.ReadOnlySpan, System.Text.Rune, System.Int32)' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.Text.Rune.DecodeLastFromUtf16(System.ReadOnlySpan, System.Text.Rune, System.Int32)' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.Text.Rune.DecodeFromUtf8(System.ReadOnlySpan, System.Text.Rune, System.Int32)' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.Text.Rune.DecodeLastFromUtf8(System.ReadOnlySpan, System.Text.Rune, System.Int32)' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.Text.Rune.EncodeToUtf16(System.Span)' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.Text.Rune.TryEncodeToUtf16(System.Span, System.Int32)' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.Text.Rune.EncodeToUtf8(System.Span)' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.Text.Rune.TryEncodeToUtf8(System.Span, System.Int32)' does not exist in the implementation but it does exist in the contract. -MembersMustExist : Member 'System.Range.GetOffsetAndLength(System.Int32)' does not exist in the implementation but it does exist in the contract. -TypesMustExist : Type 'System.Range.OffsetAndLength' does not exist in the implementation but it does exist in the contract. -CannotRemoveBaseTypeOrInterface : Type 'System.Memory' does not implement interface 'System.IEquatable>' in the implementation but it does in the contract. -CannotRemoveBaseTypeOrInterface : Type 'System.ReadOnlyMemory' does not implement interface 'System.IEquatable>' in the implementation but it does in the contract. -MembersMustExist : Member 'System.GC.GetGCMemoryInfo()' does not exist in the implementation but it does exist in the contract. -TypesMustExist : Type 'System.GCMemoryInfo' does not exist in the implementation but it does exist in the contract. MembersMustExist : Member 'System.GC.GetTotalAllocatedBytes(System.Boolean)' does not exist in the implementation but it does exist in the contract. +CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Reflection.CustomAttributeNamedArgument' in the contract but not the implementation. +TypeCannotChangeClassification : Type 'System.Reflection.CustomAttributeNamedArgument' is marked as readonly in the contract so it must also be marked readonly in the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.CompilerServices.IsReadOnlyAttribute' exists on 'System.Reflection.CustomAttributeTypedArgument' in the contract but not the implementation. +TypeCannotChangeClassification : Type 'System.Reflection.CustomAttributeTypedArgument' is marked as readonly in the contract so it must also be marked readonly in the implementation. +MembersMustExist : Member 'System.String System.Runtime.CompilerServices.RuntimeFeature.DefaultImplementationsOfInterfaces' does not exist in the implementation but it does exist in the contract. +Total Issues: 7 diff --git a/src/System.Runtime/src/MatchingRefApiCompatBaseline.txt b/src/System.Runtime/src/MatchingRefApiCompatBaseline.txt index aaec582797d6..aa7c74c7f725 100644 --- a/src/System.Runtime/src/MatchingRefApiCompatBaseline.txt +++ b/src/System.Runtime/src/MatchingRefApiCompatBaseline.txt @@ -14,4 +14,4 @@ MembersMustExist : Member 'System.Runtime.Serialization.SerializationInfo.StartD MembersMustExist : Member 'System.Runtime.Serialization.SerializationInfo.ThrowIfDeserializationInProgress()' does not exist in the reference but it does exist in the implementation. MembersMustExist : Member 'System.Runtime.Serialization.SerializationInfo.ThrowIfDeserializationInProgress(System.String, System.Int32)' does not exist in the reference but it does exist in the implementation. MembersMustExist : Member 'System.Runtime.Serialization.SerializationInfo.UpdateValue(System.String, System.Object, System.Type)' does not exist in the reference but it does exist in the implementation. -Total Issues: 26 +Total Issues: 15