-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Merge relevant changes from the auto-generated System.Runtime ref #33512
Conversation
@@ -7728,6 +7718,12 @@ public struct ChunkEnumerator | |||
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From #33104
cc @stephentoub, please review for correctness
@@ -346,7 +346,7 @@ public partial class ArrayTypeMismatchException : System.SystemException | |||
public ArrayTypeMismatchException(string message, System.Exception innerException) { } | |||
} | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's great to see these values fixed to be readable :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, definitely!
@@ -67,15 +67,15 @@ public partial class AccessViolationException : System.SystemException | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From #30809
cc @MarcoRossignoli, please review for correctness
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -5159,15 +5158,15 @@ public partial class FileStream : System.IO.Stream | |||
public override int Read(byte[] array, int offset, int count) { throw null; } | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be nice if the tool didn't require expanding this, but I realize that's how it's currently implemented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. We should fix it. dotnet/arcade#1341
@@ -2346,9 +2345,9 @@ public sealed partial class String : System.Collections.Generic.IEnumerable<char | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From #33316
cc @GrabYourPitchforks, please review for correctness
public override int ReadByte() { throw null; } | ||
public override long Seek(long offset, System.IO.SeekOrigin origin) { throw null; } | ||
public override void SetLength(long value) { } | ||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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=Release
from 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