Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Microsoft.Net.Compilers.Toolset #31403

Merged
merged 4 commits into from
Mar 31, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
</PropertyGroup>
<PropertyGroup Label="Manual">
<!-- Packages from dotnet/roslyn -->
<MicrosoftNetCompilersToolsetVersion>3.8.0-5.20519.18</MicrosoftNetCompilersToolsetVersion>
<MicrosoftNetCompilersToolsetVersion>3.10.0-1.final</MicrosoftNetCompilersToolsetVersion>
<!-- DiagnosticAdapter package pinned temporarily until migrated/deprecated -->
<MicrosoftExtensionsDiagnosticAdapterVersion>5.0.0-preview.4.20180.4</MicrosoftExtensionsDiagnosticAdapterVersion>
<!-- Build tool dependencies -->
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Components/src/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ Microsoft.AspNetCore.Components.RenderTree.Renderer.GetEventArgsType(ulong event
override Microsoft.AspNetCore.Components.LayoutComponentBase.SetParametersAsync(Microsoft.AspNetCore.Components.ParameterView parameters) -> System.Threading.Tasks.Task!
static Microsoft.AspNetCore.Components.ParameterView.FromDictionary(System.Collections.Generic.IDictionary<string!, object?>! parameters) -> Microsoft.AspNetCore.Components.ParameterView
virtual Microsoft.AspNetCore.Components.RenderTree.Renderer.DispatchEventAsync(ulong eventHandlerId, Microsoft.AspNetCore.Components.RenderTree.EventFieldInfo? fieldInfo, System.EventArgs! eventArgs) -> System.Threading.Tasks.Task!
*REMOVED*readonly Microsoft.AspNetCore.Components.RenderTree.RenderTreeEdit.RemovedAttributeName -> string
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dougbu This one was a bit odd, anyway to have a build error for this? The API exists.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could the problem be fact the line in the PublicAPI.Shipped.txt file has one more character❔ In any case, might work more consistently to remove the old and add the new (rather than just remove).

readonly Microsoft.AspNetCore.Components.RenderTree.RenderTreeEdit.RemovedAttributeName -> string!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, missing the !. And when 7.0 starts and these files are merged, it wouldn't have removed the API because it didn't match?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's my guess

readonly Microsoft.AspNetCore.Components.RenderTree.RenderTreeEdit.RemovedAttributeName -> string?
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public readonly struct RenderTreeEdit
/// If the <see cref="Type"/> value is <see cref="RenderTreeEditType.RemoveAttribute"/>,
/// gets the name of the attribute that is being removed.
/// </summary>
[FieldOffset(16)] public readonly string RemovedAttributeName;
[FieldOffset(16)] public readonly string? RemovedAttributeName;

private RenderTreeEdit(RenderTreeEditType type) : this()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Ignitor/src/ElementHive.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ private void ApplyEdits(RenderBatch batch, ContainerNode parent, int childIndex,
var node = parent.Children[childIndexAtCurrentDepth + siblingIndex];
if (node is ElementNode element)
{
var attributeName = edit.RemovedAttributeName;
var attributeName = edit.RemovedAttributeName!;

// First try to remove any special property we use for this attribute
if (!TryApplySpecialProperty(batch, element, attributeName, default))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public interface IKeyManager
/// This method will not mutate existing IKey instances. After calling this method,
/// all existing IKey instances should be discarded, and GetAllKeys should be called again.
/// </remarks>
void RevokeKey(Guid keyId, string reason = null);
void RevokeKey(Guid keyId, string? reason = null);

/// <summary>
/// Revokes all keys created before a specified date and persists the revocation to the
Expand All @@ -72,6 +72,6 @@ public interface IKeyManager
/// This method will not mutate existing IKey instances. After calling this method,
/// all existing IKey instances should be discarded, and GetAllKeys should be called again.
/// </remarks>
void RevokeAllKeys(DateTimeOffset revocationDate, string reason = null);
void RevokeAllKeys(DateTimeOffset revocationDate, string? reason = null);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public byte[] Decrypt(ArraySegment<byte> protectedPayload, ArraySegment<byte> ad
macOffset = eofOffset - _validationAlgorithmDigestLengthInBytes;
}

correctHash = hashAlgorithm.ComputeHash(protectedPayload.Array, ivOffset, macOffset - ivOffset);
correctHash = hashAlgorithm.ComputeHash(protectedPayload.Array!, ivOffset, macOffset - ivOffset);
}

// Step 4: Validate the MAC provided as part of the payload.
Expand Down Expand Up @@ -349,7 +349,7 @@ public byte[] Encrypt(ArraySegment<byte> plaintext, ArraySegment<byte> additiona
var mac = validationAlgorithm.ComputeHash(underlyingBuffer, KEY_MODIFIER_SIZE_IN_BYTES, checked((int)outputStream.Length - KEY_MODIFIER_SIZE_IN_BYTES));
outputStream.Write(mac, 0, mac.Length);

// At this point, outputStream := { keyModifier || IV || ciphertext || MAC(IV || ciphertext) }
// At this point, outputStream := { keyModifier || IV || ciphertext || MAC(IV || ciphertext) }
// And we're done!
return outputStream.ToArray();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.IAuthenticatedEncryp
Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.ManagedAuthenticatedEncryptorFactory.CreateEncryptorInstance(Microsoft.AspNetCore.DataProtection.KeyManagement.IKey! key) -> Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.IAuthenticatedEncryptor?
Microsoft.AspNetCore.DataProtection.DataProtectionOptions.ApplicationDiscriminator.get -> string?
Microsoft.AspNetCore.DataProtection.KeyManagement.IKey.CreateEncryptor() -> Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption.IAuthenticatedEncryptor?
Microsoft.AspNetCore.DataProtection.KeyManagement.IKeyManager.RevokeAllKeys(System.DateTimeOffset revocationDate, string? reason = null) -> void
Microsoft.AspNetCore.DataProtection.KeyManagement.IKeyManager.RevokeKey(System.Guid keyId, string? reason = null) -> void
Microsoft.AspNetCore.DataProtection.KeyManagement.Internal.DefaultKeyResolution.DefaultKey -> Microsoft.AspNetCore.DataProtection.KeyManagement.IKey?
Microsoft.AspNetCore.DataProtection.KeyManagement.Internal.DefaultKeyResolution.FallbackKey -> Microsoft.AspNetCore.DataProtection.KeyManagement.IKey?
Microsoft.AspNetCore.DataProtection.KeyManagement.Internal.IInternalXmlKeyManager.RevokeSingleKey(System.Guid keyId, System.DateTimeOffset revocationDate, string? reason) -> void
Expand All @@ -56,4 +58,4 @@ Microsoft.AspNetCore.DataProtection.XmlEncryption.NullXmlEncryptor.NullXmlEncryp
static Microsoft.AspNetCore.DataProtection.DataProtectionUtilityExtensions.GetApplicationUniqueIdentifier(this System.IServiceProvider! services) -> string?
static Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository.DefaultKeyStorageDirectory.get -> System.IO.DirectoryInfo?
static Microsoft.AspNetCore.DataProtection.Repositories.RegistryXmlRepository.DefaultRegistryKey.get -> Microsoft.Win32.RegistryKey?
virtual Microsoft.AspNetCore.DataProtection.XmlEncryption.CertificateResolver.ResolveCertificate(string! thumbprint) -> System.Security.Cryptography.X509Certificates.X509Certificate2?
virtual Microsoft.AspNetCore.DataProtection.XmlEncryption.CertificateResolver.ResolveCertificate(string! thumbprint) -> System.Security.Cryptography.X509Certificates.X509Certificate2?
6 changes: 3 additions & 3 deletions src/Hosting/TestHost/src/TestWebSocket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public override async Task<WebSocketReceiveResult> ReceiveAsync(ArraySegment<byt
ThrowIfInputClosed();
ValidateSegment(buffer);
// TODO: InvalidOperationException if any receives are currently in progress.

Message? receiveMessage = _receiveMessage;
_receiveMessage = null;
if (receiveMessage == null)
Expand Down Expand Up @@ -148,7 +148,7 @@ public override async Task<WebSocketReceiveResult> ReceiveAsync(ArraySegment<byt
Array.Copy(receiveMessage.Buffer.Array!, receiveMessage.Buffer.Offset, buffer.Array!, buffer.Offset, count);
if (!endOfMessage)
{
receiveMessage.Buffer = new ArraySegment<byte>(receiveMessage.Buffer.Array, receiveMessage.Buffer.Offset + count, receiveMessage.Buffer.Count - count);
receiveMessage.Buffer = new ArraySegment<byte>(receiveMessage.Buffer.Array!, receiveMessage.Buffer.Offset + count, receiveMessage.Buffer.Count - count);
_receiveMessage = receiveMessage;
}
endOfMessage = endOfMessage && receiveMessage.EndOfMessage;
Expand Down Expand Up @@ -257,7 +257,7 @@ private class ReceiverSenderBuffer
private bool _disposed;
private readonly SemaphoreSlim _sem;
private readonly Queue<Message> _messageQueue;

public ReceiverSenderBuffer()
{
_sem = new SemaphoreSlim(0);
Expand Down
3 changes: 1 addition & 2 deletions src/Http/Headers/src/BaseHeaderParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ public sealed override bool TryParseValue(StringSegment value, ref int index, ou
return SupportsMultipleValues;
}

T result;
var length = GetParsedValueLength(value, current, out result);
var length = GetParsedValueLength(value, current, out var result);

if (length == 0)
{
Expand Down
11 changes: 4 additions & 7 deletions src/Http/Headers/src/HttpHeaderParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ public bool SupportsMultipleValues

// If a parser returns 'null', it means there was no value, but that's valid (e.g. "Accept: "). The caller
// can ignore the value.
T result;
if (!TryParseValue(value, ref index, out result))
if (!TryParseValue(value, ref index, out var result))
{
throw new FormatException(string.Format(CultureInfo.InvariantCulture,
"The header contains invalid values at index {0}: '{1}'", index, value.Value ?? "<null>"));
Expand Down Expand Up @@ -75,15 +74,14 @@ protected virtual bool TryParseValues(IList<string>? values, bool strict, [NotNu

while (!string.IsNullOrEmpty(value) && index < value.Length)
{
T output;
if (TryParseValue(value, ref index, out output))
if (TryParseValue(value, ref index, out var output))
{
// The entry may not contain an actual value, like " , "
if (output != null)
{
if (results == null)
{
results = new List<T>(); // Allocate it only when used
results = new List<T>(); // Allocate it only when used
}
results.Add(output);
}
Expand Down Expand Up @@ -133,8 +131,7 @@ protected virtual IList<T> ParseValues(IList<string>? values, bool strict)

while (!string.IsNullOrEmpty(value) && index < value.Length)
{
T output;
if (TryParseValue(value, ref index, out output))
if (TryParseValue(value, ref index, out var output))
{
// The entry may not contain an actual value, like " , "
if (output != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public void SetResult(object tcs, object? result)
// If necessary, attempt a cast
var typedResult = result is T resultT
? resultT
: (T)Convert.ChangeType(result, typeof(T), CultureInfo.InvariantCulture);
: (T)Convert.ChangeType(result, typeof(T), CultureInfo.InvariantCulture)!;

typedTcs.SetResult(typedResult!);
}
Expand Down