Merge relevant changes from the auto-generated System.Runtime ref#33512
Merge relevant changes from the auto-generated System.Runtime ref#33512ahsonkhan merged 3 commits intodotnet:masterfrom
Conversation
| void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { } | ||
| public override string ToString() { throw null; } | ||
| public string ToString(int startIndex, int length) { throw null; } | ||
| public partial struct ChunkEnumerator |
| public bool RunContinuationsAsynchronously { get { throw null; } set { throw null; } } | ||
| public void SetException(System.Exception error) { throw null; } | ||
| public void SetResult(TResult result) { throw null; } | ||
| public bool RunContinuationsAsynchronously { get { throw null; } set { } } |
There was a problem hiding this comment.
From #33104
cc @stephentoub, please review for correctness
| } | ||
| public delegate void AsyncCallback(System.IAsyncResult ar); | ||
| [System.AttributeUsageAttribute((System.AttributeTargets)(32767), Inherited=true, AllowMultiple=false)] | ||
| [System.AttributeUsageAttribute(System.AttributeTargets.All, Inherited=true, AllowMultiple=false)] |
There was a problem hiding this comment.
It's great to see these values fixed to be readable :)
| public delegate void Action<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9); | ||
| public static partial class Activator | ||
| { | ||
| public static System.Runtime.Remoting.ObjectHandle CreateInstance(string assemblyName, string typeName) { throw null; } |
There was a problem hiding this comment.
From #30809
cc @MarcoRossignoli, please review for correctness
There was a problem hiding this comment.
too late for me...but seems ok...one curiosity, it works also for new ref project?I mean if we create an empty file and run tool...for issue like https://github.com/dotnet/corefx/issues/33117
There was a problem hiding this comment.
Good question!
If the file doesn't exist, then the tool throws an exception (can't find the expected file). We can probably fix it to create the ref file or at least fail gracefully.
Unhandled Exception: System.IO.DirectoryNotFoundException: Could not find a part of the path 'E:\GitHub\Fork\corefx\src\System.Json\ref\System.Json.cs'.
at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle)
at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize)
at System.IO.StreamWriter..ctor(String path, Boolean append)
at System.IO.File.CreateText(String path)
at GenAPI.Program.Main(String[] args)
cc @weshaggard
If, however, we create an empty file first in the correct folder (ref directory), then yes, it would work.
I just tried it with System.Json and it worked great. We just have to make sure to add back Obsolete or EditorBrowsableNever attributes that might exist in the source (fyi, System.Json doesn't have such attributes so the generated ref should be correct).
cc @danmosemsft
| public override int Read(System.Span<byte> buffer) { throw null; } | ||
| public override System.Threading.Tasks.Task<int> ReadAsync(byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken) { throw null; } | ||
| public override System.Threading.Tasks.ValueTask<int> ReadAsync(System.Memory<byte> buffer, System.Threading.CancellationToken cancellationToken = default) { throw null; } | ||
| public override System.Threading.Tasks.ValueTask<int> ReadAsync(System.Memory<byte> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } |
There was a problem hiding this comment.
It'd be nice if the tool didn't require expanding this, but I realize that's how it's currently implemented.
| public static System.String Format(System.String format, params object[] args) { throw null; } | ||
| public System.CharEnumerator GetEnumerator() { throw null; } | ||
| public override int GetHashCode() { throw null; } | ||
| public static int GetHashCode(System.ReadOnlySpan<char> value) { throw null; } |
There was a problem hiding this comment.
From #33316
cc @GrabYourPitchforks, please review for correctness
| public virtual void Unlock(long position, long length) { } | ||
| public override void Write(byte[] array, int offset, int count) { } | ||
| public override void Write(System.ReadOnlySpan<byte> buffer) { throw null; } | ||
| public override void Write(System.ReadOnlySpan<byte> buffer) { } |
There was a problem hiding this comment.
void returning methods don't need a method body, if anyone was wondering
| public bool RunContinuationsAsynchronously { get { throw null; } set { throw null; } } | ||
| public void SetException(System.Exception error) { throw null; } | ||
| public void SetResult(TResult result) { throw null; } | ||
| public bool RunContinuationsAsynchronously { get { throw null; } set { } } |
There was a problem hiding this comment.
set doesn't need a method body, if anyone was wondering
…tnet#33512) * Merge relevant changes from the auto-generated System.Runtime ref * Update attributes and default enum values * Add back accidentally removed EditorBrowsableState attribute
…tnet/corefx#33512) * Merge relevant changes from the auto-generated System.Runtime ref * Update attributes and default enum values * Add back accidentally removed EditorBrowsableState attribute Commit migrated from dotnet/corefx@a624719
Though documentation on updating the System.Runtime ref is a bit lacking, the steps I followed might help others (in particular for System.Runtime):
msbuild /t:GenerateReferenceSource /p:ConfigurationGroup=Releasefrom the System.Runtime/ref directory.https://github.com/dotnet/corefx/blob/master/Documentation/project-docs/developer-guide.md#testing-with-private-coreclr-bits
Added this documentation here: #33515