-
Notifications
You must be signed in to change notification settings - Fork 11
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
[BUG] Infinite Types Being Inferred #92
Labels
bug
Something isn't working
Comments
Here is a minimal reproducible based on the test in struct ShardData {
// Changing the order of the struct also affects the triggering of the bug
uint24 shareMicros;
uint64 firstSibling;
}
contract Shardwallet {
address private _owner;
uint64 nextTokenId_;
mapping(uint64 => ShardData) private shardData_;
// It also has to be an array to trigger the bug
mapping(uint64 => uint64[]) private parents_;
function computeClaimed() public {
parents_[nextTokenId_] = new uint64[](1);
ShardData memory data = shardData_[0x0];
uint64 childIndex = 0x0 - data.firstSibling;
uint64[] memory first_access = parents_[data.firstSibling];
uint64[] memory second_access = parents_[shardData_[0x0].firstSibling];
}
} Note that you need to run it with optimization (
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the Bug
We currently infer infinite types (which get loop-broken and written out as
AbiType::InfiniteType
) in certain cases. This is never correct in the output, and is instead a sign that we are likely not inferring things properly.Previously this has been due to loops in usages of certain values with type constructor types, and has indicated that we are not quite correct in one or more of our inference rules.
To Reproduce
Steps to reproduce the behavior:
shardwallet.rs
test.Expected Behaviour
We do not infer infinite types in the output in situations where it should be impossible to have an infinite type.
The text was updated successfully, but these errors were encountered: