Open
Description
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:
- When selecting outputs, it's a literal empty string. Will never match an output.
- When selecting contracts, it's a literal empty string. Will never match a contract.
- When selecting sources, it depends on what's at the contract level. Combined with
"*"
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
- Compiler version: 0.8.28
Steps to Reproduce
See standard_output_selection_multiple_matching_source_and_contract_selectors/input.json
.