Skip to content

Fix view/pure warnings on selector tests#2900

Merged
axic merged 1 commit intodevelopfrom
viewpure-warnings
Sep 13, 2017
Merged

Fix view/pure warnings on selector tests#2900
axic merged 1 commit intodevelopfrom
viewpure-warnings

Conversation

@axic
Copy link
Contributor

@axic axic commented Sep 13, 2017

Missed in #2473.

function f() external returns (bytes4) {
function () external g = this.h;
function f() view external returns (bytes4) {
function () pure external g = this.h;
Copy link
Contributor

Choose a reason for hiding this comment

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

Hm, that's interesting. Will this be parsed correctly?

Copy link
Contributor

Choose a reason for hiding this comment

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

And yes it is! :-)

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 was wondering too but it worked, since it is parsed by the same helper.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the error otherwise:

sel2.sol:5:33: Error: Type function () pure external is not implicitly convertible to expected type function () external.
                                function () external g = this.h;
                                ^-----------------------------^

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, interesting. We should actually allow that conversion at some point in the future.

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.

2 participants