-
Notifications
You must be signed in to change notification settings - Fork 1k
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
.NET 9 #3576
.NET 9 #3576
Conversation
@@ -54,7 +54,7 @@ public void TestGetBitLength() | |||
var random = new Random(); | |||
|
|||
// Big Number (net standard didn't work) | |||
VerifyGetBitLength(BigInteger.One << 32 << int.MaxValue, 2147483680); | |||
Assert.ThrowsException<OverflowException>(() => VerifyGetBitLength(BigInteger.One << 32 << int.MaxValue, 2147483680)); |
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.
why is this change? the behavor is no longer the same?
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.
BigInteger.One << 32 << int.MaxValue
will throw OverflowException in .net 9
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.
Then this test is useless
@@ -25,7 +25,7 @@ public class UT_ByteExtensions | |||
public void TestToHexString() | |||
{ | |||
byte[] nullStr = null; | |||
Assert.ThrowsException<NullReferenceException>(() => nullStr.ToHexString()); | |||
Assert.ThrowsException<ArgumentNullException>(() => nullStr.ToHexString()); |
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.
does this mean Net9.0 has changed the exception type?
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.
yes
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.
does this mean Net9.0 has changed the exception type?
ToHexString
uses Convert.ToHexStrongLower
when run with NET.9.
May need to add an argument null-check to keep same semantics.
I rather not go to Also you missed |
I didn't miss global.json {
"sdk": {
"version": "9.0.100",
"rollForward": "latestFeature",
"allowPrerelease": false
}
} I’m not sure whether to upgrade to .NET 9. I'll leave it up to you core developers to decide! |
I am in favor, next year we move to long term again and so on. |
me too |
This will break the functionally of |
No dont leave it up to them. If it's dotnet 9.0 then have to upgrade. there is no way around it. |
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.
Why are you changing *.cs
files?
Because some of the exception types change, and some of the dotnet format rules change. |
That's true |
{ | ||
using (ScriptBuilder script = new()) | ||
{ | ||
ReadOnlySpan<byte> span = 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.
should be using empty
, null
doesn't really work for spans
@@ -29,7 +28,7 @@ public class Map : CompoundType, IReadOnlyDictionary<PrimitiveType, StackItem> | |||
/// </summary> | |||
public const int MaxKeySize = 64; | |||
|
|||
private readonly OrderedDictionary<PrimitiveType, StackItem> dictionary = new(); | |||
private readonly Collections.OrderedDictionary<PrimitiveType, StackItem> dictionary = new(); |
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.
Where is Collections
pointing to; system
or vm
?
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.
VM
We need to revert it neo-project/neo-devpack-dotnet#1257 (comment) |
update to .net 9