Inconsistent behavior of *
and empty string in outputSelection
#15747
Labels
bug 🐛
low effort
There is not much implementation work to be done. The task is very easy or tiny.
low impact
Changes are not very noticeable or potential benefits are limited.
must have eventually
Something we consider essential but not enough to prevent us from releasing Solidity 1.0 without it.
Discovered in #15447.
Description
outputSelection
in Standard JSON has two selectors that are handled specially:"*"
and""
.The asterisk consistently works a wildcard selecting all sources/contracts. The empty string, on the other hand, is sometimes treated as a wildcard and sometimes as a literal empty string:
"*"
acts as a wildcard matching all sources, while with a specific name (or empty string) will only match a source with an empty name.Another quirk is that, even though
*
is a valid source name, it cannot be matched literally. It can still be matched with a wildcard, but cannot be selected on its own. This should be documented because tools must be aware of this and handle it in some way (e.g. by disallowing*
as a name). Perhaps we should consider disallowing*
as well.Environment
Steps to Reproduce
See
standard_output_selection_multiple_matching_source_and_contract_selectors/input.json
.The text was updated successfully, but these errors were encountered: