Skip to content

Properly detect which array and struct types are unsupported by the old ABI encoder.#3549

Merged
axic merged 3 commits intodevelopfrom
fixmultidim
Mar 6, 2018
Merged

Properly detect which array and struct types are unsupported by the old ABI encoder.#3549
axic merged 3 commits intodevelopfrom
fixmultidim

Conversation

@chriseth
Copy link
Contributor

Fixes #3176

@chriseth chriseth requested a review from axic February 19, 2018 17:46
@chriseth chriseth force-pushed the fixmultidim branch 2 times, most recently from a5bc2ea to 4ef8f24 Compare February 19, 2018 18:39
char const* text = R"(
contract C {
struct S { string[] s; }
function f() public pure returns (S x) {}
Copy link
Contributor

Choose a reason for hiding this comment

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

Hm, why does this one needs a named return parameter while the other one doesn't?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably a rebasing problem.

m_errorReporter.typeError(
var->location(),
"Structs are only supported in the new experimental ABI encoder. "
"This type is only supported in the new experimental ABI encoder. "
Copy link
Contributor

Choose a reason for hiding this comment

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

Were the current (not the new ones) tests only checking for "only supported" or we didn't had tests to cover this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We only had tests for structs, not structs inside arrays or arrays containing arrays etc.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah but none of the test expectations had to change so either there was no text or it didn't expect the entire message.

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 seems we did not have tests for that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this a blocker for merging? Please make clear statements.

Copy link
Contributor

Choose a reason for hiding this comment

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

Grepped the sources, there was no test for this before.

Copy link
Contributor

Choose a reason for hiding this comment

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

No, there are tests now hopefully covering all of it.

else if (!m_baseType->canBeUsedExternally(_inLibrary))
return false;
else if (m_baseType->category() == Category::Array && m_baseType->isDynamicallySized())
return false;
Copy link
Contributor

Choose a reason for hiding this comment

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

So basically we enable multi level arrays now for non-experimental mode. Will it be still disabled due to no support for returndatacopy? Do we have a test for this?

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 is still disabled by the type checker.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The function typeSupportedByOldABIEncoder is much stricter than what was there before.

@chriseth
Copy link
Contributor Author

@axic anything still to be done here?

@chriseth
Copy link
Contributor Author

chriseth commented Mar 5, 2018

Failure on travis is unrelated.

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