-
Notifications
You must be signed in to change notification settings - Fork 102
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
add ut for property #1233
base: master
Are you sure you want to change the base?
add ut for property #1233
Conversation
My fault, not applying |
fix non-static field get and set
Ut fault |
Because of calling ++ on null |
I am debugging this, but without a proper tool, it is very hard to locate where the opcode is being processed in the compiler, very hard to debug. |
Will be hard to tackle. Smart contract _initialize only handles static constructors, and ignores non-static initial values. |
initialize with 0; need instance constructor if non-static field exists
Should be ready for merge |
.ToArray(); | ||
|
||
// Process each field using its symbol | ||
ContractFields.ForEach(f => AddStaticField(f.Field)); |
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.
ContractFields.ForEach(f => AddStaticField(f.Field)); | |
foreach ((IFieldSymbol f, _) in ContractFields) | |
AddStaticField(f); |
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.
array.ForEach is using Akka.Util.Internal, and is harder to debug
@@ -29,6 +29,7 @@ | |||
using System.Linq; | |||
using System.Runtime.CompilerServices; | |||
using System.Text; | |||
using Akka.Util.Internal; |
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.
using Akka.Util.Internal; |
{ | ||
if(_context.ContractFields.Any(f => | ||
SymbolEqualityComparer.Default.Equals(f.Field, field)) && | ||
(field.Type.GetStackItemType() == StackItemType.Integer || field.Type.GetStackItemType() == StackItemType.Integer)) |
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.
f.Field.Type😰?
If we apply the methodology in d552e2e , we try to convert all non-static fields (in a class that directly inherit SmartContract) to static. This can bring trouble when we read the non-static fields, and we will need to change many codes related to IFieldSymbol and IdentifierNameSyntax. |
this pr adds ut to property to demonstrate that property actually does not work correctly.