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 this.f.selector to be pure. #3498

Merged
merged 2 commits into from
Feb 13, 2018
Merged

Allow this.f.selector to be pure. #3498

merged 2 commits into from
Feb 13, 2018

Conversation

chriseth
Copy link
Contributor

Fixes #3494

if (Declaration const* declaration = expr->annotation().referencedDeclaration)
{
u256 identifier;
if (auto const* variable = dynamic_cast<VariableDeclaration const*>(declaration))
Copy link
Member

Choose a reason for hiding this comment

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

Hm I wonder if we actually want to support .selector on public variables. I don't think we had test cases for that before.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

shall I add a test case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It works. I will add a test case.

@@ -6904,15 +6904,7 @@ BOOST_AUTO_TEST_CASE(function_types_sig)
CHECK_ERROR(text, TypeError, "Member \"selector\" not found");
text = R"(
contract C {
function f() view external returns (bytes4) {
Copy link
Member

Choose a reason for hiding this comment

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

Why did we had a duplicate case here? :)

Perhaps something was lost during rebases.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think one of the cases used var before but we removed that and now they are identical.

@chriseth
Copy link
Contributor Author

Updated.

@axic
Copy link
Member

axic commented Feb 13, 2018

Fails on end-to-end tests.

@chriseth chriseth merged commit 23484ba into develop Feb 13, 2018
@axic axic deleted the allowthisfselector branch February 13, 2018 16:20
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.

3 participants