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

Allow mapping arguments for public and external library functions. #5382

Merged
merged 1 commit into from
Nov 26, 2018

Conversation

ekpyron
Copy link
Member

@ekpyron ekpyron commented Nov 9, 2018

Fixes #4635.

I may be missing something here, since the description in the issue predicts more changes to be necessary.

Also: the issue is restricted to public library functions - no reason to exclude external ones, though, is there?
Also: do we want to support returning mappings from public/external library functions as well? It seems like that would be more involved, but I could think of use cases for that as well (e.g. selecting a mapping from an argument that is a mapping to mappings).

@ekpyron ekpyron self-assigned this Nov 9, 2018
@codecov

This comment has been minimized.

@chriseth
Copy link
Contributor

chriseth commented Nov 9, 2018

Sure, please also allow external functions and returning mappings. Don't forget changelog (which should be for 0.5.1, I would presume) and documentation.

libsolidity/ast/Types.h Outdated Show resolved Hide resolved
Changelog.md Outdated Show resolved Hide resolved
@ekpyron ekpyron force-pushed the libraryMappingPublic branch 2 times, most recently from 4882a17 to e3034ef Compare November 12, 2018 13:24
@ekpyron ekpyron force-pushed the libraryMappingPublic branch 3 times, most recently from 1972cd3 to ee97963 Compare November 14, 2018 13:37
@ekpyron ekpyron force-pushed the libraryMappingPublic branch 2 times, most recently from a1d5bdb to ae719f6 Compare November 14, 2018 15:48
libsolidity/analysis/TypeChecker.cpp Outdated Show resolved Hide resolved
libsolidity/analysis/TypeChecker.cpp Show resolved Hide resolved
libsolidity/codegen/ExpressionCompiler.cpp Show resolved Hide resolved
}
}
)";
char const* sourceCode = R"(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation seems to be off in tests, but that might be only on Github.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is just how github displays tabs.

@axic
Copy link
Member

axic commented Nov 22, 2018

Do we have syntax tests for: non-storage mapping in a library function?

And all other valid/invalid combinations?

@chriseth
Copy link
Contributor

I would say the tests are fine.

leonardoalt
leonardoalt previously approved these changes Nov 26, 2018
@chriseth
Copy link
Contributor

Rebased.

@chriseth chriseth merged commit 240ad0e into develop Nov 26, 2018
@ekpyron ekpyron deleted the libraryMappingPublic branch December 4, 2018 22:38
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 this pull request may close these issues.

4 participants