[1.0 -> main] Don't use deduced return type in test contract as it fails in template instantation #680
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Partially resolves #677.
This resolves the first issue:
/home/greg/github/enf/cdt/build_clang18_debug/bin/../include/eosiolib/contracts/eosio/multi_index.hpp:442:96: error: function 'primary_key' with deduced return type cannot be used before it is defined
Remaining issue
An issue remains with the use of the macro
EOSIO_DISPATCH( eosiosystem::system_contract, ...
inunittests/contracts/eosio.system/eosio.system.cpp
.Original issue was:
error: case value is not a constant expression
becausecheck()
is notconstexpr
.I tried making
check()
constexpr in cdt'slibraries/eosiolib/core/eosio/check.hpp
, but check calls the extern "C" functionseosio_assert
which I don't think can be made constexpr.So I tried updating the
EOSIO_DISPATCH
to use a series ofif () ... else
instead of a switch statement. This appears to work, but theEOSIO_DISPATCH
still fails on this contract, and it appears that it is because it attempts to dispatch too many actions:The same macro builds fine if I remove a bunch of the actions. I wonder if we hit a preprocessor recursion limit, but I don't see an option to change it.