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

Restore EnumerableSet.enumerate #2166

Closed
nventuro opened this issue Apr 2, 2020 · 4 comments
Closed

Restore EnumerableSet.enumerate #2166

nventuro opened this issue Apr 2, 2020 · 4 comments

Comments

@nventuro
Copy link
Contributor

nventuro commented Apr 2, 2020

This function was removed in #2160 due to issues with casting arrays of different types.

This can be achieved using assembly:

bytes32[] x = ...;
uint[] ret;
assembly { ret := x }

However, creating an assembly block brings all assembly keywords into scope, which causes shadowing warnings to be emitted by the compiler due to the existence of functions with names such as add in the same scope.

We should devise a way to bring enumerate back without these warnings being triggered.

@thegostep
Copy link

The better approach would be to store all base data as uint and delegate implementation of types to the user

@thegostep
Copy link

In any case, my solution here does not trigger a warning: #2295

@frangio
Copy link
Contributor

frangio commented Jun 30, 2020

delegate implementation of types to the user

We're avoiding this because it can easily result in unsafe casting that we'd rather keep internal to the library.

@ernestognw
Copy link
Member

Should've been closed by #2768

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants