-
Notifications
You must be signed in to change notification settings - Fork 106
Fix forward-referenced contract dependencies #1415
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
base: dev
Are you sure you want to change the base?
Conversation
|
|
||
| foreach (var classSymbol in classSymbols) | ||
| { | ||
| if (!allSmartContracts.Contains(classSymbol)) |
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.
No need to check if it's abstract here?
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.
Ping @Jim8y
|
Any test for this ? |
this is hard to be tested.... cuase it will be related to multiple contract situations. This is not a serious issue as well. |
all smart contract symbols before building the dependency graph
contracts declared later are preserved and _nonDependencies cannot trim
required types
rest of the compilation flow unchanged
Issue:
CompilationEngine only added a smart contract to classDependencies after it
had already been visited, so a field or property that pointed to a contract
declared later looked like a plain class reference. When _nonDependencies
ran, those untracked contracts were considered foreign and stripped from the
compilation context, leading to partial NEF output in multi-contract projects.
Fix Details:
The change executes two passes over the syntax trees:
contract symbol to the dependency list, deduplicating and skipping abstract
types.
This ensures the subsequent topological sort sees the full dependency graph
regardless of declaration order, so every required contract is compiled and
emitted.